Welcome to my isle... Here you would probably see what are the things of interest to me that i would publish.Hmm, well maybe sometimes my thoughts too...

Sunday, January 23, 2005

Bits and Bytes

Well, you should have heard about bits and bytes just by coming into contact with them. But what exactly are they and how do they come about?

Computers operate on the base-2 number system(aka binary number system).This is because the system is eay to use. Come on, only 2 digits are used 0 or 1.Bit is actually the abbreviation for Binary digIT. An example to find out what 1011 stand for is this:
1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (1 * 2^0) = 8 + 0 + 2 + 1 = 11
So computers use 1011 to store the digit 11.

We normally see bytes in computer. 1 byte is actually 8 bits. Why is it so? This is like asking why are there 12 eggs in a dozen. So it is just like a common consent. With 8 bits in a byte, you can represent 256 values ranging from 0 to 255:

0 = 00000000
1 = 00000001
2 = 00000010
...254 = 11111110
255 = 11111111

In the ASCII character set, each binary value between 0 and 127 is given a specific character.
Using the eg of "Four score and seven years ago," Notepad would use 1 byte of memory per character (including 1 byte for each space character between the words -- ASCII character 32)

Name Abbr. Size
Kilo K 2^10 = 1,024
Mega M 2^20 = 1,048,576
so 1kb =1024b actually..

Here's an eg of binary math:
010
+ 111
---
1001
To summarize, when u add 0 to 1, you get 1. But when you add 1 to 1 u need to carry over so put 0 first then 1 is added to (0+1:extreme left side). You would get another carry over. Again put 0 first then the left over of 1 is displayed as 1.

Wow, actually this whole thing is so simple... can't believe it :Þ

0 Comments:

Post a Comment

<< Home