24 - Boolean Algebra
24 - Boolean Algebra
Combinational Logic
Part 4
Objectives
•Other Gate Types
• NAND
• NOR
•More Gates Types
• XOR
• XNOR
More Gates: NAND - NOR
X Y Z=(XY)’
0 0 1
X
NAND Z F = (XY)’ 0 1 1
Y 1 0 1
1 1 0
X Y Z=(X+Y)’
X 0 0 1
NOR Z F = (X+Y)’
Y 0 1 0
1 0 0
1 1 0
Sometimes it is desirable to build circuits using NAND gates only or NOR gates
only
NAND Gate is Universal
NOT X X’ X
X’
X
X X XY
AND XY
Y Y
X X (X’.Y’)’ = X+Y
OR X+Y
Y Y
•Therefore, we can build all functions we learned so far using NAND gates
ONLY (Exercise: Prove that NOT can be built with NAND)
•NAND is a UNIVERSAL gate
Graphic Symbols for NAND Gate
Two equivalent graphic X
symbols or shapes for the AND-NOT Y (XYZ)’
SAME function Z
X
NOT-OR X’+Y’+Z’ = (XYZ)’
Y
Z
AND-NOT = NOT-OR
Implementation using NANDs
Example: Consider F = AB + CD
NAND
A A
B B
F F
C C
D D
Proof:
NAND
F = ((AB)’.(CD)’)’
= ((AB)’)’ + ((CD)’)’
= AB + CD A
B F
C
D
Implementation using NANDs
Consider F =Σm(1,2,3,4,5,7) – Implement using NAND
gates X
Y’
Y=1 F
YZ X’
X 00 01 11 10 Y
0 1 1 1 Z
X=1 1 1 1 1
X
Z=1 Y’
F
X’
F(X,Y) = Z+XY’+X’Y Y
Z’
Rules for 2-Level NAND
Implementations
1. Simplify the function and express it in sum-of-products
form(SOP)
2. Draw a NAND gate for each product term (with 2 literals or
more)
3. Draw a single NAND gate at the 2nd level (in place of the OR
gate)
4. A term with single literal requires a NOT
X X (X’+Y’)’ = XY
AND XY
Y Y
X X (X+Y)’’ = X+Y
OR X+Y
Y Y
•Therefore, we can build all functions we learned so far using NOR gates ONLY
(Exercise: Prove that NOT can be built with NOR)
•NOR is a UNIVERSAL gate
Graphic Symbols for NOR Gate
Two equivalent graphic
symbols or shapes for the
X (X+Y+Z)’
SAME function
Y
OR-NOT
Z
X (X’Y’Z’)=(X+Y+Z)’
NOT-AND Y
Z
OR-NOT = NOT-AND
Implementation using NOR gates
Consider F = (A+B)(C+D)E
NOR
NOR
A A
B B
F F
C C
D D
E E’
Rules for 2-Level NOR
Implementations
1. Simplify the function and express it in product of sums
form (POS)
2. Draw a NOR gate (using OR-NOT symbol) for each sum term
(with 2 literals or more)
3. Draw a single NOR gate (using NOT-AND symbol) the 2nd
level (in place of the AND gate)
4. A term with single literal requires a NOT
Exclusive-NOR (XNOR)
◦ (xy)' = xy + x'y'
Some identities
◦ x0 = x
◦ x1 = x'
◦ xx = 0
◦ xx' = 1
◦ xy' = (xy)'
◦ x'y = (xy)'
Logic Synthesis
Timing verification confirms that the fabricated, integrated circuit will operate at a
specified speed. Because each logic gate in a circuit has a propagation delay, a
signal transition at the input of a circuit cannot immediately cause a change in the
logic value of the output of a circuit. Propagation delays ultimately limit the speed at
which a circuit can operate. Timing verification checks each signal path to verify that
it is not compromised by propagation delay
Module Declaration
Examples of keywords:
module, end-module, input, output, wire, and, or, and not
Example: timescale directive The first number specifies the unit of measurement for
◦ ‘timescale 1 ns/100ps time delays. The second number specifies the precision
for which the delays are rounded off, in this case to 0.1
ns. If no timescale is specified, a simulator may display
dimensionless values or default to a certain time unit,
usually 1 ns (=10-9 s) 1ps=10-12
HDL Example 3.2Gate-level description with propagation delays for
circuit shown in Fig. 3.37
HDL Example 3.3
In order to simulate a circuit with an HDL, it is necessary to apply inputs to the circuit
so that the simulator will generate an output response. An HDL description that
provides the stimulus to a design is called a test bench
In its simplest form, a test bench is a module containing a signal generator
Test bench for simulating the circuit with delay
Within the test
bench, the inputs
to the circuit are
declared with
keyword reg and
the outputs are
declared with the
keyword wire .
The module
Simple_Circuit_
prop_delay is
instantiated with
the instance
name M1.
Simulation output for HDL
Example 3.3
Boolean Expression
Boolean expression for the circuit of Fig. 3.37
Boolean equations describing combinational logic are specified in Verilog with a continuous
assignment statement consisting of the keyword assign followed by a Boolean expression.
Verilog uses the symbols (&), (|), and (~) for AND, OR, and NOT
(complement),respectively.
Boolean expression:
Declaration: