Understanding binary

Binary is a sequence of ones and zeros as these are the two positions of a switch. Everything on a computer is made up from binary. This binary is represented on the screen in a more useful form, for us simple humans to understand, such as numbers letters and even images. The point is that deep down these are all sequences of ones and zeros, and knowing this can help you manipulate them in different ways. When representing numbers, the first bit (single one or zero) represents 1. The second bit represents 2 and the third is 4, each one is double the previous! So to represent the number 5, you would set the first and third bits to 1, as this is 4 and 1 (101) = 5.

So setting a row to 1, you know will light up the first LED as 1 in binary is 00001. You also know that if you times 1 by 2, you will have just the second LED on that row lit up, as 2 in binary is 00010. The table below shows a couple of examples of the binary representation of some numbers. For each row, if you add together the numbers in the blue boxes for each place that has a one in the columns, you will see that each row adds up to the number after the equals sign. The first row for example, has a 0 for the first column and a 1 for the rest of the columns, this gives us 8 + 4 + 2 + 1 = 15!


Activities with this step

Back to top