No history yet

Digital Logic Fundamentals

The Language of Computers

At its core, a computer doesn't understand words, images, or sounds. It only understands electricity being on or off. We represent these two states with the numbers 1 (on) and 0 (off). This two-digit system is called binary, and it's the foundation of all digital computing.

Binary

noun

A number system that uses only two digits, 0 and 1. Each digit is called a bit.

While computers thrive on binary, long strings of 1s and 0s are hard for humans to read. To make things easier, we often use other number systems that are easy to convert to and from binary: octal (base-8) and hexadecimal (base-16).

Hexadecimal is especially common because one hex digit can represent a group of four binary digits (bits) perfectly.

Decimal (Base-10)Binary (Base-2)Octal (Base-8)Hexadecimal (Base-16)
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Logic as Math

To manipulate these 1s and 0s, computers use a special kind of algebra called Boolean algebra. Named after George Boole, this system deals with true (1) and false (0) values. There are three fundamental operations.

Z=ABZ = A \cdot B
Z=A+BZ = A + B
Z=AZ = \overline{A}

These simple operations are the building blocks for every calculation a computer makes, from adding two numbers to rendering a complex video game.

These gates are physical devices, usually transistors, that implement Boolean operations. By combining them, we can build circuits that perform more complex tasks.

Circuits and Memory

We can categorize digital logic circuits into two main types.

Combinational Circuits: The output depends only on the current inputs. They have no memory of what happened before. An adder, which adds two numbers, is a classic example. The sum it outputs is based entirely on the numbers you give it right now.

Another common combinational circuit is a multiplexer, or MUX. A MUX is like a digital switch. It selects one of several input signals and forwards the selected input to a single output line. The selection is controlled by a separate set of control inputs.

Sequential Circuits: The output depends on the current inputs and the previous state of the circuit. They have memory. The most basic memory element is a flip-flop, which can store a single bit (a 1 or a 0).

By connecting flip-flops together, we can create more complex memory structures. A register is a group of flip-flops used to store a group of bits, like a single number or a processor instruction. A counter is a special kind of register that goes through a predetermined sequence of states, essentially counting up or down with each tick of a clock.

These two types of circuits, combinational and sequential, work together. Combinational circuits perform the calculations, while sequential circuits store the data and the results. This interplay is what allows a computer to perform complex, multi-step tasks.

Quiz Questions 1/6

What is the fundamental number system that computers use to represent the 'on' and 'off' states of electricity?

Quiz Questions 2/6

A logic circuit whose output depends not only on the present input but also on the past sequence of inputs is known as a ________ circuit.

From number systems to memory, you've now seen the fundamental logical principles that make modern computing possible.