[Tutorial] An in-depth look at binary and binary operators.
#44

Nice topic, I just learned about it (scientific programming) at university.

Hexadecimal system isn't that hard, it's just another way to write bytes. Like anything on your computer...

Here's a table of hexidecimal code:
Код:
0000 -- 0
0001 -- 1
0010 -- 2
0011 -- 3
0100 -- 4
0101 -- 5
0110 -- 6
0111 -- 7
1000 -- 8
1001 -- 9
1010 -- a
1011 -- b
1100 -- c
1101 -- d
1110 -- e
1111 -- f
so
Код:
0100 0010 1100 1101 0001 1101 0000 1111
in binary would be
Код:
42cd1d0f
in hexadecimal system.

It's the same as calculating bits the way explained in the first post, but only with 4 bits (thus max is 1111 = 1 * 2^3 + 1 * 2^2 + 1 * 2^1 + 1 * 2^0 = 8+4+2+1=15) and where you replace 10 by a , 11 by b, etc.

This is a quite useful tutorial, but you need to have some knowledge and a good amount of interest in it before you'll be able to understand it.

But, I have a question. I didn't fully understand what my teacher was saying. We were talking about 64bit and 32bit - I understood that - but I didn't understand how the numbers are saved.

Basically, in 64bit, you've got:

1 bit for the sign = 0 for positive numbers, 1 for negative
11 bits for the exponents = didn't really understand that, knowing you've got...
...52 bits for the mantissa.

And later on, he said the last number of the exponent would be the cypher before the comma...how does the system recognise it's the 1 or 0 before the "." or if it is actually an exponent? =/ I'm making this hard for you

Oh and for those more interested in binary code: calculating with it is easy as hell - that's why it's genious.
If you want to add, just do like you would do with normal numbers.
Код:
   0101 // 5
   0111 // 7
+----------
   0212 // 2 is not a bit. That's why we move it to the left, like we do in decimal counting. 2 becomes 0 and we add a 1 to the digit on the left of it
   0220 // stil 2's
   0300 // zamg a 3. Remain a 1 and add a 1 to the digit on the left - like adding 11 in decimal
   1100 // = 12. Worked

So, a bit (inside joke) shorter:
  111
  0101
  0111
+------
  1100

This was a difficult example, so I'll take an easier one for my short method:
   1    // This is the one you get when you sum up the two ones on the right. 
 0010 // 2
 0010 // 2
+----
 0100 // 4
