Chapter 4
Chapter 4
Chapter 4
Gates and Circuits
Chapter Goals
• Identify the basic logic gates and describe their behavior
• Combine basic gates into circuits
• Describe the behavior of a gate or circuit using Boolean expressions,
truth tables, and logic diagrams
• Describe how gates are implemented using transistors
3
Chapter Goals
• Understand the function of the half adder and full adder
• Describe how a multiplexer works
• Explain how the S-R latch operates
• Describe the characteristics of integrated circuits
4
Circuits
Two or more gates combined to perform more sophisticated tasks
5
Gates
Six types of logic gates:
▫ NOT
▫ AND
▫ OR
▫ XOR
▫ NAND
▫ NOR
7
NOT Gate
The NOT gate accepts one input signal (0 or 1) and returns the inverted
(opposite) signal as output
NOT gate
8
AND Gate
• An AND gate accepts two input signals
• If both inputs are 1, the output is 1; otherwise, the output is 0
AND gate
9
OR Gate
• An OR gate accepts two input signals
• If both inputs are 0, the output is 0; otherwise, the output is 1
OR gate
10
XOR Gate
XOR is pronounced “exclusive OR”
An XOR gate accepts two input signals
If both inputs are the same, the output is 0; otherwise, the output is 1
XOR gate
11
XOR Gate
• Note the difference between the XOR gate and the OR gate; they differ
only in one input situation:
▫ When both inputs are 1, the OR gate produces 1 whereas the XOR produces 0
12
NAND Gate
• The NAND gate accepts two input signals
• If both inputs are 1, the output is 0; otherwise, the output is 1 (opposite
of AND gate)
NAND gate
13
NOR Gate
• The NOR gate accepts two input signals
• If both inputs are 0, the output is 1; otherwise, the output is 0 (opposite of
OR gate)
NOR gate
14
Circuits
Combinational circuit
The current input values explicitly determine the output
Sequential circuit
The output is a function of the current input values as well as the current
output value
We describe the circuit operation using:
▪ Boolean expressions
▪ Logic diagrams
▪ Truth tables
16
Combinational Circuits
Combinational Circuits
• Three inputs require eight rows to describe all possible input combinations 23
• This circuit can be written using the Boolean expression AB + AC
18
Combinational Circuits
Consider the following Boolean expression A(B + C)
Combinational Circuits
Circuit equivalence
• Two circuits produce the same output
• Boolean algebra allows us to apply provable mathematical principles to
help design logic circuits
Binary Adders
• At the digital (logic) level, addition is performed in binary
• Addition is performed by special circuits called adders
• The result of adding two binary digits could produce a
carry value
• Recall that 1 + 1 = 10 in binary
Half adder: a circuit that computes the sum of two bits
and can produce a carry bit
Half adder does not take a carry-in value!
Truth table of a Half Adder
22
Adders
Boolean expressions:
sum = A B
carry = AB
23
Adders
Full adder adds three values: two inputs and a carry-in
A full adder
24
Multiplexers
Multiplexer (often referred to as MUX is a circuit that produces a single
output signal. The output is simply one of several input signals. The
multiplexer decides which of the inputs is used as the output based on
the value of other input signals, called control signals or selectors
n input 1 output
lines line
m control signals
2-to-1 MUX
4-to-1 MUX n-to-1 MUX (n is power of 2)
25
Multiplexers
An 8-to-1
multiplexer
with three
In the figure shown, the control lines control lines
Circuits as Memory
No change
No change
RESET
RESET
SET
SET
S-R latch
Not possible (don’t care)
Integrated Circuits
Constructing Gates
Review Exercises
Q1) Draw the logic symbol, truth table, and logic expression of the OR gate
Q2) Draw the logic symbol and truth table of the 4-to-1 MUX
Q3) Draw the logic symbol and truth table of the S-R latch
Q4) What is the output X of the combinational logic circuit shown below if
the inputs are as follows: A=0, B=0, C=1