CT - Topic 4 - Basic Logic Gates
CT - Topic 4 - Basic Logic Gates
◼ Deals with binary variables that take 2 discrete values (0 and 1), and with
logic operations
◼ Three basic logic operations:
o AND, OR, NOT
All basic logic gates have the ability to accept either one or two
input signals (depending upon the type of gate) and generate one
output signal.
LOGIC GATES
The Output signal from an AND gate is True (on, 1) if and only if both
Input signals are True (on, 1).
The Output signal from an AND gate is False (off, 0), otherwise.
OR GATE
The Output signal from an OR gate is True (on, 1) if either, or both, Input
signals are True (on, 1).
The Output signal from an OR gate is False (off, 0) if and only if both
Input signals are False (off, 0).
XOR GATE
The Output from an XOR (exclusive or) is True (on, 1) if and only if the Input
signals are different.
The Output from an XOR is False if the Input signals are either both True or both
False.
NOT GATE
The Output signal from a NOT gate is True (on, 1) if and only if the Input signal
is False.
The Output signal from a NOT gate is False (off, 0) if and only if the Input signal
is True.
NOT GATE COMBINED WITH OTHER GATES
We can combine NOT gate with OR, AND and XOR gates to create other
gates.
◼ NAND
◼ NOR
◼ XNOR
NAND GATE
NAND gate is a combination of the AND gate and the NOT gate.
NOR GATE
Truth table: tabular form that uniquely represents the relationship between
the input variables of a function and its output
TRUTH TABLES
A F
B
QUESTIONS
QUESTION: WRITE DOWN THE OUTPUT OF THE FOLLOWING
CIRCUIT
ANSWER
x+y
(x+y).y
y
QUESTION: WRITE DOWN THE OUTPUT OF THE FOLLOWING
CIRCUIT
ANSWER
x .y x .y
y
QUESTION: DRAW THE CIRCUIT FOR THE FOLLOWING BOOLEAN
ALGEBRAIC EXPRESSION
F = X’ + Y
ANSWER
F = X’ + Y
x
ANSWER
F = X’ + Y
x+y
QUESTION: DRAW THE LOGIC CIRCUIT, OUTPUTS AND THE
TRUTH TABLE FOR THE BOOLEAN EXPRESSION
F = (x + y).(x.y)
ANSWER
F = (x + y).(x.y)
x+y
(x+y).(x.y)
x.y x.y
ANSWER
Did you notice that the output of the logic circuit is similar to the output
of an XOR gate?
USAGE OF LOGIC GATES
HOW TO ADD BINARY NUMBERS
40
USING HALF ADDERS
We can then use a half-adder to compute the sum of two Boolean numbers
1 0 0
1 1 0 0
+1 1 1 0
? 0 1 0