of 25
7/23/2019 Ch03 Logic Gates (New).pdf
1/25
LOGIC GATES & FUNCTIONS
Lecture 4
Digital Design
Dr. PO Kimtho
Department of Computer Sciences
Norton University (NU)
7/23/2019 Ch03 Logic Gates (New).pdf
2/25
Binary and Logic
All digital systems use the binary numbering system
Hardware implementation of switches (ON / OFF)
With hardware there will be input and output nodes
Nodes are variables which represent bits in binary numbers
n number of input variables will tell the system that there are
2npossible conditions to perform
eg : 4 variables = 24= 16 conditions
Truth tables are developed to list the output result
7/23/2019 Ch03 Logic Gates (New).pdf
3/25
Binary and Logic
Example :
2 variables will have 4 possible input condition for a system to
respond
INPUT OUTPUT
A B Y
0 0 ?
0 1 ?1 0 ?
1 1 ?
SystemA
B
Y
Input nodes Output nodesLogic Truth Table
7/23/2019 Ch03 Logic Gates (New).pdf
4/25
Binary and Logic
Switching systems in digital or logic circuits are
called gates
Basic gate elements :
Inverter
AND
OR
NAND
NOR
XOR
XNOR
7/23/2019 Ch03 Logic Gates (New).pdf
5/25
Logic Gate : InverterThe inverter performs the Boolean
NOT operation. When the input is
LOW, the output is HIGH; when the
input is HIGH, the output is LOW.
Input
A X
Output
0 11 0
The NOT operation is shown with a
bar on top of the variable. Thus, the
Boolean expression for an inverter
is X=A A bar or not A
A X
Known also as com plement operat ion
7/23/2019 Ch03 Logic Gates (New).pdf
6/25
Logic Gate : InverterExample waveforms:
A
X
Can be used to form
the 1scomplement of a
binary number / data
Signed binary number
1s complement
1 0 0 0 1 1 0 1
0 1 1 1 0 0 1 0
7/23/2019 Ch03 Logic Gates (New).pdf
7/25
Logic Gate : AND Gate
The AND gate produces a HIGH
output when ALL INPUTSare HIGH;
otherwise, the output is LOW. For a
2-input gate, the truth table is
A
B
X
Inputs
A B X
Output
0 0
0 11 0
1 1
0
00
1
Can be written with a dot between
the variables but it may be implied
(no dot). Thus, the AND operation is
written as X= A .Bor X = AB.
7/23/2019 Ch03 Logic Gates (New).pdf
8/25
Logic Gate : AND GateExample waveforms:
A
X
B
0 0 0 0 0 0 1 1
0 1 1 0 1 0 1 1
Can be used in computer
programming as a maskselector.
0 0 0 0 0 0 1 1
7/23/2019 Ch03 Logic Gates (New).pdf
9/25
Logic Gate : OR Gate
The OR gate produces a HIGH
output when ANY INPUTSare HIGH;
otherwise, the output is LOW. For a
2-input gate, the truth table is
A
B
X
Inputs
A B X
Output
0 0
0 11 0
1 1
0
11
1
Written with a plus sign (+) between
the variables. Thus, the OR
operation is written as X=A + B.
7/23/2019 Ch03 Logic Gates (New).pdf
10/25
Logic Gate : OR GateExample waveforms:
0 0 1 0 0 0 0 0
0 1 0 0 0 0 0 1
Can be used in computer
programming as a dataconverter.
0 1 1 0 0 0 0 1
A
X
B
ASCII code for A
ASCII code for a
7/23/2019 Ch03 Logic Gates (New).pdf
11/25
Logic Gate : NAND Gate
The NAND gate produces a LOW
output when ALL INPUTSare HIGH;
otherwise, the output is HIGH. For
a 2-input gate, the truth table is
A
B
X
Inputs
A B X
Output
0 0
0 11 0
1 1
1
11
0
Can be written with a dot between
the variables with an overbar along
both variables. Thus, the NAND
operation is written as X= A .B
or alternatively X = AB.
7/23/2019 Ch03 Logic Gates (New).pdf
12/25
Logic Gate : NAND GateExample waveforms:
A
X
B
The NAND gate is particularly useful because it is a
universalgate all other basic gates can be constructed
from NAND gates.
Example : An inverter
7/23/2019 Ch03 Logic Gates (New).pdf
13/25
Logic Gate : NOR Gate
The NOR gate produces a LOW
output when ANY INPUTSare HIGH;
otherwise, the output is HIGH. For
a 2-input gate, the truth table is
A
B
X
Inputs
A B X
Output
0 0
0 11 0
1 1
1
00
0
Written with a plus sign (+) between
the variables with an overbar along
both the variables. Thus, the NOR
operation is written as X=A + B.
7/23/2019 Ch03 Logic Gates (New).pdf
14/25
Logic Gate : NOR GateExample waveforms:
Can be used in computer programming to control active low operations.
Example : Activating water flows when water tanks are low
A
X
B
7/23/2019 Ch03 Logic Gates (New).pdf
15/25
Logic Gate : XOR Gate
The Exclusive OR or XOR gate only
produces a HIGH output only when
BOTH INPUTS ARE ON OPPOSITE
LEVEL. For a 2-input gate, the truthtable is
A
B
X
Inputs
A B X
Output
0 0
0 11 0
1 1
0
11
0
Written with a circled plus sign ( + )
between the variables. Thus, the
XOR operation is written as
X=A + B.
7/23/2019 Ch03 Logic Gates (New).pdf
16/25
Logic Gate : XOR GateExample waveforms:
A
X
B
7/23/2019 Ch03 Logic Gates (New).pdf
17/25
Logic Gate : XNOR Gate
The Exclusive NOR or XNOR gate
only produces a HIGH output when
BOTH INPUTS ARE THE SAME
LEVEL. For a 2-input gate, the truthtable is
A
B
X
Inputs
A B X
Output
0 0
0 11 0
1 1
1
00
1
Written with a circled plus sign ( + )
between the variables and an
overbar. Thus, the XNOR operation
is written as X=A + B.
7/23/2019 Ch03 Logic Gates (New).pdf
18/25
Logic Gate : XNOR GateExample waveforms:
A
X
B
7/23/2019 Ch03 Logic Gates (New).pdf
19/25
Logic Integrated Circuits
Combinations of basic gates lead to the development of
integrated circuits, ICs.
Two types
Fixed function logic ICs
Programmable Logic ICs
Technology evolution
TTL(transistor-transistor logics using Bipolar Junction Transistor)
CMOS(complementary metal oxide semiconductor)
BiCMOS(Bipolar + CMOS)
7/23/2019 Ch03 Logic Gates (New).pdf
20/25
Logic Integrated CircuitsFixed Function Logic
14 13 12 11 10 9 8
1 2 3 4 5 6 7
0.335 0.334 in.
0.228 0.244 in.
Lead no.1
identifier
14 13 12 11 10 9 8
1 2 3 4 5 6 7
0.740 0.770 in.
0.2500.010 in.
Pin no.1
identifiers
14
1
14
1
DIP package SOIC package
7/23/2019 Ch03 Logic Gates (New).pdf
21/25
Logic Integrated CircuitsFixed Function Logic
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'00
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'04
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'08
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
' 02
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'10
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'11
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'20
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'21
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'27
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'32
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'86
14
1
8
7
9
6
10
5
11
4
12
3
13
2
VCC
GND
'30
7/23/2019 Ch03 Logic Gates (New).pdf
22/25
Logic Integrated CircuitsProgrammable Logic
7/23/2019 Ch03 Logic Gates (New).pdf
23/25
Logic Integrated CircuitsProgrammable Logic
BBAA
X = AB
SRAM
cell
SRAM
cell
SRAM
cell
SRAM
cell
SRAM
cell
SRAM
cell
SRAM
cell
SRAM
cell
7/23/2019 Ch03 Logic Gates (New).pdf
24/25
Programmable Logic
In general, the required logic for Programmable Logic
Devices (PLDs) is developed with the aid of a computer.
Logic can be specified either as a schematic diagram, a
text file in a particular hardware description language
(HDL) or a state diagram.
Logic Integrated Circuits
7/23/2019 Ch03 Logic Gates (New).pdf
25/25
Logic Integrated Circuits
Programmable Logic