How two digits make up everything you’ve ever seen online

An introduction to the digital language

Bassel Ghazali
Technology Simplified
4 min readMar 7, 2023

--

Photo by Sara Kurig on Unsplash

If you look inside a computer, you’ll only see 0’s and 1’s.

Actually, you wouldn’t, because computers use electrical signals to represent 0’s and 1’s, and we can’t see electrical signals, but you get the point.

If you’re wondering why they only use 0 and 1, here’s a quick explanation.

We don’t speak the same language as computers, so they’d be useless without translation. Luckily, computers have this translation built-in; they convert their inner language into languages we understand through a process called encoding.

Read on to find out how two humble digits manage to make up everything digital you’ve ever seen.

What binary looks like

A computer uses an electric signal to represent a 1, and no signal to represent a zero. If we look at an alternating chain of 0 and 1 being output from a computer, we’d see a wave that looks like this:

Image from Stack Exchange

Each digit of 0 or 1 is called a “bit”. 8 bits next to each other make up a “byte”, such as 01001101.

In our decimal system, kilo means 10³. When we say something weighs 8 kilograms, we know it means 8x1000 = 8,000 grams. See how nice and simple that is? I’m looking at you, imperial system.

Computers think in a binary system (remember, low and high) so they count in 2’s. A binary kilo means 2¹⁰ (1,024) instead of 1,000.

When we say a file is 8 bytes, it means the file is made of a chain of 8 bytes. This can look like 01010101 00100000 01110010 00100000 01100011 01110101 01110100 01100101. Paste that code into a binary-text converter for a surprise.

Similarly, when a file is 8 kilobytes it means it’s made of 8*1024 (8192) bytes.

How does binary turn into text?

We first need to understand how binary can represent numbers, then we can understand text representation in one extra step.

We can represent a number as a sum of other numbers. 216 is also 200+10+6 or 128 + 64 + 16 + 8

200+10+6 is a special representation of the number called base-10. It shows how the number can be made using only numbers which are multiples of powers of 10 (except the last digit).

Another way to show this sum would be

2x100 +1x10 + 6, or 2x10² + 1x10¹ + 6x10⁰.

128 + 64 + 16 + 8 is also a special representation. It’s base-2! It can be written as 2⁷ + 2⁶ + 2⁴ + 2³.

We represent binary numbers using this base-2 concept through a chain of 1’s and 0’s which show if each power of 2 is included in the addition.

To represent 216 in binary, we expand the base-2 addition to include every power of 2, multiplying the numbers we don’t need by zero.

2⁷ + 2⁶ + 2⁴ + 2³ is equivalent to

1x2⁷ + 1x2⁶ + 0x2⁵ + 1x2⁴ + 1x2³ + 0x2² + 0x2¹ + 0x2⁰.

Taking those 1’s and 0’s before each power of 2 gives us 216 in binary: 11011000.

We can represent any digit using this system.

Demonstration of binary counting from Imgur

How do we get text from these chains of 0’s and 1's?

We’ve developed rules to represent letters using numbers, which allows every computer to communicate letters using 0’s and 1’s.

An example of these rules is ASCII, or “American Standard Code for Information Interchange”. ASCIII is a table which lists every 8-bit binary code from 0000 0000 to 1111 1111 and assigns a meaning to it. The numbers 65–90 in binary represent the characters A-Z, so 65 is “A”, 66 is “B”, etc. You can see the entire list here.

If 2 devices agree on this format, then one device can take letters that we input, convert them to binary code using this mapping, and send it to another device which can convert it back to letters for us to read.

What about images?

Every pixel in our screens is made of 3 little lights: a red light, a blue light, and a green light. They’re too small for us to see individually; we see them as a single coloured dot unless we look very closely.

By lighting the 3 lights up with different intensities, we can change how this dot appears to us; lighting up the red and blue light will give us a purple light, lighting them all up fully gives us white, turning them off gives black, and so on.

A pixel needs to be given 3 numbers, telling it how strong to light up each of the three lights. If we use the binary representation of those numbers, a binary processor can then send signals containing those 3 numbers to each pixel, and it can control the screen.

Illustration by the author

With 2 digits and a whole lot of creativity, humanity has managed to represent everything imaginable. It’s an achievement we mostly take for granted, but one that I hope this article has given you an appreciation for.

If you enjoyed this article, consider following me so that you don’t miss out on my weekly writings!

--

--

Technology Simplified
Technology Simplified

Published in Technology Simplified

Technology can be difficult to learn from scratch, but it’s possible. Everybody should be able to benefit from it, and everybody can! Technology Simplified curates articles which demystify technology, and make it accessible to people of any background.

Bassel Ghazali
Bassel Ghazali

Written by Bassel Ghazali

Techie, photographer, digital artist and nature-lover. I write about these areas, sometimes individually, sometimes together.