Digital Logic Design - Switch Logic & Basic Gates
Digital Logic Design - Switch Logic & Basic Gates
2
Switches in Series
3
Switches in Parallel
4
Normal vs Inverting Switch
5
Boolean Logic
Boolean Logic is based on two states, e.g., True (1) or False (0)
Boolean Logic is a form of algebra which is based on three simple
Operators: “Not”, “Or,” and “And,”.
6
The Inverter (NOT Gate)
Input Output
A X A X
0 1
1 0
7
The Inverter (Not Gate)
A X
Example waveforms:
A
X
8
Decimal vs Binary Numbers
Decimal Numbers
Commonly used in our daily lives
They have 10 possible symbols (called digits) 0,1,2,3,4,5,6,7,8,9
Binary Numbers
Used in all digital systems
They have 2 possible symbols (called bits) 0,1
9
The Inverter (Not Gate)
Binary number
1 0 0 0 1 1 0 1
0 1 1 1 0 0 1 0
1’s complement
10
The AND Gate
The AND gate produces a HIGH output when all inputs are
HIGH; otherwise, the output is LOW. For a 2-input gate,
the truth table is
Inputs Output
A B X
0 0 0 A X
0 1 0 B
1 0 0
1 1 1
11
The AND Gate
A X
B
Example waveforms:
A
B
X
13
The OR Gate
A X
B
Example waveforms:
A
B
15
Logical Operations
Assuming A=0101 and B=1001 as inputs and X as output
A X
B
Example waveforms:
A
B
X
The NAND gate is particularly useful because it is a
“universal” gate – all other basic gates can be constructed
from NAND gates.
How to build a NOT gate from a 2-input NAND gate?
18
The NOR Gate A X
B
Inputs Output
Think of it as OR followed by NOT A B X
ForInput
a 2-input gate, the truth table is 0 0 1
NOR
0 1 0
A B OR OR-NOT X 1 0 0
0 0 0 1 1 1 1 0
0 1 1 0 0
1 0 1 0 0
1 1 1 0 0
The NOR operation is written as X = A + B = (A+B)’
pronounced as A+B whole complement
19
The NOR Gate
A X
B
Example waveforms:
A
B
X
The NOR operation will produce a LOW if any input is HIGH.
20
The XOR Gate
A X
B
A X
B
Example waveforms:
A
B
X
Notice that the XOR gate will produce a HIGH only when exactly one
input is HIGH.
A X
B
Example waveforms:
A
B
Notice that the XNOR gate will produce a HIGH when both inputs are the
same. This makes it useful for comparison functions.
Inputs Output
A
C X A B C X=ABC
B
0 0 0
0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
Notice that 1 1 1 1
• A 1-input inverter has two possible input values: 0, 1.
• A 2-input gate has 4 possible input combinations: 00, 01, 10, 11.
• A 3-input gate has 8 possible input combinations, for each input the
number of combinations is doubled. c
25
Three Input OR Gate
Inputs Outputs
A B C X=A+B+C
0 0 0
0
0 0 1
1
0 1 0
1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
Notice that 1 1 1 1
To create the input combinations, we use alternating 0s and 1s.
• Input C has one 0 followed by one 1.
• Input B has two 0s followed by two 1s.
• Input A has four 0s followed by four 1s, and so on…
26
Three Input XOR Gate
X= A + B + C
Inputs XOR
A B C D=A + B D+C X
0 0 0 0 0 0
0 0 1 0 1 1
0 1 0 1 1 1
0 1 1 1 0 0
1 0 0 1 1 1
1 0 1 1 0 0
1 1 0 0 0 0
1 1 1 0 1 1
27