Digital Logic Design - Lecture 31: PLAs and Arithmetic Logic Unit (ALU)

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.

ppt37 trang | Chia sẻ: dntpro1256 | Lượt xem: 655 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu Digital Logic Design - Lecture 31: PLAs and Arithmetic Logic Unit (ALU), để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
Lecture 31 PLAs and Arithmetic Logic Unit (ALU) Programmable Logic ArrayA 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 requires:An n-to-2n decoder, with n inverters and 2n n-input AND gates.An OR gate with up to 2n inputs.The number of gates roughly doubles for each additional ROM input.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.A blank 3 x 4 x 3 PLAThis is a 3 x 4 x 3 PLA (3 inputs, up to 4 product terms, and 3 outputs), ready to be programmed.The left part of the diagram replaces the decoder used in a ROM.Connections can be made in the “AND array” to produce four arbitrary products, instead of 8 minterms as with a ROM.Those products can then be summed together in the “OR array.”InputsOutputsAND arrayOR arrayK-map minimizationThe 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.V2 V1 V0V2 = m(1,2,3,4)V1 = m(2,6,7)V0 = m(4,6,7)PLA minimizatioFor a PLA, we should minimize the number of product terms for all functions together.We could express V2, V1 and V0 with just four total products:V2 = xy’z’ + x’z + x’yz’ V1 = x’yz’ + xy V0 = xy’z’ + xyV2 = m(1,2,3,4)V1 = m(2,6,7)V0 = m(4,6,7)PLA So we can implement these three functions using a 3 x 4 x 3 PLA:V2 = m(1,2,3,4)= xy’z’ + x’z + x’yz’V1 = m(2,6,7) = x’yz’ + xyV0 = m(4,6,7) = xy’z’ + xySummaryROMs provide stable storage for dataROMs have address inputs and data outputsROMs directly implement truth tablesROMs can be used effectively in Mealy and Moore machines to implement combinational logicIn normal use ROMs are read-onlyThey are only read, not writtenROMs are often used by computers to store critical informationUnlike SRAM, they maintain their storage after the power is turned offROMs 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.OverviewMain computation unit in most computer systemsALUs perform a variety of different functionsAdd, subtract, OR, ANDExample: ALU chip (74LS382)Has data and control inputsIndividual chips can be chained together to make larger ALUsALUs are important parts of datapathsROMs often are used in the control pathBuild a data and control pathArithmetic Logic UnitArithmetic logic unit functionsTwo multi-bit data inputsFunction indicates action (e.g. add, subtract, OR)DataOut is same bit width as multi-bit inputs (DataA and DataB)ALU is combinationalConditions indicate special conditions of arithmetic activity (e.g. overflow).ALUFunctionConditionsDataADataBDataOutThink of ALU as a number of other arithmetic and logic blocks in a single box! Function selects the blockAdderSubtractANDALU Integrated CircuitIntegrated circuit – off-the-shelf componentsExamine the functionality of this ALU chipPerforms 8 functionsExampleDetermine the 74HC382 ALU outputs for the following inputs: S2S1S0=010, A3A2A1A0=0100, B3B2B1B0=0001, and CN=1.Function code indicates subtract0100 – 0001 = 0011Change the select code to 101 and repeat.Function code indicates OR0100 OR 0001 = 0101ALUFunctionConditionsDataADataBDataOutSynchronize ALUwith a clockExpanding the ALUMulti-bit ALU created by connecting carry output of low-order chip to carry in of high orderEight-bit ALU formed from 2 four-bit ALUsDatapath components Tri-state bufferLoadable registerInOutEnableIf Enable asserted, Out = InOtherwise Out open-circuitLoadClkData stored on rising edge if Load is asserted (e.g. Load = 1)Computation in a Typical ComputerControl logic often implemented as a finite state machine (including ROMs)Datapath contains blocks such as ALUs, registers, tri-state buffers, and RAMsIn a processor chip often a 5 to 1 ratio of datapath to control logicUsing a DatapathConsider the following computation stepsADD A, B and put result in ASubtract A, B and put result in BOR A, B put result in ARepeat starting from step 1Determine valuesfor Function, LoadA, LoadBFunctionABLoadBLoadAALUModeling Control as a State MachineConsider the following computation stepsADD A, B and put result in ASubtract A, B and put result in BOR A, B put result in ARepeat starting from step 1Determine valuesfor Function, LoadA, LoadBS0S1S2Model control as a state machine.Determine control outputs for each state Modeling Control as a State MachineConsider the following computation stepsADD A, B and put result in ASubtract A, B and put result in BOR A, B put result in ARepeat starting from step 1StatesS0 = 00S1 = 01S2 = 10Present 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?ROM Implementation of State MachineStatesS0 = 00S1 = 01S2 = 10Present State Next State Function LoadA LoadB 00 01 011 1 0 01 10 010 0 1 10 00 101 1 0 PSNS010111010010010010110000110ROMFunction, LoadA, LoadBNote: No minimization!One line in ROM for each statePutting the Control and Datapath TogetherPSNS010111010010010010110000110ROMFunctionLoadAABLoadBALU3What if we replaced the ROM with RAM?PSNS010111010010010010110000110RAMFunctionLoadAABLoadBALU3Possible to implement different functions!Program the RAM to perform different sequencesLooks like software!SummaryALU circuit can perform many functionsCombinational circuitALU chips can be combined together to form larger ALU chipsRemember to connect carry out to carry inALUs form the basis of datapathsROMs can form the basis of control pathsCombine the two together to build a computing circuitDLD SimulatorsCircuit Maker 2000MultiSimElectronic WorkbenchCircuitMaker WorkspaceConnectivityAn 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 WindowAnalysis WindowPanel 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 displayedAnatomy of a Schematic Drawing Schematic, including device symbols, label-values and designations, wires, and pin dotsCktMaker 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 filesCktMaker ToolbarDrawing a SchematicUsing the Browse tab in the PanelSelecting a transistorSelecting resistorsSelecting a +V and ground deviceChanging resistor and transistor label valuesWiring the circuitPlacing a Transistor Begin the circuit by selecting the 2N2222A transistor [.General/BJTs/NPN Trans].1 Select .General / BJTs / NPN Trans:C in the Browse tree. Select the 2N2222A transistor in the Model list.2 Click Place to select this device from the library. You can also click the Search tab on the Panel, type 2n2222a , and click Find to quickly find the part.3 Position the transistor at about mid-screen and then click the left mouse button once.Placing the ResistorsThe 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.Placing +V and Ground DevicesNow you.’ll place a voltage source and change its settings.Select a +V [.General/Sources/+V] (1) by pressing the 1 (number one) Hotkey. Place it above resistor R2.Select 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 boxPlacing +V and Ground Devices4 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-Values1 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 read 870k, then click OK.Wiring the Circuit Together1 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.Digital Logic Simulation1 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 state.9 Click the Pause button in the Toolbar to stop simulation.Demo with examples

Các file đính kèm theo tài liệu này:

  • pptdigital_logic_design_eee241_30_4555_2055522.ppt
Tài liệu liên quan