1 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example Example: (101 x 011) Base 2 Note that the partial product summation.

Slides:



Advertisements
Similar presentations
Register Transfer Level
Advertisements

1ASM Algorithmic State Machines (ASM) part 1. ASM2 Algorithmic State Machine (ASM) ‏ Our design methodologies do not scale well to real-world problems.
Functions and Functional Blocks
Give qualifications of instructors: DAP
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 9 Programmable Configurations Read Only Memory (ROM) – –a fixed array of AND gates.
Circuits require memory to store intermediate data
EKT 221 : Digital 2 ASM.
Overview Datapath and Control Algorithmic State Machines (ASM)
Chapter 8 Sequencing and Control Henry Hexmoor1. 2 Datapath versus Control unit  Datapath - performs data transfer and processing operations  Control.
The Control Unit: Sequencing the Processor Control Unit: –provides control signals that activate the various microoperations in the datapath the select.
1 COMP541 Sequencing and Control Montek Singh Mar 29, 2007.
Ch 8 - Control Unit and Algorithmic State Machines
Give qualifications of instructors: DAP
Logic and Computer Design Fundamentals Registers and Counters
Contemporary Logic Design Arithmetic Circuits © R.H. Katz Lecture #24: Arithmetic Circuits -1 Arithmetic Circuits (Part II) Randy H. Katz University of.
Sequencing and Control Mano and Kime Sections 8-1 – 8-7.
Chapter 8 -- Analysis and Synthesis of Synchronous Sequential Circuits.
Chapter 7 - Part 2 1 CPEN Digital System Design Chapter 7 – Registers and Register Transfers Part 2 – Counters, Register Cells, Buses, & Serial Operations.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 20 Datapath and Control Datapath - performs data transfer and processing operations.
KU College of Engineering Elec 204: Digital Systems Design
Registers and Counters
Chapter 1_4 Part II Counters
ENG241 Digital Design Week #10 Sequencing and Control.
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
CHAPTER 12 REGISTERS AND COUNTERS
Chapter 6-2 Multiplier Multiplier Next Lecture Divider
Circuit, State Diagram, State Table
CoE3DJ4 Digital Systems Design Register transfers, sequencing and control (from chapters 7 and 8 of Mano and Kime)
Rabie A. Ramadan Lecture 3
Chap 8. Sequencing and Control. 8.1 Introduction Binary information in a digital computer –data manipulated in a datapath with ALUs, registers, multiplexers,
EKT 221/4 DIGITAL ELECTRONICS II  Registers, Micro-operations and Implementations - Part3.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Logic and Computer Design.
Chapter 8 -- Analysis and Synthesis of Synchronous Sequential Circuits.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 11 Binary Adder/Subtractor.
Chap 7. Register Transfers and Datapaths. 7.1 Datapaths and Operations Two types of modules of digital systems –Datapath perform data-processing operations.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Digital Logic Design.
EKT 221/4 DIGITAL ELECTRONICS II Chapter 2 SEQUENCING AND CONTROL.
CHAPTER 6 Sequential Circuits’ Analysis CHAPTER 6 Sequential Circuits’ Analysis Sichuan University Software College.
Algorithmic state machines
Datapath - performs data transfer and processing operations The control unit sends: – Control signals – Control outputs The control unit receives: – External.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Chapter 8 -- Analysis and Synthesis of Synchronous Sequential Circuits.
Chapter 8 Solving Larger Sequential Problems.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 23 Introduction Computer Specification –Instruction Set Architecture (ISA) - the specification.
Processor Organization and Architecture Module III.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
Design at the Register Transfer Level Algorithmic State Machines 07.
 Designing CU – One FF per State Method  5 Transformation Rules  Transformation Process  Microprogrammed Control Unit.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Winter 2017 S. Areibi School of Engineering University of Guelph
EKT 221 : DIGITAL 2.
Prof. Sin-Min Lee Department of Computer Science
Figure 8.1. The general form of a sequential circuit.
Chap 7. Register Transfers and Datapaths
EKT 221 – Counters.
EKT 221 : Digital 2 COUNTERS.
KU College of Engineering Elec 204: Digital Systems Design
KU College of Engineering Elec 204: Digital Systems Design
Overview Datapath and Control Algorithmic State Machines (ASM)
ECE 434 Advanced Digital System L13
Unsigned Multiplication
ENG2410 Digital Design “Sequencing and Control Examples”
Lecture 26 – Hardwired and Microprogrammed Control
REGISTER TRANSFER LEVEL (RTL) DESIGN Using ASM CHART
KU College of Engineering Elec 204: Digital Systems Design
Binary Adder/Subtractor
CSE 370 – Winter Sequential Logic-2 - 1
Presentation transcript:

