It’s Friday morning and you're reading the news on your laptop, then, suddenly, you wonder…
"How are all these letters and images displayed to me?”
That’s binary going through logic gates in your CPU.
By the end of this blog, you'll know exactly why computer use only 0s and 1s, and how that powers everything from images to messages on your screen.
In binary, we only have 0 and 1, to represent all numbers and data by combining powers of two. That’s different from decimal where we use 0-9.
Binary is the foundation of computer systems and digital communication.
CPUs use binary in logic gates; you can see each logic gate as a mathematical function, you have input, logic, output. The core gates are AND, OR, and NOT. If we combine these, we can create more complex logic gates, like XOR, NAND, and 2 more.
Logic gates follow Boolean rules — true/false, on/off — and are physically built using transistors. Each gate performs a basic operation like AND, OR, or NOT using electric signals.
A transistor acts like a digital switch:
- 1 = Electricity flows (on)
- 0 = no flow (off)
If you’re reading this blog from your macbook with a K2 chip then your chip contains “~20 Billion transistors, each acting as an on/off switch letting your computer process data lightning-fast.” so you can read the right message from your screen.
“Your computer reads each tiny switch (a bit) as either 1 (on) or 0 (off).”
Each bit has a weight. Starting at the right, Least Significant Bit (LSB) moving to left, Most Significant Bit (MSB), their values are:
(in an 8-bit byte).
In Computer Science we start counting from 0, so in this example we go from index 0 to index 7, in decimal that would be 1 to 8.
As you can see in this example each bit value is calculated as 2 raised to the power of its position. Its index position tells us how many times we need to do a calculation to the power of two starting from zero.
So if we take the Most Significant Bit (MSB) all the way on the left, then we would have to do, two to the power of seven. And net a decimal number of 256.
All thanks to logic gates in your CPU that groups 8 bits into one byte. With a byte we can create a total of 256 unique combinations and store data.
Enough to represent characters, colors, numbers, and more.
Here I show you a message using three bytes assigned to the ASCII (American Standard Code For Information Interchange) standard.
That's it for part 0.
Binary isn’t just computer science, it’s the language your devices think in. And this is just the beginning.
I hope you enjoyed reading binary part 0, it’s part of my deeper journey into logic and computer systems. I’ll revisit and expand on it soon. If you have something to add, or see a gap in my thinking feel free to reach out.
Follow one of these links: LinkedIn, or X/Twitter to find me.
For programmed examples, Click Here to visit my repository. You'll find Rust examples with clean comments, matching this 7-part series.