## Teach Any Computer Science Class

We have put together a full GCSE Computer Science curriculum that will give you all the teaching materials you need to teach any topic.

Whether you're a brand new Computer Science teacher, or you've been teaching ICT for years, our resources will save you hours and hours of lesson preparation every single week.

View the Lessons →### Binary Numbering System

Binary is a base 2 numbering system made up of two numbers: 0 and 1. 0 represents OFF and 1 represents ON. A computer’s central processing unit (CPU) only recognises these two states. It is the foundation for all binary code, which is used in computer and digital systems.

### Bits and Bytes

A binary digit called a bit is the smallest unit of data in a computer. Each bit has a single value, which is either 0 or 1. 8 bits (b) is equivalent to 1 byte (B).

### Computers and Binary

Binary is the main language used in computers for the following reasons:

- It is simple. Since there are only two possible values, 0 and 1, it’s easier to store and manipulate numbers. It is also less expensive to use binary than other numbering systems.
- It is easy to identify OFF and ON states. Because the distinction is clear between the two states, it is reliable.
- It is efficient in controlling logic circuits. It requires the least amount of circuitry, which requires the least cost, space and energy.

### Decimal Numbering System

Decimal is a base 10 numbering system made up of 10 numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. It is the most commonly used numbering system. This is because of its convenience. We have 10 fingers that we use for counting, so it is easier to count with a base 10 numbering system, thus, decimal is widely used.

### Conversion from Binary to Decimal

The conversion can be done by plotting each binary digit value in each column corresponding to its decimal digit value. Each column is the number 2 raised to an exponent. The exponent increases by one from right to left. To get the total value, you add the value of those columns tagged as ON or equivalent to 1.

For example, the binary number 101100101 is converted to a decimal number as follows:

Exponent | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |

Value | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

ON / OFF | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 |

Total value = (256+64+32+4+1) = 357.

So the binary number 101100101 is 357 in decimal numbers.

### Conversion from Decimal to Binary

Conversion can be done by dividing a decimal number by 2 repeatedly until the final result is 0.

For example, the decimal number 357 is converted to a binary number as follows:

Division | Result | Remainder |

357 / 2 | 178 | 1 |

178 / 2 | 89 | 0 |

89 / 2 | 44 | 1 |

44 / 2 | 22 | 0 |

22 / 2 | 11 | 0 |

11 / 2 | 5 | 1 |

5 / 2 | 2 | 1 |

2 / 2 | 1 | 0 |

1 / 2 | 0 | 1 |

The binary number is taken from the remainder starting from the last to the first, or in the illustration above, from bottom to top, which is 101100101.

So the decimal number 357 is 101100101 in binary form.

### Advantages of the Binary System

Here are some advantages of using the binary system:

- It is easy to implement.
- The logic is easy to understand.
- It is the lowest possible base and gives way to easily encode a higher numbering system.

### Disadvantages of the Binary System

Here are some disadvantages of using the binary system:

- Numbers are expressed in longer form, thus taking up more space.
- There are rounding issues since fractional values don’t follow a base 2 numbering system.
- People find it difficult to read, write and manipulate binary.