1 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example Example: (101 x 011) Base 2 Note that the partial product summation for n digits, base 2 numbers requires adding up to n digits (with carries) in a column. Note also n x m digit multiply generates up to an m + n digit result (same as decimal).  Partial products are: 101 x 0, 101 x 1, and 101 x 1

2 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Example (1 0 1) x (0 1 1) Again Reorganizing example to follow hardware algorithm: 101 x Clear C || A Multipler 0 = 1 => Add B Addition Shift Right (Zero-fill C) Multipler 1 = 1 => Add B Addition Shift Right Multipler 2 = 0 => No Add, Shift Right

3 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: Block Diagram C out n n n Counter P Zero detect Control unit G (Go) log 2 n Q o Z Parallel adder Multiplicand Register B Shift register A 0 CShift register Q Multiplier Product OUT IN Control signals n nn 4

4 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplexer Example: Operation 1.The multiplicand (top operand) is loaded into register B. 2.The multiplier (bottom operand) is loaded into register Q. 3.Register C|| A is initialized to 0 when G becomes 1. 4.The partial products are formed in register C||A||Q. 5.Each multiplier bit, beginning with the LSB, is processed (if bit is 1, use adder to add B to partial product; if bit is 0, do nothing) 6.C||A||Q is shifted right using the shift register –Partial product bits fill vacant locations in Q as multiplier is shifted out –If overflow during addition, the outgoing carry is recovered from C during the right shift 7.Steps 5 and 6 are repeated until Counter P = 0 as detected by Zero detect. Counter P is initialized in step 4 to n – 1, n = number of bits in multiplier

5 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: ASM Chart 01 G IDLE MUL0 01 Z MUL1 01 0C ←0, A ← P ←P ← n –1 A ←A +B, C ←C out P ←P ←P – 1 C ← 0, C || A || Q ← sr C || A || Q, Q 0

6 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: ASM Chart (continued) Three states are employ using a combined Mealy - Moore output model: –IDLE - state in which: the outputs of the prior multiply is held until Q is loaded with the new multiplicand input G is used as the condition for starting the multiplication, and C, A, and P are initialized –MUL0 - state in which conditional addition is performed based on the value of Q 0. –MUL1 - state in which: right shift is performed to capture the partial product and position the next bit of the multiplier in Q 0 the terminal count of 0 for down counter P is used to sense completion or continuation of the multiply.

7 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: Control Signal Table Control Signals for BinaryMultiplier Block Diagram ModuleMicrooperation Control Signal Name Control Expression RegisterA:A ← 0InitializeG A ← A + BLoad MUL0 · Q C ||A Q srC ||A QShift_decMUL1 RegisterB:B ←INLoad_BLOADB Flip-FlopC: C ← 0Clear_CIDLE · G +MUL1 C ←C out Load— RegisterQ: Q ←INLoad_QLOADQ C ||A Q ← srC ||A QShift_dec— CounterP:P ←n – 1Initialize— P ← P – 1Shift_dec— IDLE · ←

8 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Signals are defined on a register basis LOADQ and LOADB are external signals controlled from the system using the multiplier and will not be considered a part of this design Note that many of the control signals are “reused” for different registers. These control signals are the “outputs” of the control unit With the outputs represented by the table, they can be removed from the ASM giving an ASM that represents only the sequencing (next state) behavior Multiplier Example: Control Table (continued)

9 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example - Sequencing Part of ASM 0 1 IDLE MUL MUL G Z

10 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Control Design Methods –The procedure from Chapter 6 –Procedure specializations that use a single signal to represent each state Sequence Register and Decoder –Sequence register with encoded states, e.g., 00, 01, 10, 11. –Decoder outputs produce “state” signals, e.g., 0001, 0010, 0100, One Flip-flop per State –Flip-flop outputs as “state” signals, e. g., 0001, 0010, 0100, Hardwired Control

11 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: Sequencer and Decoder Design Initially, use sequential circuit design techniques from Chapter 4. First, define: –States: IDLE, MUL0, MUL1 –Input Signals: G, Z, Q 0 ( Q 0 affects outputs, not next state) –Output Signals: Initialize, LOAD, Shift_Dec, Clear_C –State Transition Diagram (Use Sequencing ASM on Slide 22) –Output Function: Use Table on Slide 20 Second, find –State Assignments (two bits required) –We will use two state bits to encode the three state IDLE, MUL0, and MUL1.

