|
The
Binary Number System
|
|
|
The
following is an explanation of the binary counting system. It is in two
levels. Try Level 1 first, this has a mathematical approach and if that
leaves you perplexed, then try Level 2 which explains it in more physical
terms.
|
|
|
The
Binary Number System - Level 1
|
|
|
Computers
use tiny electrical switches used as the basis of a binary counting system.
The state of each switch is described as "I" for on and "O"
for off. Counting in "I's" and "O's" is called the
binary number system and binary digits are known as "bits".
A single bit is either O or I and so can represent two states. A two bit
number has only four combinations of "O" and "I" i.e.,
OO, OI, IO, II and hence can represent four "states", or conditions
or shades of one colour. A three bit number has only eight combinations
OOO, OOI, OIO, OII, IOO, IOI, IIO, III etc. Mathematically, two bit is
22, three bit 23 and so eight bit is 28 and represents 256 states.
|
|
|
The
Binary Number System - Level 2
|
|
|
If
the previous explanation of the binary system left you perplexed, here's
a more physical approach that may appeal to you.
|
|
|
Computers
work using electricity and, as you know, electricity is usually on or
off, just like a light bulb. In fact a light bulb is a very good analogy.
The light bulb can only be in one of the two states, either on or off.
Think of "on" as 'I' and "off" as 'O' the same as
markings on electrical switches. (Refer to your kettle or similar.)
|
|
|
Now
let's think about how we could represent a "word" by using lots
of light bulbs, as a sort of "light bulb signalling language".
To do this we would need to know how many possible combinations of light
bulbs are available to represent all the various words of one, two, three,
four etc letters. So, we need to determine on how many different ways
we can switch on or off the light bulbs in a group of say four bulbs to
represent different words of four letters.
|
|
|
Let's
start at the bottom and build up. For one light bulb we only have two
states, on and off. For two light bulbs, we can have the first light bulb
on with the second bulb off or, the first light bulb off and the second
light bulb on, or both off or both on. This is four different combinations
so we can represent four words. (2 x 2 = 4)
|
|
|
For
three light bulbs, we have the four words we can arrange with two bulbs
with the third bulb either off or on. This additional bulb enables us
to represent eight words using three light bulbs. (2 x 4 = 8)
|
|
|
For
four light bulbs, we have the previous eight words we can arrange with
three bulbs and the fourth bulb can be off or on. This enables us to represent
sixteen words. (2 x 8 = 16)
|
|
|
By
now you will have recognised a pattern and, for every extra bulb we add
to the group, the number of words doubles. Using this, we can predict
the numbers of words possible with larger groups of light bulbs, e.g.
-
|
|
|
No.
of Bulbs in the No. of Words The number Group (or Word) Possible expressed
in Math.
|
|
|
|
|
For
those of you with a mathematical mind, the third column shows we are dealing
with a binary counting system (numbers to be base of two) and the number
of words available is represented by the base number two, raised to the
power of the numbers of bulbs.
|
|
|
By
now you have a fundamental grasp of the basis of the binary language.
Let's now build on this and translate the above words into computer jargon.
The single light bulb either "on or off" (I or O) is known as
a "bit". When you have a number of bits (several light bulbs!)
the "group" or "word" is known as a "byte".
|
|
|
Having now got the basic idea, think of a "bit" as a light switch rather than a light bulb. Obviously every light switch or computer "bit" has a wire and a circuit which is either "open" (off or O) , no circuit connected or closed (on or I) and the circuit connected. |
|
|
Returning
to scanning, if we wish to represent each of a group of (256) shades of
one colour by a "word" (or byte) we would need eight "bits".
This is because the eight bits will give us in combination a total of
256 words to represent each colour shade.
|
|
|
For
eight bits, eight wires will be required. In computer jargon this is the
"data path" or "bus" and simply means that each "bit"
will require a wire to carry it's signal either "on" or "off".
|
|
|
Currently 32 bits are used in PC's and the next generation will require 64 bits. The "software" usually follows the "hardware" in development. Hence, when the chipmakers produce the 64 bit chips, the software writers will need to produce software written with 64 bit words to operate efficiently on the 64 bit chip. Currently most software is 32 bit or older 16 bit or 8 bit. |
|
|
©
2001 Hamilton Ltd - issue 30/10/01
|