3. Background
3.1. What is Digital Logic?
-
Digital logic describes the operation of binary systems: 2-valued systems, or systems where only two values are possible; true or false.
-
Variables in binary systems are binary variables. They can assume one of only two possible values; true or false.
-
In digital circuits, the true value is represented by a high voltage while false is represented by a low voltage.
-
Common alternative representation for these two values are
1
and0
, alternatively called true and false, respectively. -
Digital logic operations are governed by a special algebraic system named Boolean algebra. Compared to normal algebraic operations, logic operations operate only on binary variables.
-
Boolean algebra defines three basic Boolean operations: AND, OR, and NOT.
-
In digital circuits, Boolean variables are represented by electronic signals. Boolean operations on these variables are performed by electronic circuits referred to as logic gates.
3.1.1. AND Gate
Given two statements, a and b, where each statement can only be either true or false, we can say that statement a AND statement b are true only if statement a is true and statement b is also true. Thus, AND-ing two true statements results in a true statement.
In digital logic, the output of an AND gate is true (high) only when all of its inputs are individually true (high).
To describe the AND operation, we use a truth table. The truth table of a gate specifies the value at the output of the gate for each possible input combination. For n inputs, the number of possible input combinations is 2n. The truth table for the two-input AND gate is shown below.
in1 | in2 | out |
---|---|---|
F |
F |
F |
F |
T |
F |
T |
F |
F |
T |
T |
T |
3.1.3. Two-Input XOR Gate
A two-input XOR gate outputs a value of true, or high, if its two inputs are different, and outputs a value of false, or low if the inputs are the same, i.e. both true or both false.
3.1.4. NOT Gate
Another important logic gate is the inverter or the complement, also known as the NOT gate. It negates the input value; turning an input whose value is true to an output of value false, and vice versa.
3.1.5. NAND, NOR, and XNOR Gates
The NAND gate is a combination of the AND with the inverter (NOT gate) connected at its output. The NAND gate is the reverse or complementary form of the AND gate. It is also a universal gate because it can implement all other basic gates.
Similarly, the NOR gate is equivalent to an OR gate with an inverter at its output. It is the complementary form of the OR gate, and is also a universal gate.
The XNOR gate is equivalent to an XOR gate with an inverter at its output, and is the complementary form of the XOR gate.
3.2. Logic Gate Integrated Circuits (ICs)
The 7400 series of transistor-transistor logic (TTL) integrated
circuits (ICs) contains hundreds of devices, including the basic logic
gates discussed above. A given IC from this family has a specific
number that starts with 74
, followed by a few optional letters, then
two or three digits. The letters are related to some characteristics
of the IC electronics. For example:
L
|
Low power (compared to the original TTL logic family), very slow |
LS
|
Low power Schottky (named after the German physicist Walter H. Schottky) |
AS
|
Advanced Schottky |
ALS
|
Advanced low power Schottky |
F
|
Fast (faster than normal Schottky, similar to AS) |
C
|
CMOS |
HC
|
High-speed CMOS |
7408
)The last two (or three) numbers are the important part that indicates the function of the IC. For example:
74xx04
|
NOT gate |
74xx08
|
AND gate |
74xx32
|
OR gate |
74xx86
|
XOR gate |
The 5400 series of ICs is functionally similar to the 7400 series. For example, both 7408 and 5408 ICs are quad 2-Input AND gates. The difference is that the 7400 series is consumer-grade, whereas the 5400 series is for military applications. The 5400 series ICs tolerate a wider supply voltage, work in wider temperature ranges, and have better noise immunity. They are also more expensive. The operating temperature range for the 5400 series is -50°C to 125°C, while the 7400 series range is from -40°C to 85°C. Similarly, the 5400 series can be operated in the voltage range 4.5V to 5.5V, while the 7400 series can be operated in the voltage range 4.75V to 5.25V. |
3.3. Breadboards
A breadboard is a reusable base board used to prototype and experiment
with electronic circuits without soldering any components. The
small breadboard figure shows a small breadboard. The
holes in the board are connected as shown in the
breadboard connections figure. For example,
all the blue holes in section A
in the
breadboard connections figure are
connected, such that connecting any one of them to a GND
terminal
will result in them all acting as GND
. Sections A
and D
in the
figure are typically known as the power rails. In a larger
broardboard, such as the one shown in the
large breadboard connections figure,
there may be multiple, disconnected power rails. Breadboards make it
convenient to connect components and build circuits.
3.4. Using ICs with a Breadboard
To use an IC, you refer to its datasheet. The pin layout is an essential part of any datasheet that specifies the function of each pin. As an IC contains electronic circuits, it needs to be powered by connecting an external power source, such as a battery, to the IC power terminals (pins). These pins are usually called Vcc (or Vdd) and GND (or Vss). An IC also has input and output pins.
Below are the pin layouts of the NOT IC and the 2-input AND, OR, and XOR ICs.
7408
: Quad 2-Input AND Gates7404
: Hex Inverters (NOT)7432
: Quad 2-Input OR Gates7486
: Quad 2-Input XOR GatesThe example circuit on a breadboard figure below shows how components can be interconnected using a breadboard.
To test a circuit, you would want to apply known inputs, observe the resulting outputs, and compare them to the expected outputs. A common way to apply a binary input is to use a switch, and a common way to observe a binary output is to use an LED. |
4. Tasks
4.1. Verifying the Truth Tables
-
Complete the truth tables of the 2-input AND, NOR, and XOR gates.
-
Verify the truth tables by implementing these three gates on the breadboard using the ICs for the AND, OR, XOR, and NOT gates.
To use an IC:
-
Test it using the IC tester.
-
Place it on the breadboard carefully.
-
Connect its
Vcc
andGND
pins to a+5V
power source and a ground terminal, respectively. Use the power rows on the bread board for easy access to these two signals. -
Use switches to control the inputs, and LEDs to observe the outputs.
-