Documente Academic
Documente Profesional
Documente Cultură
Objectives OR, AND, NOT, NAND, NOR, XOR and XNOR logic gates. Logic expression. Logic Circuits. Truth Table.
10
Logic Gates
2.1
Logic Gates
The basic building block of any digital circuit is a logic gate. OR, AND and NOT gates are the most basic gates. All other gates can be constructed using these three gates. Four other gates are NOR, NAND, XOR and XNOR gates. A logic gate has at least one and only one output. Let A and B represent two input variables listed on the left, and the output Y on the right. Logic gates operate with binary numbers. A binary 0 will mean a Low voltage (+0 volt) and a binary 1 will mean a High voltage (+5 volt). All possible input combinations for A and B and the output Y are shown using a truth table.
Input A 0 0 1 1 B 0 1 0 1 Output Y
Input A
Input B
Logic Gate
Output Y
Truth table
Logic Gate
2.2
OR Gate
The output of an OR gate is 1 if any of the inputs are 1. The parallel circuit shows the idea of an OR gate. The output lamp Y will light when either or both of the input switches are closed.
A B Y
A 0 0 1 1
B 0 1 0 1
Y=A+B 0 1 1 1
A B
Parallel circuit
Truth Table
OR gate symbol
Logic Gates
11
The Boolean expression for an OR gate is Y = A + B . Note that the plus (+) sign means OR in Boolean algebra. It is read as A OR B equals Y. The OR truth table can be expressed as follows: 0+0 0+1 1+0 1+1 = = = = 0 1 1 1
A 3 input OR logic gate will have 23 = 8 input combinations. The input variables are A, B and C. Note that if any of the inputs are 1, the output will be 1.
A B
A B C
C D
12
Logic Gates
A 0 0 1 1
B 0 1 0 1
Y=A.B 0 0 0 1
A B
Serial circuit
Truth Table
The Boolean expression for an AND gate is Y = A B . Note that the dot ( ) sign means AND in Boolean algebra. It is read as A AND B equals Y. The dot sign is generally omitted, so that the expression becomes Y = AB . The AND truth table can be expressed as follows: 0.0 0.1 1.0 1.1 1.1 = = = = = 0 0 0 0 1
Truth Table
12
Logic Gates
A B
Y =
A B
Invert bubble
Truth Table
2.6
NAND Gate
NAND gate means NOT AND. It is actually an AND gate followed by an inverter. In other words, the output of an AND gate is inverted to form a NAND gate. The NOR gate symbol is an AND gate with an invert bubble at the output. The Boolean expression is Y = AB .
A 0 0 1 1
B 0 1 0 1
Y 1 1 1 0
A B
Y =
A B
Truth Table
Logic Gates
13
numbers of 1s, and therefore the output is 1. The Boolean expression is Y = A B , that can also be written as Y = A.B + A.B .
A 0 0 1 1 B 0 1 0 1 Y 0 1 1 0
A B
Truth Table
A B
Truth Table
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
C 0 1 0 1 0 1 0 1
AB 0 0 0 0 0 0 1 1
14
Logic Gates
Exercises
1. Derive the truth tables for the following logic gates: a. b. c. d. 3 3 3 3 input input input input AND gate NAND gate XOR gate XNOR gate.
b.
A B C Y
c.
d.
A B Y C D
A B C Y
e.
A B C Y
f.
A B Y C D
b.
A B C Y
Logic Gates c.
A B C D Y
15 d.
A B C D Y
b.
A B C Y
c.
A B C Y
d.
A B C Y
e.
A B Y C D
f.
A B Y C D
b.
A B C Y
16 c.
A B C Y
Logic Gates d.
A B Y C D
e.
A B C Y
f.
A B Y C D
e. Y = (A + B)(C + D)
Y = A.B + C.D
g. Y = A.B.C h. Y = ABCD 7. Derive the truth tables for the following Boolean expressions: a. Y = AB + C b. Y = (A + B)C c. Y = ABC
Logic Gates
17
8. The NAND gate expression Y = AB is not equivalent to Y = A.B . Derive the expression Y = A.B truth table. 9. The logic expression A.B is not equivalent to Y = AB = AB . Derive the truth table for A.B . 10. Derive the expression Y = AB + AB truth table. Is it equivalent to the expression Y = A B ?