1 Logic Gates
1 Logic Gates
Lecture 4
Logic Circuits
Logic ‘1’ 5V
• Logic or digital circuits are only concerned with two basic voltage
levels, logic ‘high’ (or logic ‘1’) and logic ‘low’ (or logic ‘0’).
0V
• Most logic systems use positive logic in which the higher voltage
level defines the logic ‘1’ state, and the lower voltage level defines Logic ‘0’
the logic ‘0’ state.
• Logic ‘0’ need not be 0 volts.
• Any logic circuit can be built out of just three basic components, the AND, OR and NOT gates.
AND Gate
A B Y
• AND gate operation described by truth table and Boolean expression Y = A.B 0
0
0
1
0
0
• The AND function only produces an output logic ‘1’ when both A and B are 1 0 0
equal to logic ‘1’. 1 1 1
A
Y
B
OR Gate
A
Y
B
NOT Gate
A Y
Y =A 0 1
1 0
• NOT gate described by truth table and Boolean expression
• NOT function inverts the input.
A Y
AND, OR and NOT gates are available as integrated circuit chips. Examples of these are the 7408 Quad AND
chip that contains four 2-input AND gates, the 7432 Quad OR chip that contains four 2-input OR gates,
and the 7404 Hex inverter that contains six NOT gates.
• Gates with up to 8 inputs are available.
14
School of Electronics
• Although it is possible to build any circuit out of AND, OR and NOT gates, in practice, circuits are usually
only built using one type of gate.
• This simplifies the wiring and makes more efficient use of integrated circuits.
• A NAND gate can replace an AND, OR or NOT gate.
• A NOR gate can replace an AND, OR or NOT gate.
• NAND gates tend to be the industry standard, but NOR gates can be used equally as well.
NAND Gate
A B Y
Y =A.B
0 0 1
0 1 1
• NAND gate operation described by truth table and Boolean expression 1 0 1
• NAND gate may be described as an AND gate followed by a NOT gate. 1 1 0
• NAND gate gives a logic ‘1’ output in all cases except when both A and B
are equal to logic ‘1’.
A Y
B
NOR Gate
A B Y
0 0 1
0 1 0
Y =A +B
1 0 0
• NOR gate operation described by truth table and Boolean expression 1 1 0
• NOR gate may be described as an OR gate followed by a NOT gate.
A
Y
B
• NOR gate gives a logic ‘0’ output in all cases except when both A and B are equal to logic ‘0’.
• These are also available as ICs. Examples are the 7400 quad NAND and the 7402 quad NOR.
• Gates with up to 8 inputs are available.
15
School of Electronics
• There are two more gates to complete the full set of logic gates. The Exclusive OR (XOR) and exclusive
NOR (XNOR)
A B Y
Exclusive OR Gate
0 0 0
0 1 1
1 0 1
Y =A. B +B. A or Y =A ⊕B 1 1 0
• XOR gives a logic ‘1’ output when either A or B are equal to logic ‘1’ but not both as is the case for the
normal OR function.
• XOR gives a logic ‘1’ output when A and B are different logic values
A
Y
B
A B Y
Y = A.B + A .B or Y = A ⊕B 0 0 1
0 1 0
• XNOR gate operation described by truth table and Boolean expression 1 0 0
1 1 1
• XNOR gives a logic ‘1’ output when A and B are the same logic value.
16
School of Electronics
B Y
• XOR and XNOR gate ICs are the 7486 and 74266 respectively.
• Obviously, only two input XOR and XNOR gates are available.
17