|
DADDY BOB'S COMPUTER Q & A
July 2, 2006
Q.
Why does my computer displays a file that is
3.97 KB in size as 4,066 Bytes when 3.97
times 1000 equals 3,970? Doesn't the K in KB
stand for Kilo which is 1000?
A.
Well, Kilo in all metric terms does mean
1000, but in binary notation, it means
something a little different. The computer
uses binary notation, and in binary
notation, there are only two numbers, those
being the 0 and the 1. Everything the
computer does, it does with just these two
numbers. So, all major numbers (sometimes
called pages in computer programming) have
to be powers of 2. Numbers like 2, 4, 8, 16,
32, 64, 128, 256, 512, 1024, etc., are
powers of 2, and may be familiar to most
computer users when references are made to
the amount of RAM, memory, the computer has.
There is
no power of 2 that exactly equals 1000, so
it was decided by someone, I have no idea
who, that 1024 (210) would do,
and since it was close to 1000, it would be
called Kilo. So, a Kilobyte actually equals
1024 Bytes, not 1000. This 1024 stays true
as a MB is 1024 KB, and a GB is 1024 MB and
on and on. Oh, in your question, 3.97 KB
times 1024 equals 4,065.28, and the computer
rounds it up to the 4,066.
Q.
OK, now that I have mentioned this about
binary notation using only a 0 and 1, how
does the computer handle the numbers in between the
2, 4, 8, 16, etc?
A.
NOTE: The following is from a book I
wrote in the early 90's for a computer class
I taught in South Africa. It was later
adopted and used by a middle school in New
England for a couple of semesters. The
complete article on Binary Notation can be
viewed on this site in the Articles section,
and can be downloaded as a DOC file from
there.
As
mentioned above, everything your computer
does, it does by manipulating just the two
numbers, 0 and 1. This is referred to as
working to the "Base Two", and should
explain why it is called binary notation.
(The way we usually count using the decimal numbers
0 to 9 is called Base Ten).
Two
terms that are used frequently when talking
about computers and programs are BIT and
BYTE. BIT is short for "BInary digiT", and
just where the term Byte came from is
anyone's guess.
The
Binary Digits referred to are the same 0 and
1 mentioned above. When eight (8) of these
BITs are in the correct combination with
each others, they make up a Byte. When set
correctly, a byte can hold any equivalent
decimal number from 0 to 255. Bytes usually
contain 8 Bits, and for the purpose of this
explanation, we will work on that basis.
These Bits are numbered 0 to 7.
This
graphic representation can be used to
visualize how the bits must be set to
represent any of the numbers, 0-255.
|
Bit # |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
Value |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|
------ |
---- |
---- |
---- |
---- |
---- |
---- |
---- |
---- |
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
255 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
|
34 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
|
200 |
1 |
1 |
0 |
0 |
1 |
0 |
0 |
0 |
|
139 |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
|
127 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
|
219 |
1 |
1 |
0 |
1 |
1 |
0 |
1 |
1 |
So, if
the bit value of a given byte were 11001000,
it would contain the equivalent of the
decimal number 200. |