Binary. Maybe you’ve heard this word before and you thought that is was something super complicated that only math experts can understand. I have been sent from above to tell you that you are completely wrong. This is a very simple concept that sounds difficult.

Let’s continue with our kitchen metaphor from Super basic understanding of how a computer works.

So, the guys in the kitchen never really learned to speak a normal language. In fact, they can’t even speak. Instead, they make use of boxes. On each box there are eight lights and for each light there is a light switch (Why eight? I will tell you further down). And all they can communicate with their lights is numbers. Why the hell are they communicating with numbers? Words are so much easier… It’s just another weird rule in the Restaurant. You will understand it better if you keep on reading!

Anyhow, they have developed a really smart way of using their lights.

To represent the number “0” all lights are turned off. To represent the number “1” the first light is turned on but the others are still turned off. To represent the number “2” the second light is turned on and the rest is turned off. I’m guessing that you think the third light switch is equal to “3”? I thought so. See this is where most people get confused. But as stated earlier, it is really is super simple. The third light switch is actually equal to “4”.

Each of the eight lights represent a value – 1, 2, 4, 8, 16, 32, 64, 128.

“So what you are saying is that there is NO possibility to represent the number three or number 17?”

Not what I’m saying.

“But you just told me that I can only represent eight different numbers!!”

Yes I did.

“But how is that working?”

This is how:

If Logan the logic (and arithmetic) Unit would switch on the fifth light it would tell the others of the staff that he is trying to say “16”. If Logan wants to communicate the number “3” he just lights up the first two lights. Why is that three? Because when Cassy the control unit sees the two lights she knows to add them together – 1 + 2 = 3. If Logan were to light up the fifth light (16) and first light (1) Cassy would know to add them together in her head and understand that Logan where trying to say “17” (1 + 16= 17).

But what if he would like to communicate the number “49”? Then he would have to light up three lights – the first, the fifth and the sixth which Cassy then interprets as 1 + 16 + 32 = 49. This is why binary numbers are cool. Isn’t it amazing that you can do this, that you can create all imaginable numbers from light switches? I know, my jaw dropped too when I first realized this.

So why are they using this overly complicated form of communication? Because with this system they can communicate every possible number using only light switches. But why are they using light switches to begin with???? This actually has to do with constraints due to the hardware in computers.

This would be a good time to tell you that computers don’t actually have lights and light switches in them, even if it’s not totally far from the truth. In computers the switches can actually be turned on or off physically. The lights, in this case, represent a binary number. A binary number is a number that can only be one or zero. So when a light is turned on that means the binary number 1 and a light that is turned off is equal to the binary number 0. And as described above you can get all other numbers by combining ones and zeroes. Then the first “one” has a value of “1” , the second “one” has a value of “2”, the third “one” has a value of “four” and so on. To get the number “3” you combine the first and the second “one”.

But the question remains. Why do we use the binary number system? Why not use our regular system where you just count 0, 1, 2, 3, 4,, 5, 6, 7, 8, 9…? The switches in a computer only have two states – on or off. An electrical signal can only be on or off. So we can’t make use of our decimal system. That would mean that one switch had 10 states and they don’t. So instead we are left with combining switches that are on and off to represent all numbers. Or as we stated here, we combine lights that are turned on or off.

How we make use of binary numbers

Do you remember Carl the Circuits? His task was to fetch ingredients that was located in the main working area (the RAM memory).

Let’s rethink the main working area to be a shelf. The shelf has six (for no particular reason) levels. There have been a few misunderstandings earlier where Carl fetched the wrong ingredient from the wrong shelf so Cassy has now given a number to all shelf levels. The top shelf level is number “1”, the second level is number “2” and so on. Of course, since Carl can’t read normal numbers they are in the form lights. There are eight lights that tell Carl which number it is. For the topmost shelf all lights are turned off except the first, which indicate the number “1”. In computer language a number that indicates a shelf level is called a memory address. That one kind of make sense, it’s an address for a location in memory (RAM is a form of memory).

Can you guess which lights are turned on to indicate level five of the shelf? If you turn on the third light you have the number “4”, but you want the number “5” so you just turn on the first light as well – 1 + 4 = 5.

So Cassy tells Carl to get the ingredient on the fourth level of the shelf. Hmm four, that would mean that you turn on the third light (=4) and keep the other lights turned off. He walks over to the shelf and look for the shelf with only the third light turned on. He grabs the ingredient from that shelf and gives it to Cassy.

I think this is a good time to tell you that there are no actual ingredients in the kitchen. There are only boxes with eight lights and light switches on them. So, in reality, Carl would grab a light box and carry it to Cassy. Cassywould then give the box to Logan the Logic (and arithmetic) Unit who would then be able to see that the lights on the box represent, for example, the number “18”. If he already had a box which lights represented the number “20” he would be able to add, subtract, multiply or divide them with each other.

I think this is a good time to tell you that it is no coincidence that all light boxes contain exactly eight lights and light switches. For now, just accept that someone just decided that all boxes would have eight lights and everyone in the kitchen was just fine with that. A box in computer language is called a “byte” and a single a light is called a “bit”. That maximum number that you can represent with a single lightbox is “255”. So what if you would like to represent the number 256? Then you would have to have two light boxes. This is why you can run out of memory in your computer. Your hard drive (the place for long-term storage) only has enough space for a certain amount of light boxes.

I reality then a byte with the value of “1” would look something like 00000001.

Now you should have a better understanding of the part binary numbers play in computers. You are probably thinking that it is a bit messy with all these light boxes. But it’s quite simple. The lightbox remains on the shelf until the staff needs one of them. They then tell Carl to fetch it at a specific shelf and he then delivers it to the correct person.

But if the staff members can only communicate with numbers, how can the computer print out “F”? “F” is not a number, it is a letter? Excellent point! This and more will be covered in the next chapter about code.

If you still don’t get computers and you are sick of tutorials and forums I just started up a project at Toorial where you can find a mentor. It’s free of course.