12 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Assuming that state variables M1 and M0 are decoded into states, the next state part of the state table is: Multiplier Example: Sequencer and Decoder Design (continued)

13 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: Sequencer and Decoder Design (continued) Finding the equations for M1 and M0 is easier due to the decoded states: M1 = MUL0 M0 = IDLE · G + MUL1 · Z Note that since there are five variables, a K-map is harder to use, so we have directly written reduced equations. The output equations using the decoded states: Initialize = IDLE · G Load = MUL0 · Q 0 Clear_C = IDLE · G + MUL1 Shift_dec = MUL1

14 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: Sequencer and Decoder Design (continued) Doing multiple level optimization, extract IDLE · G: START = IDLE · G M1 = MUL0 M0 = START + MUL1 · Z Initialize = START Load = MUL0 · Q 0 Clear_C = START + MUL1 Shift_dec = MUL1 The resulting circuit using flip-flops, a decoder, and the above equations is given on the next slide.

15 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: Sequencer and Decoder Design (continued) IDLE MUL0 MUL1 Initialize Clear_C Shift_dec M 0 Load M 1 G Z Q 0 DECODER A0 A D C D C START

16 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 This method uses one flip-flop per state and a simple set of transformation rules to implement the circuit. The design starts with the ASM chart, and replaces 1.State Boxes with flip-flops, 2.Scalar Decision Boxes with a demultiplexer with 2 outputs, 3.Vector Decision Boxes with a (partial) demultiplexer 4.Junctions with an OR gate, and 5.Conditional Outputs with AND gates. Each is discussed detail below. –Figure 8-11 is the end result. One Flip-Flop per State

17 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 State Box Transformation Rules Each state box transforms to a D Flip-Flop Entry point is connected to the input. Exit point is connected to the Q output.

18 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Scalar Decision Box Transformation Rules Each Decision box transforms to a Demultiplexer Entry points are "Enable" inputs. The Condition is the "Select" input. Decoded Outputs are the Exit points.

19 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Vector Decision Box Transformation Rules Each Decision box transforms to a Demultiplexer Entry point is Enable inputs. The Conditions are the Select inputs. Demultiplexer Outputs are the Exit points. (Vector of Input Conditions) (Binary Vector Values) (Binary Vector Values) 10 X 1, X 0 X1X1 Entry Exit 0 Exit 1 X0X0 DEMUX EN A1A1 A0A0 D0D0 D2D2 D1D1 D3D3 Exit2 Exit 3

20 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Junction Transformation Rules Where two or more entry points join, connect the entry variables to an OR gate The Exit is the output of the OR gate

21 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Conditional Output Box Rules Entry point is Enable input. The Condition is the "Select" input. Demultiplexer Outputs are the Exit points. The Control OUTPUT is the same signal as the exit value.

22 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Multiplier Example: Flip-flop per State Design Logic Diagram D C IDLE D C MUL0 D C MUL1 Initialize Clear _C Load Shift_dec Clock Z Q G DEMUX D 0 D 1 A 0 EN 2 DEMUX D 0 D 1 A 0 EN START

23 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Speeding Up the Multiplier In processing each bit of the multiplier, the circuit visits states MUL0 and MUL1 in sequence. By redesigning the multiplier, is it possible to visit only a single state per bit processed?

24 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Speeding Up Multiply (continued) Examining the operations in MUL0 and MUL1: –In MUL0, a conditional add of B is performed, and –In MUL1, a right shift of C || A || Q in a shift register, the decrementing of P, and a test for P = 0 (on the old value of P) are all performed in MUL1 Any solution that uses one state must combine all of the operations listed into one state The operations involving P are already done in a single state, so are not a problem. The right shift, however, depends on the result of the conditional addition. So these two operations must be combined!

25 KU College of Engineering Elec 204: Digital Systems Design Lecture 21 Speeding Up Multiply (continued) By replacing the shift register with a combinational shifter and combining the adder and shifter, the states can be merged. The C-bit is no longer needed. In this case, Z and Q 0 have been made into a vector. This is not essential to the solution. The ASM chart => G IDLE MUL Z || Q 0 A || Q sr C out || (A +0) || Q A || Q sr C out || (A +0) || Q A || Q sr C out || (A +B) || Q A || Q sr C out || (A+B) || Q P P – 1 0A P n – 1