torstai 4. huhtikuuta 2013

Understanding binary codes

Binary that weird looking number line. It is actually very easy to understand how to calculate binaries. Normal binary consists of numbers one "1" and zero "0" and the number 1 means that the value is turned ON and if the number is 0 it means it is turned OFF.

We start from number one always multiplying it by two. We get numbers 1,2,4,8,16,32,64,128. Eight numbers. Then we make a table:

00000000
1248163264128

Remember, 0 is OFF. 1 is ON. Now the binary is 0 because every number is turned off. Lets turn something on.

01010000
1248163264128

Now two values are turned on, and guess what; just simply calculate the numbers together. Number two is ON so we have 2 and the number 8 is turned ON so we have numbers 2 and 8. 2 + 8 = 10. The binary value is ten. Simple as that.

11111111
1248163264128

And if we turn everything on we have 1+2+4+8+16+32+64+128 = 255. 

Now you should know how to calculate binary numbers. You can easily change IP address to binary form for example or vice versa. 

Ei kommentteja:

Lähetä kommentti