# Understanding Digital Abstraction

# In the name of Allah, the Most Gracious, the Most Merciful

## Understanding Digital Abstraction

In the physical world, the information surrounding us is **continuous**. Think of the voltage running through a wire, the precise position of an object in space, or the frequency of a sound wave. These values can take on an infinite number of variations.

However, digital systems operate differently. They represent information using a finite set of variables, a concept known as **discrete** information.

* * *

### From Gears to Bits: The History of Discrete Values

One of the earliest examples of a discrete value system was the **Analytical Engine**, designed by Charles Babbage. Unlike modern computers, it didn't use electricity; it used mechanical gears.

*   **The Decimal Approach:** Each gear could represent 10 distinct values (0–9).
    
*   **Precision:** With 25 gears, the machine could perform calculations with 25-digit precision.
    
*   **The Trade-off:** While revolutionary, it was massive, mechanical, and slow.
    

You can explore the mechanics further on [Wikipedia](https://en.wikipedia.org/wiki/Analytical_engine).

![](https://cdn.hashnode.com/uploads/covers/68613bade77498b02de581f1/fd5eab4a-b2db-458c-b1cb-849f53d18653.png align="center")

* * *

### The Binary Advantage

Today’s electronic systems have moved away from Babbage’s 10-state system in favor of the **binary system**. This system relies on only two states:

*   **High Voltage:** Represented as **1**
    
*   **Low Voltage:** Represented as **0**
    

**Why only two?** It is significantly easier and more reliable for hardware to distinguish between "on" and "off" than it is to precisely measure ten different levels of voltage. This makes modern computers incredibly fast and resistant to errors.

* * *

### Measuring Information: The Bit

The amount of information $D$ in a discrete variable with $N$ distinct states is measured in **bits** (binary digits). We calculate this using the following formula:

$$D = \log_2(N)$$

#### Example 1: A Binary Variable

For a single binary variable (0 or 1), there are $N = 2$ states. $$D = \\log\_2(2) = 1 \\text{ bit}$$

#### Example 2: Babbage’s Gears

One gear in the Analytical Engine had $N = 10$ states (0-9). $$D = \\log\_2(10) \\approx 3.32 \\text{ bits}$$ This means one of Babbage's gears held roughly 3.3 times more information than a single modern bit.

* * *

### Continuous vs. Discrete

In theory, a **continuous** variable has infinite states, meaning it could store an infinite amount of data. However, due to physical noise and technical limitations, we can usually only measure continuous signals up to a resolution of 10 or 12 bits (roughly 1,024 to 4,096 distinct states).

* * *

### What is Digital Abstraction?

**Digital Abstraction** is a "contract" between the physical hardware and the logical designer. It allows us to ignore the messy physics of electrons, gears, or fluid levels. As long as the system recognizes a "High" or "Low" state, we can treat the information as pure logic.

In this series, we will focus on **Boolean Logic**:

*   **1:** High / True
    
*   **0:** Low / False
    

By using this abstraction, a programmer doesn't need to care *how* the 1s and 0s are physically stored—only that they exist. (Though, understanding the underlying architecture certainly helps when it comes to optimizing code!)

* * *

**Next Lesson:** Number Systems
