Have you wondered in school why do we learn binary in math? For my short experience, binary is very important in order to understand how modern computers work.

Just in case if you don’t know what binary numbers mean, they look like (11001101111). It is a numbering system where all digits are 0s and 1s instead of 0, 1, 2, …, 9.

In fact computers only understand 0s and 1s even though we use decimal numbers when we interact with it. When we use computers and software at some point of processing programs what we see will turn to binary then programs get processed. It is very complicated process which is out of this article’s scope.

Modern electronics are dominant by digital circuits as compared to analog circuits. But what are the differences?

In this article I will talk about analog and digital and their differences.  

Analog vs digital

What is analog data? Let’s say it this way, all data in nature is analog, like temperature (℃), weight (kg), length (m) and so on. What I mean, this data in nature could take any number and we can feel their effect on us. For example if we left a heavy object that means it has more kilograms (kg) than a light object.

If you see the graph above you see that analog data could take any number for example 10.2 [kg] or 10.21 or 10.3 [kg]. let’s say I want to transmit my voice to speaker. The microphone will pick up my voice and turn it to current waves in electrical circuit. Let’s assume the signal look like the graph above (the upper one). This wave takes all values of amperes (A, in graph amplitude) and frequency (Hz).

In analog signals, if you take any two points in the graph, you will notice that data is continuous. In comparison, digital signals takes samples of data at very short periods of time. Let’s say 3 [ms], which means every 3 [ms] a value is measured and you get the square look of signal so data is not continuous.

The shorter sampling time the more precise the signal. Humans can hear sounds between 20 Hz to 20 kHz, so if you can get digital signal of sound within that range you can transmit sound through digital circuits.  

At early days of electronics, all our devices were analog. Which means the input data was analog and you have to find a way to transmit it to output without losing content. That was challenging, they needed to amplify, filter or delete noise without affecting the quality of data. You needed to design very bulky devices in order to achieve that.

Now let’s talk digital. Nowadays you rarely see analog devices in our homes. So how digital is different from analog.

Basically all data in digital is binary. However this a limitation of digital. You cannot express all values in nature. For example if you go to your digital scale you might find that your weight is 67.5 [kg] or 67.6 [kg] but it cannot show you 67.54 [kg] for example.

I will explain what 1 and 0 in digital mean then I will explain why digital data has the above limitation.

Precession

What exactly does 1 and 0 mean in digital circuit? 1 mean HIGH voltage while 0 mean LOW voltage. High voltage could be 5 Volts [V] or 3.3 [V] while 0 simply mean 0 [V]. Let’s say for example DRAM which is the RAM installed in a lot of PCs today. DRAM uses capacitors to hold data. When the capacitor is charged it means 1, when it is discharged it means 0.

So when you design digital circuit for a scale for example you have to know the range of your measurements. Let’s the maximum you need is 100 [kg] and you want your smallest unit to be 0.1 [kg]. one way to do this is to say the scale in binary means 0.1 [kg] so if you want 0.5 [kg], it translated to 101 in binary. Then 100.0 [kg] means 11 1110 1000. In other word you need at least 10 digits in your digital circuit to hold your 0s and 1s. if you use the capacitor technique of DRAM you need at least 10 capacitors in your circuit.

If you follow the explanation so far you know that whatever value in analog you want to express in digital you need to get your circuitry ready for this. That’s why you cannot convert analog data to digital data perfectly, you are bound by digital circuit limitation and the digits you have physically. Obviously the more digits you have the more precise analog to digital conversion you get. But you can never convert perfectly, but you can have a good enough accuracy at least, I mean why do you need 67.58376 [kg] right?

Noise

The biggest pain when designing analog circuits is noise. Noise in electronics means the impurity in your signal. Noise is caused by electrical fields in circuits, power supply, air or many other causes. Some electronic components produce noise and manufacturers mention it in their data sheets.

Whenever you design analog circuits you want to transmit the input to output with as less noise as possible. So when input passes through each circuit component you have to clean the noise before signal gets to the next component.

High pass filter and low pass filter are one of the most famous noise reducing techniques. High pass filter only let high frequency components through while low pass filter only allows low frequencies.

Digital circuits on the other hand have close to perfect signals when transmitted. Why? Because whenever an input passes through a component (either 1 or 0), based on input the component produce new output and the signal goes to next component.

So even if there is a minor noise in input, each digital component produce a new signal. This is one of the reasons why digital circuits are dominating our electronics nowadays. Back on the days this was a dream for circuit designers to not go through the hustle of dealing with noise.

Processing

Now lets talk about another reason why digital circuits are dominant nowadays. Computers can only understand 0s and 1s. Not only in programming, if we go all the way to computer components and architecture we can see that digital circuits produce 0s and 1s signals, then these turn to programs and instructions, then to operating system, …, user interface, and all these shows the videos you watch in your computer.

In other words, if we analyze and understand how computers work we will find that the root of all that is the signals of 0s and 1s produced by digital components.

Digital signals are easy to process, think of addition, multiplication, subtraction, division and so on. They can be transmitted without worrying too much about noise. Since you only care about if bits either are HIGH or LOW then even if you could get 3.3 [V] is enough so you make even smaller devices.