Introduction#

This book is about the design of digital logic circuits. It assumes some background in basic electrical circuits.

Basic electrical circuits work with voltages, currents, resistances, capacitances, and inductances. A course on basic electrical circuits shows how to analyze networks of such passive components.

Digital circuits are different.

Digital circuits work with binary numbers \(\mathbb{Z}_2\) or \(\{ 0, 1 \}\) to perform logic. A computer is built on a series of digital circuits.

Because we operate in the real world[1], we must represent these 0s and 1s by a voltage or a current. One standard representation is to say that a logic 0 (false) is 0 volts and a logic 1 (true) is 5 volts, though there are many others.

Logical Operations#

When our “signals” are binary numbers, we can perform some interesting operations using them.

Suppose we have \(A, B \in \mathbb{Z}_2\), then we can combine them using a function \(f(\cdot, \cdot)\):

\[ X = f(A,B) \]

where \(X \in \mathbb{Z}_2\) also.

Logical \(\tt OR\)#

If \(A\) and \(B\) represent the state of two switches controlling one light and \(X\) represents whether the light is on or off, then we can say that \(X\) is on if either \(A\) is on or \(B\) is on or if both \(A\) and \(B\) are on.

We can write this in shorthand as

\[ X = A\ {\tt OR}\ B \]

or

\[ X = A + B \]

\(\tt OR\) Truth Table#

One way to represent this function is to present all possible values of \(A\) and \(B\) and the resulting value of \(X\). This is called a truth table.

The truth table for the logical \(\tt OR\) operation is below in Table 1.

Table 1 The logical \(\tt OR\) operation.#

\(A\)

\(B\)

\(X\)

0

0

0

0

1

1

1

0

1

1

1

1

Logical \(\tt AND\)#

If \(A\) and \(B\) represent the state of two locks on a door ( 1 is unlocked, 0 is locked) and \(X\) represents whether the door is locked (0) or not (1), then we can say that \(X\) is only unlocked if both \(A\) and \(B\) are unlocked.

We can write this in shorthand as

\[ X = A\ {\tt AND}\ B \]

or

\[ X = A\ .\ B = AB \]

\(\tt AND\) Truth Table#

The truth table for the logical \(\tt AND\) operation is below in Table 2.

Table 2 The logical \(\tt AND\) operation.#

\(A\)

\(B\)

\(X\)

0

0

0

0

1

0

1

0

0

1

1

1

Logical \(\tt NOT\)#

The third basic building block of logical functions is the \(\tt NOT\) function. This function simply swaps the value of the input, so if the input is a 0, it changes to a 1 and vice versa.

We can write this in shorthand as

\[ X = {\tt NOT}\ A \]

or

\[ X = !A \]

\(\tt NOT\) Truth Table#

The truth table for the logical \(\tt NOT\) operation is below in Table 3.

Table 3 The logical \(\tt NOT\) operation.#

\(A\)

\(X\)

0

1

1

0

Next Steps#

The examples given above are all for one or two input, one output functions. As you might imagine, computers and other more complicated digital devices rely on many more inputs and many more outputs as most computers have gigabytes of memory.

These functions using logical variables are often called combinational or combinatorial logic. The next section will look at more complicated functions and how we can design circuits with them.