The following will be discussed in this chapter: Programmable logic array, K-map minimization, PLA minimizatio, main computation unit in most computer systems, ALUs perform a variety of different functions, individual chips can be chained together to make larger ALUs, build a data and control path.
Trang 1Lecture 31 PLAs and Arithmetic Logic Unit (ALU)
Trang 2Programmable Logic Array
° A ROM is potentially inefficient because it uses a
decoder, which generates all possible minterms
No circuit minimization is done.
° Using a ROM to implement an n-input function
° A programmable logic array, or PLA, makes the
decoder part of the ROM “programmable” too
Instead of generating all minterms, you can choose which products (not necessarily minterms) to
generate.
Trang 3° The left part of the
diagram replaces the
decoder used in a
ROM.
° Connections can be
made in the “AND
array” to produce four
OR array
Trang 4K-map minimization
° The normal K-map approach is to minimize the
number of product terms for each individual
function.
° For our three functions, this would result in a total
of six different product terms.
Trang 5PLA minimizatio
° For a PLA, we should minimize the number of
product terms for all functions together.
° We could express V 2 , V 1 and V 0 with just four total
Trang 7Summary
° ROMs provide stable storage for data
° ROMs have address inputs and data outputs
• ROMs directly implement truth tables
° ROMs can be used effectively in Mealy and Moore machines
to implement combinational logic
° In normal use ROMs are read-only
• They are only read, not written
° ROMs are often used by computers to store critical
information
• Unlike SRAM, they maintain their storage after the power is turned off
° ROMs and PLAs are programmable devices that can
implement arbitrary functions, which is equivalent to acting
as a read-only memory.
• ROMs are simpler to program, but contain more gates.
• PLAs use less hardware, but it requires some effort to minimize a set of
functions Also, the number of AND gates available can limit the number of expressible functions.
Trang 9w
° Main computation unit in most computer systems
° ALUs perform a variety of different functions
• Add, subtract, OR, AND…
° Example: ALU chip (74LS382)
• Has data and control inputs
° Individual chips can be chained together to make larger
ALUs
° ALUs are important parts of datapaths
• ROMs often are used in the control path
° Build a data and control path
Trang 10Arithmetic Logic Unit
° Arithmetic logic unit
functions
• Two multi-bit data inputs
• Function indicates action
(e.g add, subtract, OR…)
° DataOut is same bit
width as multi-bit inputs
(DataA and DataB)
DataOut
Think of ALU as a number of other arithmetic and logic blocks in a single box! Function selects the block
Adder Subtract
AND
…
Trang 11ALU Integrated Circuit
° Integrated circuit – off-the-shelf components
° Examine the functionality of this ALU chip
Performs 8 functions
Trang 12° Change the select code to 101 and repeat.
• Function code indicates OR
Trang 13° Multi-bit ALU created by connecting carry output of
low-order chip to carry in of high order
Eight-bit ALU formed from 2 four-bit ALUs
Trang 14Otherwise Out open-circuit
Load Clk
Trang 15Computation in a Typical
Computer
° Control logic often implemented as a finite state
machine (including ROMs)
° Datapath contains blocks such as ALUs, registers,
tri-state buffers, and RAMs
° In a processor chip often a 5 to 1 ratio of datapath to
control logic
Trang 16Using a Datapath
° Consider the following computation steps
1 ADD A, B and put result in A
2 Subtract A, B and put result in B
3 OR A, B put result in A
• Repeat starting from step 1
Determine values for Function, LoadA, LoadB
Function
LoadA
ALU
Trang 17Modeling Control as a State
Machine
° Consider the following computation steps
1 ADD A, B and put result in A
2 Subtract A, B and put result in B
3 OR A, B put result in A
• Repeat starting from step 1
Determine values for Function, LoadA, LoadB
Model control as a state machine.
Determine control outputs for each state
Trang 18Modeling Control as a State
Machine
° Consider the following computation steps
1 ADD A, B and put result in A
2 Subtract A, B and put result in B
3 OR A, B put result in A
• Repeat starting from step 1
States
S0 = 00 S1 = 01 S2 = 10
Present State Next State Function LoadA LoadB
00 01 011 1 0
01 10 010 0 1
10 00 101 1 0
We know how to implement this using an SOP.
Can we use a ROM?
Trang 19Present State Next State Function LoadA LoadB
Function, LoadA, LoadB
Note: No minimization!
One line in ROM for each state
Trang 20Putting the Control and Datapath
Trang 21Possible to implement different functions!
Program the RAM to perform different sequences
Looks like software!
Trang 22• Remember to connect carry out to carry in
° ALUs form the basis of datapaths
° ROMs can form the basis of control paths
° Combine the two together to build a computing circuit
Trang 2323
Trang 24DLD Simulators
° Circuit Maker 2000
° MultiSim
° Electronic Workbench
Trang 25CircuitMaker Workspace
Trang 26° An important feature of CircuitMaker is the way electrical
connections between the elements in your design are recognized.
° The concept of connectivity is the key to using CircuitMaker to
draw and simulate electronic circuits The program stores
connection information for simulation, and it is also used for
creating and exporting netlists into TraxMaker or other pcb layout programs to create a working printed circuit board (PCB).
CircuitMaker sections :
• Schematic Window
• Analysis Window
• Panel
° Schematic window is where the schematics are drawn One
circuit file at a time can be opened into this window
° Analysis Window is where the simulation results are
° Panel has tabs across the top which are used to select controls
which are relevant to the available displayed
Trang 27Anatomy of a Schematic Drawing
Schematic, including device symbols, label-values and designations, wires, and pin dots
Trang 28CktMaker Conventions
° CKT Schematic (or Circuit) files
° DAT Data files (Hotkeys; device library
classifications)
° LIB Device library files
° MOD Model files
° SUB Subcircuit files
° SDF Waveform display setup files
Trang 29CktMaker Toolbar
Trang 30Drawing a Schematic
° Using the Browse tab in the Panel
° Selecting a transistor
° Selecting resistors
° Selecting a +V and ground device
° Changing resistor and transistor label
values
° Wiring the circuit
Trang 313 Position the transistor at about mid-screen and then click the left mouse button once.
Trang 32Placing the Resistors
The next procedure involves placing two resistors.
1 Select a Resistor [Passive
Components/Resistors/Resistor] (r) by pressing the r Hotkey
on the keyboard Notice that the resistor is oriented
horizontally and moves around the screen with the mouse.
2 Press the r key again (or click the Right mouse button) to rotate the device 90°.
3 Drag the resistor above and to the left of the transistor and click the Left mouse button once to place it This is resistor R1 Don’t worry about the value yet.
4 Place a second resistor directly above the transistor This
is resistor R2.
Trang 33Placing +V and Ground Devices
Now you.’ll place a voltage
source and change its
settings.
1Select a +V
[.General/Sources/+V] (1) by
pressing the 1 (number one)
Hotkey Place it above
resistor R2.
2Select a Ground
[.General/Sources/Ground]
(0) by pressing the 0 (zero)
Hotkey Place it below the
transistor.
3 Double-click the +V
device using the Left
mouse button to open the
Device Properties dialog box
Trang 34Placing +V and Ground Devices
4 Change the Label-Value field to
read +15V.
5 Click once on the topmost Visible
check box This causes the +V name
to be hidden on the schematic.
6 Click once on the third Visible
check box from the top This causes
the V1 designation to be hidden on
the schematic Click OK.
Changing Resistor Label-Values
1 Double-click resistor R1
2 Change the Label-Value field to
read 220k, then click OK.
3 Double-click resistor R2.
4 Change the Label-Value field to
Trang 35Wiring the Circuit Together
1 Select the Wire Tool from the Toolbar.
2 Place the cursor on the emitter pin of the transistor (the pin with the arrow.) When the cursor gets close to the pin, a small rectangle appears.
3 Click and hold the left mouse button, then drag the wire to the pin
of the Ground symbol.
4 Release the mouse button to make the connection.
5 Place the cursor on the bottom pin of R2, and then click and hold the mouse button to start a new wire.
6 Drag the end of the wire to the collector pin of the transistor and release the mouse button.
7 Connect a wire from the top pin of R2 to +15V.
8 Connect another wire from the bottom pin of R1 to the base of
the transistor.
9 Finally, connect a wire from the top pin of R1 to the middle of the wire which connects +15V to R2.
Trang 36Digital Logic Simulation
1 Click the Open button in the Toolbar.
2 Select the SIM.CKT file from the list of available circuits The SIM.CKT circuit
contains several mini-circuits and is useful for demonstrating CircuitMaker.’s
digital simulation features.
3 Click the Run button on the Toolbar to start simulation You know that
simulation is running when you see a Hex Display showing a count sequence.
4 Select the Probe Tool from the Toolbar and touch its tip to the wire just to the left of the label “Probe Wire to the Left ” The letter L will be displayed in the
Probe Tool.
5 Move the tip of the Probe Tool to the Logic Switch labeled “Toggle Switch.” and click near its center The Logic Display connected to the output of this minicircuit should then start to toggle on and off rapidly.
6 Click the Horizontal Split button on the Toolbar to open the digital Waveforms window Each node in the circuit that has a SCOPE device attached is charted in this window.
7 Select Simulation > Active Probe, then run the simulation again A new
waveform called Probe displays in the Waveforms window Watch what happens to this waveform as you move the Probe Tool around the circuit.
8 Click the Trace button in the Toolbar to see the state of every wire in the circuit
as the state changes A red wire indicates a high state, a blue wire indicates a low
Trang 37Demo with examples