Btw, why did they ever use digits? Because it's easy & natural. First scripts were made in wood (no joke), it had a hole in it (1) or it didn't (0). Magnetic charge used later on: Positive (1) or negative (0). Fybernet: light (1) or not (0). Genious, but hard to understand. (I think you should always know why something "unnatural" was invented.
Reply


Messages In This Thread
An in-depth look at binary and binary operators. - by Kyosaur - 18.09.2010, 10:50
Re: An in-depth look at binary and binary operators. - by Kyosaur - 18.09.2010, 10:52
Re: An in-depth look at binary and binary operators. - by LarzI - 18.09.2010, 11:07
Re: An in-depth look at binary and binary operators. - by Hiddos - 18.09.2010, 11:18
Re: An in-depth look at binary and binary operators. - by Leeroy. - 18.09.2010, 11:19
Re: An in-depth look at binary and binary operators. - by Kyosaur - 18.09.2010, 11:22
Re: An in-depth look at binary and binary operators. - by LarzI - 18.09.2010, 11:23
Re: An in-depth look at binary and binary operators. - by Mimic - 18.09.2010, 11:26
Re: An in-depth look at binary and binary operators. - by Hiddos - 18.09.2010, 11:27
Re: An in-depth look at binary and binary operators. - by Kyosaur - 18.09.2010, 11:34
Re: An in-depth look at binary and binary operators. - by DiddyBop - 18.09.2010, 12:53
Re: An in-depth look at binary and binary operators. - by Simon - 19.09.2010, 08:55
Re: An in-depth look at binary and binary operators. - by Kyosaur - 19.09.2010, 22:21
Re: An in-depth look at binary and binary operators. - by Backwardsman97 - 20.09.2010, 02:46
Re: An in-depth look at binary and binary operators. - by Hiddos - 23.09.2010, 16:09
Re: An in-depth look at binary and binary operators. - by Calgon - 23.09.2010, 19:35
Re: An in-depth look at binary and binary operators. - by Kyosaur - 23.09.2010, 22:34
Re: An in-depth look at binary and binary operators. - by Chaprnks - 24.09.2010, 00:45
Re: An in-depth look at binary and binary operators. - by Slice - 25.09.2010, 18:57
Re: An in-depth look at binary and binary operators. - by MrDeath537 - 26.09.2010, 00:04
Re: An in-depth look at binary and binary operators. - by LarzI - 26.09.2010, 09:56
Re: An in-depth look at binary and binary operators. - by Kyosaur - 26.09.2010, 10:16
Re: An in-depth look at binary and binary operators. - by Tannz0rz - 26.09.2010, 10:35
Re: An in-depth look at binary and binary operators. - by LarzI - 26.09.2010, 10:36
Re: An in-depth look at binary and binary operators. - by Kyosaur - 29.09.2010, 13:42
Re: An in-depth look at binary and binary operators. - by Slice - 29.09.2010, 14:24
Re: An in-depth look at binary and binary operators. - by Kyosaur - 29.09.2010, 14:55
Re: An in-depth look at binary and binary operators. - by Slice - 29.09.2010, 15:02
Re: An in-depth look at binary and binary operators. - by Kyosaur - 29.09.2010, 15:14
Re: An in-depth look at binary and binary operators. - by Slice - 29.09.2010, 15:41
Re: An in-depth look at binary and binary operators. - by LarzI - 29.09.2010, 16:35
Re: An in-depth look at binary and binary operators. - by Tannz0rz - 29.09.2010, 17:47
Re: An in-depth look at binary and binary operators. - by LarzI - 29.09.2010, 18:11
Re: An in-depth look at binary and binary operators. - by [HLF]Southclaw - 09.03.2011, 19:11
Re: An in-depth look at binary and binary operators. - by Kyosaur - 09.03.2011, 23:39
Re: An in-depth look at binary and binary operators. - by black_dota - 10.03.2011, 06:18
Re: An in-depth look at binary and binary operators. - by alpha500delta - 10.03.2011, 13:21
Re: An in-depth look at binary and binary operators. - by Kyosaur - 10.03.2011, 13:32
Re: An in-depth look at binary and binary operators. - by [HLF]Southclaw - 10.03.2011, 15:33
Re: An in-depth look at binary and binary operators. - by Mean - 10.03.2011, 16:02
Re: An in-depth look at binary and binary operators. - by SkizzoTrick - 10.03.2011, 17:20
Re: An in-depth look at binary and binary operators. - by Wesley221 - 03.10.2011, 17:08
Re: An in-depth look at binary and binary operators. - by Cank - 07.10.2011, 15:04
Re: An in-depth look at binary and binary operators. - by [MM]IKKE - 11.10.2011, 23:36
Re: An in-depth look at binary and binary operators. - by Kyosaur - 11.10.2011, 23:56
Re: An in-depth look at binary and binary operators. - by Davz*|*Criss - 12.10.2011, 10:58
Re: An in-depth look at binary and binary operators. - by [MM]IKKE - 12.10.2011, 11:33
Re: An in-depth look at binary and binary operators. - by Kyosaur - 13.10.2011, 03:58
Re: An in-depth look at binary and binary operators. - by [HLF]Southclaw - 13.10.2011, 10:44
Re: An in-depth look at binary and binary operators. - by System64 - 31.03.2012, 12:41
Re: An in-depth look at binary and binary operators. - by LarzI - 05.05.2013, 14:20
Re: An in-depth look at binary and binary operators. - by Pandex - 01.08.2013, 20:41

Forum Jump:


Users browsing this thread: 1 Guest(s)