It’s a common theme throughout the modern world that everything in a computer’s brain comes down to ones and zeros. You’ve most likely heard that this code of ones and zeros is what’s referred to as binary. While almost everybody knows that this is somehow related to what computers do, very few of us seem to understand what binary is or why computers use it. If you want to know, then this explanation is for you, because it’s actually a very simple concept and still quite fascinating.
What Is Binary?
Before we get to computers, let’s talk about what binary itself is, as it existed long before computers did. Binary is nothing more than a system of counting. To understand how it works, let’s look at two other systems of counting: tally marks and the glorious base-10 positional system that we all know and love today.
Tally Marks: The Simplest System
Tally marks are the simplest counting system imaginable. However many things you have, you put down that many marks. It’s easy as pie but not very efficient.
Base-10 Positional System
Meanwhile, base-10 positional, which is what we use today, uses a different symbol to represent different amounts of things. With the numbers 0 through 9, we can recognize that each symbol indicates a different amount of things. If we need to represent something higher than 9, we add a digit to the left, roll this first digit back to zero, and start over. This system is very efficient compared to tally marks because each digit we add exponentially increases the amount of things we can represent. In this system, we add a new digit every 10 things, and each digit represents an increasing power of 10: the number of ones, tens, hundreds, thousands, and so on.
Binary: A Different Counting System
Binary works the exact same way as base-10 positional, but instead of each digit going from 0 to 9, it goes from 0 to 1. Counting upwards in binary sounds like this: 0, 1, 10, 11, 100, 101, 110, 111, and 1000. Because each digit of binary has only two values and not ten, each additional digit represents an increasing power of two rather than an increasing power of ten. These represent the number of ones, twos, fours, eights, sixteens, thirty-twos, sixty-fours, one hundred twenty-eights, and so on. Binary is not nearly as efficient as base-10 but is exponentially more efficient than tally marks—literally.
Why Computers Use Binary
Now that we know how binary works, let’s talk about computers. Why did the first computer creators, as wise and intelligent as they were, waste their time with such an ineffective system of counting? It’s because of a physical limitation on how computers work. Everything a computer does comes down to what’s known as microtransistors—simple, tiny switches that can either be on or off and can be flipped with a very weak electrical charge.
Counting with Transistors
The first goal was to get computers to count. To do this using these switches, they could have used the tally system, meaning the number of “on” switches equals the number of things they had. Or they could use the much more efficient system of binary, where each switch represents a digit of binary. For example, eight transistors using the tally system could represent a number as large as eight by turning all of them on. With binary, those same eight transistors can represent a number as high as 255. An “on” switch means a 1, and an “off” switch means a 0.
Bits and Bytes
A single transistor is what’s known as a “bit,” which stands for “binary digit.” A byte is eight of these bits in a row, representing any number between 0 and 255.
Binary and Letters: ASCII
If binary is just a system of counting, what do people mean when they explain how to spell things in binary? What they really mean is how to spell things with ASCII. ASCII, the American Standard Code for Information Interchange, is a way to convert a computer’s numerical data into letters for humans to work with more easily. ASCII assigns a character to each value represented by a byte of binary.
Example: Representing Letters in Binary
For example, the ASCII number for an uppercase “A” is 65. In binary, 65 in base-10 is 01000001. Whenever you type an uppercase “A,” a tiny row of eight transistors somewhere is arranged in the pattern of “off, on, off, off, off, off, off, on.” This binary representation is interpreted as 65 in base-10 and then converted by ASCII into an uppercase “A.”
Moving Beyond Binary Limitations
This highlights the staggering number of transistors required to write something as simple as a Facebook status, let alone handle all the other computations your computer performs. However, even with this system, the numbers as high as 255 weren’t sufficient for growing computational needs. To address this, newer computers were designed to recognize two bytes as a single number, giving 16 digits of binary. This increased the representable numbers exponentially, from 255 to 65,535.
8-Bit vs. 16-Bit Systems
When you hear people talking about the difference between 8-bit and 16-bit systems, they mean this. While a 16-bit system doesn’t automatically make a program exponentially more powerful, it provides the option to use more numbers, which opens up many possibilities.
Conclusion
There’s much more to explore, from how computers use these numbers to determine which pixel is what color on your monitor, to how different components of your computer work. In future discussions, we’ll delve deeper into these fascinating topics.