"There are 10 types of people, those who understand binary numbers, and those who does not."
Just as the most commonly used decimal number system is based on the number 10, the binary number system is based on the number 2.
As the decimal numbers are represented by the 10 numbers 0-9, the binary numbers are represented by the numbers 0-1.
Just as the decimal system, the binary system is also a positional system where the number to the right is the least significant.
Compare the decimal number 1035
1*10
3 + 0*10
2 + 3*10
1 <+ 5*10
0 = 1000 + 0 + 30 + 5
To the binary number 101101
1*2
5 + 0*2
4 + 1*2
3 + 1*2
2 + 0*2
1 + 1*2
0 = 1*32 + 0*16 + 1*8 + 1*4 + 0*2 + 1 = 44 (in decimal)
In other words the value of each position in binary is doubled;
Binary |
Decimal |
1
|
1
|
10
|
2
|
100
|
4
|
1000
|
8
|
10000
|
16
|
100000
|
32
|
1000000
|
64
|
10000000
|
128
|
Try to figure out the decimal values of the following binary numbers on your own:
101
111
10111
101010
1100001001
You might now that computers use binary.
In the old days this essentially meant whether or not a current passed through a relay 1 = on, 0 = off.
Later punched cards where used to make automatic programs for computers. A grossly simplified explanation is that the sequence of holes in the cards represented binaries, then interpreted by the computer.
|
A computer program on a deck of punched cards |
Even in modern computers the computers only use binary information. When you write a program in a programming language, the code is converted to machine code consisting of binary, so that the computers understands what to do.
There are different encodings used by computers, one is ASCII (American Standard Code for Information Interchange), that makes numbers represent different characters. ASCII is as the name implies an american standard, and is thus rather limited in that it does not include a lot of international scripts, such as Chinese characters or ü, ö, etc.
In ASCII the letter a is represented by the number 97, or in binary: 01100001
Notice that there's an extra 0, of course you could write the number 97 in binary as 1100001, but computers organize bits (a single 1 or 0) in sequences of 8 called a byte (this is not entirely true as a byte technically doesn't have to be 8 bits, but in modern computing it almost exclusively is. The sequence of 8 bits are actually called an octet).
Oddly enough 1 KB (Kilobyte) is not 1000 byte as one would think, but 1024 bytes. 1 MB is 1024 KB, 1 GB is 1024 MB.
So when speaking about file-sizes it is actually a description of how many 1s and 0s it contains.
For instance a file that is 735 KB consists of 6021120 bits (1s and 0s).
A game might be 10 GB, or consist of
85899345920 1s and 0s.
Comments
Post a Comment