# 3 Binary, bits and bytes

## 3.1 Binary

To appreciate the importance of the various breakthroughs in the history of the computer industry you will need a basic knowledge of how a computer works, and in this segment you will look at how a computer represents information.

At its very lowest level a computer operates by turning on or off millions of tiny switches, called transistors. In computers these **transistors** can only be in one of two states; that is, on or off. Such devices are thus referred to as two-state devices. Another example of a two-state device might be a conventional light switch. It is either on or off, with no intermediate state. The states of ‘on’ and ‘off’ can be represented by the numbers 1 and 0.

In mathematics the term **binary** is used to refer to a number system which has only two digits, that is 1 and 0. The number system we use in everyday life has ten digits, 0 to 9, and is called denary. The binary system is the smallest number system that can be used to provide information.

Any number from our normal, denary system can be represented in binary; 0 in denary is 0 in binary. Similarly 1 in denary is 1 in binary. When you get to 2 in denary you have a problem. There are no more symbols in binary; you are restricted to only 1 and 0. So how do you represent two? This question is similar to asking how you represent ten in denary. Once you get to nine you have run out of digits, so you simply create a new column and start afresh, using 1 and 0. This is also what you do in binary, so 2 in denary becomes 10 in binary. When you move on to 3 (in denary) you proceed as before; 3 becomes 11 in binary. The table below shows how denary numbers convert to binary.

Denary number |
Binary equivalent |
---|---|

0 | 0 |

1 | 1 |

2 | 10 |

3 | 11 |

4 | 100 |

5 | 101 |

6 | 110 |

7 | 111 |

8 | 1000 |

9 | 1001 |

10 | 1010 |

It is useful to think of binary in terms of columns. The first column represents units, so a 0 here means no units, i.e. 0, and a 1 means 1 unit. The next column represents the numbers of 2s, so a 1 in this column means 2. The next column represents 4s and so on, with each column being twice as big as the previous one. This is also what we do in denary, each column being a factor of 10 bigger than the previous one. So the denary number 2902 can be interpreted as (2 x 1000) + (9 x 100) + (0 x 10) + (2 x 1). If you want to convert binary numbers to denary, this is a useful method. For instance, if I wanted to convert the numbers 1000100 and 11001 to denary I would make a set of columns as shown.

### Table - 3 rows by 7 columns, shows conversion of binary numbers to denary as explained in the text. Examples are 1000100 in binary equals 68 in denary (1 times 64 plus 1 times 4) and 11001 equals 25 (1 times 16 plus 1 times 8 plus 1 times 1

**Conversion of binary numbers to denary**

*You will not be asked to convert numbers, so don't worry too much about the details. The important thing is to have an idea of what ‘binary’ means.*

2 Software and hardware