Binary code is a system of representing numbers, letters, commands, images and sounds. Amazingly, it uses only two types of information to do this – 1 and 0. The strings of 1’s and 0’s that make up binary code may seem random, but of course they’re not. Binary code is at the absolute heart of anything that goes on inside a computer. Binary Numbers The binary number system is a base-two system, meaning it uses two distinct digits – 0 and 1. The decimal number system we’re all familiar with is a base-ten system, meaning it uses ten distinct digits – 0 and 1, but also 2, 3, 4, 5, 6, 7, 8 and 9. Counting in the decimal system, when all ten digits have been exhausted, the next number is represented as ’10’. In the binary system, it’s the exact same. After 0 and 1 comes 10. In fact, here are the first 15 numbers expressed in binary: 0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111. As you can see, the binary system counts up in a logical order, and whenever a number made up of entirely 1’s is reached, an extra digit is added. This is exactly the same thing that happens in the decimal system when a number made up of entirely 9’s is reached. As you can also see, there are 16 distinct numbers that can be represented in 4 digits or less (1 through 15 as well as 0). This can be calculated because 16 = 2 4. However, binary numbers in a computing context are always represented in 8 digits or less – 8 binary digits forming one byte. The total quantity of distinct numbers that can be represented in 8 digits is 28 = 256. 1 through 255 as well as 0. So 255 in binary is 11111111. Binary Letters Binary code representing numbers is pretty uniform – there’s only one way to do it. However, there are multiple methods of representing letters and symbols in binary code. These methods are called encodings. For example, the ASCII encoding assigns unique binary bytes to 128 different characters. This makes it possible to encode any string of text. This is the string ‘Hello World’ encoded in ASCII: 01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 Each byte represents a letter (except for the one that represents the space between the words, of course). The spaces between the bytes are only there to make the binary more readable for us. Computers do not read them. Other Applications of Binary As well as numbers and letters, binary code can represent commands, images and sounds – but that’s beyond the scope of this tutorial. It really is amazing how just two digits can do so much. help = (01101000011001010110110001110000)2 sea = (011100110110010101100001)2 love = (01101100011011110111011001100101)2 Lets Practice: Letter to ASCII Code to Binary 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1