MorrisMano5e Chapter3
MorrisMano5e Chapter3
Gate-level minimization is the design task of finding an optimal gate-level implementation of the Boolean functions
describing a digital circuit.
This task is well understood, but is difficult to execute by manual methods when the logic has more than a few inputs.
Fortunately, computer-based logic synthesis tools can minimize a large set of Boolean equations efficiently and
quickly.
Nevertheless, it is important that a designer understand the underlying mathematical description and solution of the
problem
KARNAUGH MAPS
The map is redrawn in (b) to show the relationship between the squares and the two variables x and y .
The 0 and 1 marked in each row and column designate the values of variables.
4
There are eight minterms for three binary variables; therefore, the map consists of eight squares.
Note that the minterms are arranged, not in a binary sequence, but in a sequence similar to the Gray code.
The characteristic of this sequence is that only one bit changes in value from one adjacent column to the next.
5
00 01 11 10
0
1
00 01 11 10
0
1
6
00 01 11 10
0
1
00 01 11 10
0
1
7
00 01 11 10
0
1
8
00 01 11 10
0
1
00 01 11 10
0
1
9
10
00 01 11 10
0
1
11
00 01 11 10
0
1
00 01 11 10
0
1
12
00 01 11 10
0
1
13
00 01 11 10 00 01 11 10
0 0
1 1
00 01 11 10 00 01 11 10
0 0
1 1
14
00 01 11 10 00 01 11 10
0 0
1 1
15
16
17
00 01 11 10 00 01 11 10
0 0
1 1
18
19
00 01 11 10 00 01 11 10
20
21
22
23
24
25
Don’t Care Conditions
26
27
28
29
30
31
POS Simplification
32
F(A,B,C,D) = (0,1,2,5,8,9,10)
1 1 0 1
0 1 0 0
0 0 0 0
1 1 0 1
33
F(A,B,C,D) = (0,1,2,5,8,9,10)
1 1 0 1
0 1 0 0
0 0 0 0
1 1 0 1
34
F’ = AB + CD + BD’
By De Morgan’s
F = (A’+B’) (C’+D’)(B’+D)
35
36
37
Digital circuits are frequently constructed with NAND or NOR gates rather than with AND and OR gates.
NAND and NOR gates are easier to fabricate with electronic components and are the basic gates used in all IC digital
logic families.
Because of the prominence of NAND and NOR gates in the design of digital circuits, rules and procedures have been
developed for the conversion from Boolean functions given in terms of AND, OR, and NOT into equivalent NAND and
NOR logic diagrams.
The NAND gate is said to be a universal gate because any logic circuit can be implemented with it.
The logical operations of AND, OR, and complement can be obtained with NAND gates alone.
38
The NAND gate is said to be a universal gate because any logic circuit can be implemented with it.
The logical operations of AND, OR, and complement can be obtained with NAND gates alone.
39
A convenient way to implement a Boolean function with NAND gates is to obtain the simplified Boolean
function in terms of Boolean operators and then convert the function to NAND logic.
The conversion of an algebraic expression from AND, OR, and complement to NAND can be done by simple circuit
manipulation techniques that change AND–OR diagrams to NAND diagrams.
To facilitate the conversion to NAND logic, it is convenient to define an alternative graphic symbol for the gate.
40
The implementation of Boolean functions with NAND gates requires that the functions be in sum-of-products form.
To see the relationship between a sum-of-products expression and its equivalent NAND implementation, consider the logic
diagrams drawn to implement the function
F = AB + CD
F = ((AB)‘(CD)‘)‘ = AB + CD
41
The standard form of expressing Boolean functions results in a two-level implementation.
There are occasions, however, when the design of digital systems results in gating structures with three or more levels.
The most common procedure in the design of multilevel circuits is to express the Boolean function in terms of AND,
OR, and complement operations.
42
43
The NOR operation is the dual of the NAND operation. Therefore, all procedures and rules for NOR logic are the
duals of the corresponding procedures and rules developed for NAND logic.
The NOR gate is another universal gate that can be used to implement any Boolean function.
The implementation of the complement, OR, and AND operations with NOR gates is shown
44
The two graphic symbols for the mixed notation are shown in
The invert-AND symbol complements each input and then performs an AND operation.
The two symbols designate the same NOR operation and are logically identical because of DeMorgan’s theorem.
45
The transformation from the OR–AND diagram to a NOR diagram is achieved by changing
A single literal term going into the second-level gate must be complemented.
46
For converting a multilevel AND–OR diagram to an all-NOR diagram, we must convert
- each OR gate to an OR-invert symbol and
- each AND gate to an invert-AND symbol
47
The XOR is equal to 1 if x and y differ in value.
Exclusive-NOR (XNOR), also known as equivalence, performs the following Boolean operation:
Following identities apply to XOR XOR operation is both commutative and associative
48
The first NAND gate performs the operation (xy)’ = (x’ + y’).
49
The XOR operation with three or more variables can be converted into an ordinary Boolean function by replacing the XOR
symbol with its equivalent Boolean expression.
50
XOR functions are very useful in systems requiring error detection and correction codes.
A parity bit is used for the purpose of detecting errors during the transmission of binary information.
A parity bit is an extra bit included with a binary message to make the number of 1’s either odd or even.
The message, including the parity bit, is transmitted and then checked at the receiving end for errors.
An error is detected if the checked parity does not correspond with the one transmitted.
The circuit that generates the parity bit in the transmitter is called a parity generator.
The circuit that checks the parity in the receiver is called a parity Checker.
51
For even parity, the bit P must be generated to make
the total number of 1’s (including P ) even.
52
Since the information was transmitted with even parity, the
four bits received must have an even number of 1’s.
53
Manual methods for designing logic circuits are feasible only when the circuit is small.
For anything else (i.e., a practical circuit), designers use computer-based design tools.
Prototype integrated circuits are too expensive and time consuming to build, so all modern design tools rely
on a hardware description language to describe, design, and test a circuit in software before it is
manufactured.
A hardware description language (HDL) is a computer-based language that describes the hardware of digital
systems in a textual form.
It can be used to represent logic diagrams, truth tables, Boolean expressions, and complex abstractions of
the behavior of a digital system.
One way to view an HDL is to observe that it describes a relationship between signals that are the inputs to a
circuit and the signals that are the outputs of the circuit.
For example, an HDL description of an AND gate describes how the logic value of the gate’s output is
determined by the logic values of its inputs. 54
HDLs are used in several major steps in the design flow of an integrated circuit:
o design entry
o functional simulation or verification
o logic synthesis
o timing verification and
o fault simulation
Design entry creates an HDL-based description of the functionality that is to be implemented in hardware.
- The HDL model may also represent a partition of a larger circuit into smaller interconnected and
interacting functional units.
55
Logic simulation displays the behavior of a digital system through the use of a computer.
- A simulator interprets the HDL description and either produces readable output, such as a time-ordered
sequence of input and output signal values, or displays waveforms of the signals.
- The simulation of a circuit predicts how the hardware will behave before it is actually fabricated.
- Simulation detects functional errors in a design without having to physically create and operate the circuit.
- Errors that are detected during a simulation can be corrected by modifying the appropriate HDL statements.
- The stimulus (i.e., the logic values of the inputs to a circuit) that tests the functionality of the design is called
a test bench.
- Thus, to simulate a digital system, the design is first described in an HDL and then verified by simulating
the design and checking it with a test bench, which is also written in the HDL.
- An alternative and more complex approach relies on formal mathematical methods to prove that a circuit is
functionally correct.
- The netlist can be used to fabricate an integrated circuit or to lay out a printed circuit board with the
hardware counterparts of the gates in the list.
- Logic synthesis is similar to compiling a program in a conventional high-level language. The difference is
that, instead of producing an object code, logic synthesis produces a database describing the elements
and structure of a circuit.
- The database specifies how to fabricate a physical integrated circuit that implements in silicon the
functionality described by statements made in an HDL.
- Logic synthesis is based on formal exact procedures that implement digital circuits and addresses that part
of a digital design which can be automated with computer software.
The design of today’s large, complex circuits is made possible by logic synthesis software.
57
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.
- This step is done after logic synthesis specifies the actual devices that will compose a circuit and before the
circuit is released for production.
In VLSI circuit design, fault simulation compares the behavior of an ideal circuit with the behavior of a circuit
that contains a process-induced flaw.
- Dust and other particulates in the atmosphere of the clean room can cause a circuit to be fabricated with a
fault. A circuit with a fault will not exhibit the same functionality as a fault-free circuit.
- Fault simulation is used to identify input stimuli that can be used to reveal the difference between the faulty
circuit and the fault-free circuit.
Test patterns are used to test fabricated devices to ensure that only good devices are shipped to customer.
58
Companies that design integrated circuits use proprietary and public HDLs.
In the public domain, there are two standard HDLs that are supported by the IEEE: VHDL and Verilog.
VHDL is a Department of Defense–mandated language. (The V in VHDL stands for the first letter in VHSIC, an
acronym for very high-speed integrated circuit.)
Verilog began as a proprietary HDL of Cadence Design Systems, but Cadence transferred control of Verilog to a
consortium of companies and universities known as Open Verilog International (OVI) as a step leading to its
adoption as an IEEE standard.
Because Verilog is an easier language than VHDL to describe, learn, and use, we have chosen it for this course.
Our emphasis will be on the modeling, verification, and synthesis (both manual and automated) of Verilog
models of circuits having specified behavior.
The Verilog HDL was initially approved as a standard HDL in 1995; revised and enhanced versions of the
language were approved in 2001 and 2005.
59
The language reference manual for the Verilog HDL presents a syntax that describes precisely the constructs
that can be used in the language.
In particular, a Verilog model is composed of text using keywords, of which there are about 100.
Keywords are predefined lowercase identifiers that define the language constructs.
E.g. module, endmodule, input, output, wire, and, or, and not.
For clarity, keywords will be displayed in boldface in the text in all examples of code
Any text between two forward slashes ( // ) and the end of the line is interpreted as a comment and will have no
effect on a simulation using the model.
Multiline comments begin with / * and terminate with * /. Blank spaces are ignored, but they may not appear
within the text of a keyword, a user-specified identifier, an operator, or the representation of a number.
A module is the fundamental descriptive unit in the Verilog language. It is declared by the keyword module and
must always be terminated by the keyword endmodule. 60
Combinational logic can be described by a schematic connection of gates, or by a set of Boolean equations, or
by a truth table
o Identifiers are names given to modules, variables (e.g., a signal), and other elements of the language so
that they can be referenced in the design.
o Identifiers must start with an alphabetic character or an underscore, but they cannot start with a number.
61
The port list of a module is the interface between the module and its environment. In this example, the ports
are the inputs and outputs of the circuit.
keywords input and output specify which of the ports are inputs and which are outputs. Internal
connections are declared as wire.
Each gate instantiation consists of an optional name (such as G1, G2 , etc.) followed by the gate output and
inputs separated by commas and enclosed within parentheses.
Each statement must be terminated with a semicolon, but there is no semicolon after endmodule. 62
The terms declaration and instantiation are not same.
A Verilog module is declared. Its declaration specifies the input–output behaviour of the hardware it
represents.
Predefined primitives are not declared, as their definition is specified by the language, and cannot be
changed by user.
Primitives are used (i.e., instantiated), just as gates are used to populate a printed circuit board.
Once a module has been declared, it may be used (instantiated) within a design.
Note that Simple_Circuit is not a computational model like those developed in an ordinary programming
language:
The sequential ordering of the statements instantiating gates in the model has no significance and
does not specify a sequence of computations.
A Verilog model is a descriptive model. Simple_Circuit describes what primitives form a circuit and
how they are connected.
63
All physical circuits exhibit a propagation delay between the transition of an input and a resulting transition
of an output.
When an HDL model of a circuit is simulated, it is sometimes necessary to specify the amount of delay from
the input to the output of its gates.
In Verilog, the propagation delay of a gate is specified in terms of time units and by the symbol #.
The association of a time unit with physical time is made with the ` timescale compiler directive.
(Compiler directives start with the ( ` ) back quote, or grave accent, symbol.)
Such a directive is specified before the declaration of a module and applies to all numerical values of time in
the code that follows. An example of a timescale directive is ` timescale 1ns/100ps
The first number specifies the unit of measurement for 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,
64
usually 1ns (=10-9 s). Our examples will use only the default time unit.
If the circuit is simulated and the inputs change from
A , B , C = 0 to A , B , C = 1, the outputs change as shown
The output of the inverter at E changes from 1 to 0 after a 10-ns delay. The output of the AND gate at w1 changes
from 0 to 1 after a 30-ns delay.
The output of the OR gate at D changes from 1 to 0 at t = 30 ns and then changes back to 1 at t = 50 ns.
In both cases, the change in the output of the OR gate results from a change in its inputs 20 ns earlier. It is clear
from this result that although output D eventually returns to a final value of 1 after the input changes, the gate
65
delays produce a negative spike that lasts 20 ns before the final value is reached.
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.
66
In general, test bench is named with the prefix t_
concatenated with the name of the module that is to be
tested by the test bench, but that choice is left to the
designer.
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.
67
Hardware signal generators are not used to verify an HDL
model: The entire simulation exercise is done with software
models executing on a digital computer under the direction
of an HDL simulator.
68
The action specified by the statements begins when the
simulation is launched, and the statements are executed in
sequence, left to right, from top to bottom, by a simulator in
order to provide the input to the circuit.
After another 100 ns, the simulation terminates at time 200 ns.
69
The timing diagram of waveforms that result
from the simulation is shown below.
70
Boolean equations describing combinational logic are specified in Verilog with a continuous assignment statement
consisting of the keyword assign followed by a Boolean expression.
To distinguish arithmetic operators from logical operators, Verilog uses the symbols (&&), ( || ), and (!) for logical AND,
OR, and NOT (complement), respectively.
Example: Describe a circuit that is specified with the following two Boolean expressions:
E = A + BC + B’D
F = B’C + BC’D’
The equations specify how the logic values E and F are determined by the values of A, B, C, and D .
71
A digital circuit can be described with HDL statements, just as it can be drawn in a circuit diagram or specified
with a Boolean expression.
The logic gates used in Verilog descriptions with keywords and, or, etc., are defined by the system and are
referred to as system primitives. (Caution: Other languages may use these words differently .)
The user can create additional primitives by defining them in tabular form.
72
This example defines a UDP with a truth table.
75