LOGIC GATE
Actually the term logic is applied to digital circuits used to implement logic
functions. Several kinds of digital logic circuits are the basic elements that
form the building blocks for such complex digital system as the computer.
The lines connected to each symbols are the inputs and outputs.
The inputs are on the left of each symbol and the output is on the right.
A circuit that performs a specific logic operation (AND, OR) is called a logic
gate.r aaa
AND gate
e.g. I get up if it is 8-00 a.m. AND it is a weekday
he said if A = 8-00 a.m. B = weekday and Y = get up
then he said you can yrite:
=A-B
where the dot represents logical AND.
He went on to say that if 1 represents
TRUE
and... O represents FALSEro OE
Truth Table
The truth table has an entry for each possible
combination of inputs.
For n inputs there will be 2" entries ... 2 inputs =
4 entries.
A 8 y
0 o 0 We can have more than
oO 1 o two inputs in which case
1 0 0 the only time we would
1 1 1 have a 1 out is when all
the inputs are true.
Loe atesSymbol
The symbol adopted for the AND function
(gate) is shown below
American (MIL-STD-806)
a—
Ba
—
ey
LY
Loe ates
British (TE
a—
&
B |
C 617:12)
ryoe I
OR gate
e.g. I turn on my headlights if it is dark OR it is raining
if A= dark B = raining and ¥ = headlights on then:
Y=A+B
where the + sign represents logical OR.
Logie Gates: CO LE
A 8 ¥ We can have more than
0 ° ° two inputs in which case
0 1 1 the only time we would
1 0 1 have a 0 out is when all
1 1 1 the inputs are false.
American (MIL-STD-806) British (IEC 617:12)
sayy sa,
B 7 Bo
Logie GatesPo OTT
NOT gate
e.g. I turn on the heating if it is NOT hot
if A = hot and Y = Heating on then:
Y=A
where the bar represents logical NOT.
Loge GatesA ¥ We can only have one
0 1 input and the output is
1 0 always the opposite
sign.
‘American (MIL-STD-806) British (TEC 617:12)
‘ SO—Y 4—1p,
Logie Gatesi I
Using these three gates we can design any
logic circuit.
We will define three additional gates
which aid circuit design.Exclusive OR EXOR gate
Y=A@B_ where the @ sign
represents logical EXOR.
Note that the normal OR includes
the case where we have both
inputs true. The EXOR does not
include this case.
For more than two inputs the gate
is defined as:
The output is TRUE if we have an
ninloo>
HlolHiow
olH|Hio <
odd number of inputs TRUE
Loge Gates— OE
The symbol adopted for the EXOR function
(gate) is shown below
‘American (MIL-STD-806) British (EC 617:12)
TE
Logie GatesNot AND NAND gate
Y=A-B
We can have more
where the dot and
than two inputs in
which case the
bar represents
only time we
logical NAND.
would have a 0 out
nlelolo|>
rloHlolw
is when all the
inputs are true.
ofnlnlnl<
American (MIL-STD-806)
Loge Gates
British (IEC 617:12)
& Oy
a—Not OR NOR gate
Y=A+B
where the + sign
and bar represents
logical NAND.
nlelolo|>
rloHlolw
olololn|<
American (MIL-STD-806)
A <>,
») 0”
Loge ates
We can have more
than two inputs in
which case the
only time we
would have a 1 out
is when all the
inputs are false.
British (EC 617:12)
A—
B
21” ea
Universal Gates
NAND and NOR gates are referred to as
universal gates as the three basic gates can
be constructed using either one of the two.
This therefore implies that all logic circuits can
be constructed using either of the gates.
The notes show this process for NAND only but
it can be shown for NOR also.
Loge Gates* CC
NOT using NANDs only
A B Y The Truth Table is for a NAND gate
o;o/. Tf we tie the inputs of a NAND together
then we limit the possible input
combinations to two, 1 1 and 0 0. These
are shown on the table now if the input is
0 the output is 1 and vice versa ~
a NOT gate
aT
>
Losi GatesAND using NANDs only
As a NAND is simply an AND followed by a NOT
gate (inverter) we can simply use a NAND
followed by NOT.
e
\
oOo
S/S
ee
Note - more than one NAND gate to
produce the desired AND gate.
Loge GatesOR using NANDs only
A | BUAt+B
0 0 0
0 1
1 0 1
1 1 1
This is our desired OR gate_ ee
OR using NANDs only
AB A+B 4B
oO oO oO 1 a
oO 1 1 O
¥ oO 1 oO 1
1 1 1 0 °
If we now add NOT A and NOT B
into our tablePo LE
OR using NANDs only
AB A+B A | BAB
0 0 0 1 1 1
0 1 1 1 0 0
1 0 1 0 1 0
1 1 1 0 0 0
If these are now ANDed together= |
OR using NANDs only
A | B A+B) A | BAB AB
oO O oO 1 1 1 oO
Oo 1 1 1 QO oO 1
£ Oo 1 oO 1 oO 1
1 1 1 0 oO 0 1
Finally if we invert our result we see that the 3r¢
and 7" column are identical. This means that if we
invert the inputs then NAND then we will end up
with the OR function.
Loge Gates=
OR using NANDs only
.
“LLP .)
y
2 [pr {FP
Let us examine the way in which logic gates
can be used to realise logic circuits:Po TI
Example
A drill (D) is to operate if we are in automatic (A) and the
system (S) is running or if we are in manual (M) anda
button (B) is pressed or if an override (0) input is not
operated.
The boolean (logic) expression far this gn be written in
the following way:
At
This can be s— 7]
constructed in the mt a.
following way:
Ba / ae