Digital Logic

Table of Contents

What is digital logic and how do logic gates work?

Circuit with Single Switch and Truth Table

Let us examine the two basic circuits below. The top one has an open switch and therefore the bulb is OFF. The second one is closed and the bulb is ON.

The bulb in ON or OFF depending on the position of the switch. Let use 0 to describe the switch when it is open and 1 when the switch is closed. We also use 0 to describe the bulb when it is OFF and 1 when the bulb is ON to write all possible situations in the following table.

Single Switch and Its Truth Table
Figure 1. Single Switch and its Truth Table



Circuit with Two Switches in Parallel and Truth Table

We now examine circuits with two switches in parallel as in the figure below. Since the switches are in parallel, if either switch X is closed or switch Y is closed or both are closed the circuit is closed and the bulb is ON. The table below includes all possible combinations of the positions of the two switches and the corresponding state of the bulb (ON or OFF).

Single Switch and Its Truth Table
Figure 2. Two Switches in Parallel and Their Truth Table
The above table corresponds exactly to the OR function as defined in Boolean algebra.
Using Boolean algebra, the results in the table above may be written as follows:
OR Function Truth Table
Figure 3. OR Function Truth Table

Although the first three sums have the same meaning as in any mathematical addition, the last sum 1 + 1 = 1 suggests that the meaning of addition here is different. This is boolean algebra which originally used "TRUE" and "FALSE" before it was adopted in digital systems and 1 and 0 replaced the "TRUE" and "FALSE".



Circuit with Two Switches in Series and Truth Table

We now examine circuits with two switches in series as in the figure below. Since the switches are in series, the bulb is ON only when both switches are closed. The table below includes all possible combinations of the positions of the two switches and the corresponding state of the bulb (ON or OFF).

Two Switches in Series and Their Truth Table
Figure 4. Two Switches in Series and Their Truth Table

The above table corresponds exactly to the AND function as defined in Boolean algebra.
Using Boolean algebra, the results in the table above may be written as follows:
AND Function Truth Table
Figure 5. AND Function Truth Table
This is boolean algebra which originally used "TRUE" and "FALSE" before it was adopted in digital systems and 1 and 0 replaced the "TRUE" and "FALSE".



AND and OR Digital Circuits and Digital Logic

The above circuits with switches were used to explain the idea behind digital logic circuits. In practice these circuits are electronic circuits and their representation is as follows:

OR and AND logic gates

Figure 6. OR and AND logic gates



XOR Digital Circuit and Digital Logic

The logic gate exclusive OR (XOR) is defined by its table of input and output values as follows: .

AND Function Truth Table
Figure 7. XOR Function Truth Table


XOR logic gates
Figure 8. XOR logic gates