GCSE Computing/Computing hardware/Introduction to Binary Logic/Binary logic

= What you need to know = The exam board say that you must be able to explain "why data is represented in computer systems in binary form?".

= Introduction = We are all used to counting in tens, and there being only ten different digits (0,1,2,3,4,5,6,7,8,9). when we want to go above 9 we have no problem in sticking two digits together - for example a 1 and a 0 making 10. We understand that the "1" in fact means "one lot of ten". We can do this for pretty much any number, knowing that 8,456 means "eight lots of a thousand, four lots of a hundred, five tens and six units".

Using tens like this is called "Base 10", and arose as we have ten fingers so it is easy to count like this - it's just a convenient way of doing things. Since computers don't have fingers, Base 10 is not very convenient for them. For them the best system is what is called "Base 2" or "Binary". The equivalent of fingers is detecting the amount of electricity going through a wire. For simplicity we think of the electricity as being "on" or "off". If electricity is off we call it a zero, if it is on we call it a 1. Note

One wire can tell us just if something is on or off, which isn't very useful. Suppose we have three wires together, and we (or rather the computer) checks each wire to see if it is on or off. We get the following possibilities:

If we think of "Off" as zero and On as One we get

Now let's go back to ordinary Base 10. we have column headings like this:

we can do the same in Binary but the column headings change

The column headings are different, but the idea is the same: the column heading tells you how much an entry in that column is worth. In normal base 10, anything in the second column (from the right) is worth 10, in binary it is worth 2. The next column is worth 100 in Base 10, but only 4 in Binary.

No we can look again at Figure One or Figure Two, and say that the way those wires are on or off can tell us a number. So if the wire on the left is off, and the next two are on the "value" is 3. Figure 6 below may help you understand this.

Exercise
Practice this idea at http://forums.cisco.com/CertCom/game/binary_game_page.htm

=The maths and logic of it= Base 10 (ordinary maths) evolved because we have ten fingers and it is easy to think of ten digits (0 to 9)

Base 2 (Binary) is useful because computers can only really record two possibilities: on or off. So they use 0 and 1 for these. '''Therefore, base 2 does not have the digits 2 to 9. They are NEVER used.'''. This is exactly the same as there not being a special digit for eleven in Base 10: you just use to 1's. To make three in Base 2, use two 1's, meaning one lot of two, and one lot of one = 3

If you are happy with maths ...
(If not, see below!)

Each column goes up by a power, as follows: Base 10 Base 2

If you are not so happy with maths ...
In normal base 10 each column is TEN TIMES the column to its right.

In Base 2 (Binary) each column is DOUBLE the one to its right.

= Next = Bits, Bytes, Nibbles