You know that computers use binary, right? But do you know the reason behind that? Do you know binary in a mathematical and computational sense? If you don’t, let’s look at the issues in this article.
It turns out that the main reason for computers to use binary are physical limitations. To understand this, you need to know how tiny transistors store data. They use the amount of current flowing through the transistor to determine if the value is 0 or 1. Usually, the value is 0 when the transistor is off or has low voltage, and the value is 1 when the transistor is on and has a higher voltage.
However, the environment could cause some fluctuations to the current flowing through the transistor. And it generally isn’t a problem for binary. However, if we use base 4, for example, the change in current can affect the data more significantly. Imagine if it’s octal, or even hexadecimal. Well, even some smaller fluctuations can change the data stored in the transistor.
Therefore, binary is arguably the most reliable way to store data these days because the data gets changed naturally less often.
How Does Binary Work Mathematically?
Now, we’ve discussed the reason why computers work in binary, it’s time to explain something about binary itself. Binary is nothing more than a numeral system like decimal that we work with today. It only runs in a smaller scale, with only 0 and 1 in the numbers compared to the 0-9 that we meet in decimal.
Still don’t understand? Let’s give you some examples. For example, what is 11001001 in binary? It’s 128+64+8+1=201 in decimal. Meanwhile, 10001101 in binary is 128+8+4+1=139 in decimal.
You’ll notice that it uses far more digits than decimal. That’s because decimal is running in the powers of 10, 125 times the amount of the powers of 2. For instance, a fourth digit in decimal represents 1000, while 1000 in binary is only 8 in decimal.
How Can Computers Display Content and Play Sound with Binary?
It’s true that computers are just storing numbers, but how does it use binary to display all that fancy content, images, and audio?
Well, let’s talk about text first. There is actually a standard that help computers translate from a string of 0’s and 1’s to a character easily and universally. This is called Unicode. Moreover, there’s an early but a very limited standard called ASCII. There are only 256 characters out there in this table. Of course, for ease of translation, the characters in ASCII also have the same representations in Unicode, although the latter contains more characters.
It’s also quite easy to understand how images work in a binary level. Every image is composed of little points known as pixels. Each of these pixels are encoded with 3 colors, namely red, green, and blue. Moreover, there are some metadata in these files so that the image reader can understand its file format and resolution.
Meanwhile, audio files store (generally) 44,100 amplitudes per second. It also contain some metadata so that the audio player can understand and decode the data, just like an image reader does.
We’ve talked about the reason why computers use binary and mentioned this numerical system mathematically. If you want to learn more, look at the references below for a starting point.
References and Credits
- Anthony Heddings. (2018, October 1). What is Binary, and Why Do Computers Use It? Retrieved April 1, 2021, from https://www.howtogeek.com/367621/what-is-binary-and-why-do-computers-use-it/
- TED-Ed. (2018, July 12). How exactly does binary code work? – José Américo NLF de Freitas – YouTube. Retrieved April 1, 2021, from https://www.youtube.com/watch?v=wgbV6DLVezo
- Basics Explained, H3Vtux. (2019, December 17). Why can’t computers use base 3 instead of binary? Voltage states explained – YouTube. Retrieved April 1, 2021, from https://www.youtube.com/watch?v=fXwSFhUVFmE
- CrashCourse. (2017, March 16). Representing Numbers and Letters with Binary: Crash Course Computer Science #4 – YouTube. Retrieved April 1, 2021, from https://www.youtube.com/watch?v=1GSjbWt0c9M
- CrashCourse. (2017, July 13). Files & File Systems: Crash Course Computer Science #20 – YouTube. Retrieved April 1, 2021, from https://www.youtube.com/watch?v=KN8YgJnShPM
- van Vlymen Paws. (2020, May 28). Difference Between ASCII and Unicode | by van Vlymen paws. Retrieved April 1, 2021, from https://medium.com/@vanvlymenpaws/ascii-vs-unicode-4174def5c09d
- Griffin Brown. (2019, July 15). Digital Audio Basics: Sample Rate and Bit Depth. Retrieved April 1, 2021, from https://www.izotope.com/en/learn/digital-audio-basics-sample-rate-and-bit-depth.html