Binary Basics
Computers work in binary. Whereas we humans use the ten-digit decimal system 012456789, computers only use a
1 or a
0. These two numbers are called
binarydig
its, or
bits for short. So when you see the word
bit, it's just
referring to a
binary digit, which is either a 1 or a 0.
Example binary number - 10110110
The 1 digit means 'on' and the '0' digit means 'off'. Binary numbers can be converted to decimal if you know the pattern. In the diagram below there are eight columns. Starting from the
right hand side [as you do in binary], Column 1 represents decimal number '1', Column 2 represents decimal number '2', Column 3 represents decimal '4' and so on.
Note how each column is double the decimal equivalent of the column to its left. Once you get the pattern it becomes easier. There are only eight columns in this example, so the binary number can be a maximum of
eight bits in length.
Calculating the decimal equivalent is a matter of adding the decimal column numbers together. If a '1' appears in the binary number then the decimal equivalent at the top of the column is included in the addition. If a binary '0' appears, then that decimal equivalent at the top of its column is not counted.
| decimal |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
| |
|
|
|
|
|
|
|
|
| 3 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
| 18 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
| 158 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
| 255 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
So, taking the first example in the table, decimal '3' equals binary 00000011;
A binary '1' appears in the
decimal 1 column so it's counted.
A binary '1' appears in the second
decimal 2 column, so it's counted.
However, binary '0's appear in all the other columns, and so the decimal equivalents at the top of all the other columns are not counted.
Hence 2 + 1 = 3
As can be seen in the last example in the table, the maximum size that can be represented by an 8-bit number is 255. That is to say, all the columns contain a binary '1' so all the decimal equivalents above must be counted.
There is a special name for an 8-bit number,
8 bits = 1 byte. This is an important one to remember, as 1 byte is the smallest size you will see when referring to the size of a file.
More Bits
So that's basic binary for you. As in the metric system, larger clumps of numbers get Greek prefixes to indicate their size.
kilo = 1 000
so
1 kilobyte = 1 000 bytes
mega = 1 000 000
so
1 megabyte = 1 000 000 bytes or 1 000 kilobytes
giga = 1 000 000 000
so
1 gigabyte = 1 000 000 000 bytes or 1 000 megabytes
Exceptions, exceptions...
Having said that, if you were to actually keep doubling each number along the columns, you will see that you reach not 1 000 but 1 024. Herein lies one source of potential confusion. We humans tend to round off the numbers to make them easier to work with, but always remember that the actual size will be larger.
The bigger the number, the larger the difference between the rounded off value and the actual binary value will be. However most of the time this makes little difference in practice, so we continue to use the easiest method.
More difficulties can arrive with the inconsistency with which these terms are abbreviated, particularly in the technical press. Capitalisation or case is of paramount importance, but is often incorrectly notated. Here are the generally accepted abbreviations:
Kilobyte = KB
Megabyte = MB
Gigabyte = GB
Kilobit per second = Kbps
Megabit per second = Mbps
Gigabit per second = Gbps
|
 |
Just to make things harder, data transfer rates, for instance across a network, are usually measured in
bits per second. The 56 in 56K modem actually refers to 56 kilobits per second. So, recalling that 8 bits = 1 byte, to convert x
bits per second to
bytes per second (easier to understand in my opinion), simply divide by 8.
56 kilobits / 8 = 7 kilobytes of data per second
Watch out for annotations such as 10MBps, 10mbps, 10Mb /s, 10MB /sec and so on. Check the source for clarification. There's a growing trend to actually measure data transfer in bytes per second. So there you go.
Oh and 'nibble'? Well apparently a nibble is half a byte, that is to say 4 bits. Some people really don't get out enough..