ECE 465 Sequential Multiplication Techniques

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

CMSC 611: Advanced Computer Architecture
ECE C03 Lecture 131 Lecture 13 VHDL Structural Modeling Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Fundamental Concepts 大同大學 資訊工程系 副教授
© 1998, Peter J. AshendenVHDL Quick Start1 Basic VHDL Concepts Interfaces Behavior Structure Test Benches Analysis, elaboration, simulation Synthesis.
Table 7.1 Verilog Operators.
ECE Synthesis & Verification - Lecture 2 1 ECE 667 Spring 2011 ECE 667 Spring 2011 Synthesis and Verification of Digital Circuits High-Level (Architectural)
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
ECE 353 Computer Systems Lab II VHDL AND LABORATORY TOOLS TUTORIAL Professors Maciej Ciesielski & T. Baird Soules.
Spring 20067W. Rhett Davis with minor modifications by Dean Brock ECE 406 at UNASlide 1 ECE 406 Design of Complex Digital Systems Lecture 10: 9: State.
Integer Square Root.
Discussed in class and on Fridays n FSMs (only synchronous, with asynchronous reset) –Moore –Mealy –Rabin-Scott n Generalized register: –With D FFs, –With.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 2 Microcomputer Systems Design (Embedded Systems)
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Flip-Flops and Registers
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
George Mason University ECE 545 – Introduction to VHDL ECE 545 Lecture 5 Finite State Machines.
CprE / ComS 583 Reconfigurable Computing
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Module 1.2 Introduction to Verilog
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
M. Balakrishnan Dept of Computer Science & Engg. I.I.T. Delhi
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
Finite state machines Modelling FSM in VHDL. Types of automata (FSM) A sequential automaton has: –Inputs –States (a finite number of states) –Outputs.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Introduction to ASIC flow and Verilog HDL
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
Digital System Design using VHDL
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
VHDL Project I: Serial Adder Matthew Murach Slides Available at:
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Hardware Description Languages: Verilog
Implementing Combinational
ECE 4110–5110 Digital System Design
Figure 8.1. The general form of a sequential circuit.
ECE 565 High-Level Synthesis—An Introduction
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Module Goals Introduce structural VHDL constructs Use of components
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Hardware Description Languages: Verilog
IAY 0600 Digital Systems Design
Sequential-Circuit Building Blocks
ECE 434 Advanced Digital System L13
VHDL VHSIC Hardware Description Language VHSIC
IAY 0600 Digital Systems Design
VHDL (VHSIC Hardware Description Language)
VHDL Discussion Subprograms
Module Goals Introduce structural VHDL constructs Use of components
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
VHDL Discussion Subprograms
IAS 0600 Digital Systems Design
Register-Transfer Level Components in Verilog
ECE 434 Advanced Digital System L11
Figure 8.1. The general form of a sequential circuit.
The Verilog Hardware Description Language
ECE 551: Digital System Design & Synthesis
Finite state machines Modelling FSM in VHDL.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Sequntial-Circuit Building Blocks
Presentation transcript:

ECE 465 Sequential Multiplication Techniques Shantanu Dutt ECE Dept. UIC

1001 = 9 1011 = 11 00000000 = P0 + 1001 00001001 = P1 + 1001 00011011 = P2 + 0000 00011011 = P3 + 1001 01100011 = P4 = P = 99

1001 = 9 1011 = 11 00000000 = P0 1001 10010000 SHR: 01001000 = P1 1001 11011000 SHR: 01101100 = P2 0000 01101100 SHR: 00110110 = P3 1001 11000110 SHR: 01100011 = P4 = P = 99

Regular A&S 2’s Complement Multiplication Example Multplicand Y = 11001101 = -51, Multiplier X = 01100111 = 103, -Y = 10110011= -77 Cout-AC-Q = 0| 00000000 | 01100111 M = 11001101 Iter 1: Q0 = 1, perform add AC+Y: 00000000 + 11001101 0 11001101 = Cout-AC No ovfl, ASR AC-Q: 11100110 | 10110011 Iter 2: Q0 = 1, perform add AC+Y: + 11001101 1 10110011 = Cout-AC No ovfl, ASR AC-Q: 11011001 | 11011001 Iter 3: Q0 = 1, perform add AC+Y: + 11001101 1 10100110 = Cout-AC No ovfl, ASR AC-Q: 11010011 | 01101100 Iter 4: Q0 = 0, only ASR AC-Q: 11101001 | 10110110 Iter 5: Q0 = 0, only ASR AC-Q: 11110100 | 11011011 Iter 6: Q0 = 1, perform add AC+Y: + 11001101 1 11000001 = Cout-AC No ovfl, ASR AC-Q: 11100000 | 11101101 Iter 7: Q0 = 1, perform add AC+Y: + 11001101 1 10101101 = Cout-AC No ovfl, ASR AC-Q: 11010110 | 11110110 Iter 8: Q0 = 0, only ASR AC-Q : 11101011 | 01111011 P = AC-Q = 1110101101111011 = -5253 = (-51) x 103. Needed to perform 5 +’s and 8 shifts

Regular A&S 2’s Complement Multiplication Example Multplicand Y = 01001101 = 77, Multiplier X = 11100111 = -25, -Y = 10110011= -77 Cout-AC-Q = 0| 00000000 | 11100111 M = 01001101 Iter 1: Q0 = 1, perform add AC+Y: 00000000 + 01001101 0 01001101 = Cout-AC No ovfl, ASR AC-Q: 00100110 | 11110011 Iter 2: Q0 = 1, perform add AC+Y: + 01001101 0 01110011 = Cout-AC No ovfl, ASR AC-Q: 00111001 | 11111001 Iter 3: Q0 = 1, perform add AC+Y: + 01001101 0 10000110 = Cout-AC Ovfl, SR Cout-AC-Q: 01000011 | 01111100 Iter 4: Q0 = 0, only ASR AC-Q: 00100001 | 10111110 Iter 5: Q0 = 0, only ASR AC-Q: 00010000 | 11011111 Iter 6: Q0 = 1, perform add AC+Y: + 01001101 0 01011101 = Cout-AC No ovfl, ASR AC-Q: 00101110 | 11101111 Iter 7: Q = 1, perform add AC+Y: + 01001101 0 01111011 = Cout-AC No ovfl, ASR AC-Q: 00111101 | 11110111 Iter 8: Q = 1, perform sub AC-Y: +10110011 0 11110000 = Cout-AC No ovfl, ASR AC-Q: 11111000 | 01111011 P = AC-Q = 1111100001111011 = -1925 = 77 x (-25). Needed to perform 6 +/- and 8 shifts

Cin inv_sign (from CU) Cout reg. sign of xi*Y “essentially” (considering Cin value) inverted when inv_sign=1

001000

Booth Multiplication Example Multplicand Y = 01001101 = 77, Multiplier X = 11100111 = -25, -Y = 10110011= -77 Cout-AC-Q-q- = 0| 00000000 | 11100111 | 0 M = 01001101 (q- is the “prev” bit of Q) Iter 1: q0-q- = 10, perform sub AC-Y: 00000000 + 10110011 0 10110011 = Cout-AC No ovfl, ASR AC-Q-q-: 11011001 | 11110011 | 1 Iter 2: q0-q- = 11, only ASR AC-Q-q-: 11101100 | 11111001 | 1 Iter 3: q0-q- = 11, only ASR AC-Q-q-: 11110110 | 01111100 | 1 Iter 4: q0-q- = 01, perform add AC+Y: +01001101 1 01000011 = Cout-AC No ovfl, ASR AC-Q-q-: 00100001 | 10111110 | 0 Iter 5: q0-q- = 00, only ASR AC-Q-q-: 00010000 | 11011111 | 0 Iter 6: q0-q- = 10, perform sub AC-Y:+ 10110011 0 11000011 = Cout-AC No ovfl, ASR AC-Q-q-: 11100001 | 11101111 | 1 Iter 7: q0-q- = 11, only ASR AC-Q-q-: 11110000 | 11110111 | 1 Iter 8: q0-q- = 11, only ASR AC-Q-q-: 11111000 | 01111011 | 1 P = AC-Q = 1111100001111011 = -1925 = 77 x (-25) Needed only 3 +/-’s as opposed to 6 +/-’s needed in regular A&S mult. # of shifts remain the same (8)

Structural VHDL allows the designer to represent a system in terms of components and their interconnections. This module discusses the constructs available in VHDL to facilitate structural descriptions of designs. Acknowledgement (this and next 3 slides): http://www.people.vcu.edu/~rhklenke/tutorials/vhdl/modules/m11_23/sld001.htm. The next 3 slides appear in sld037.htm to sld039.htm of this module.

: Structural Description Control signals (from the CU) : Structural Description The final example is of an RTL level datapath for an unsigned 8 bit multiplier. It illustrates the use of complex components in a structural description and the use of multiple levels of hierarchy in that the components are themselves structural descriptions of lower level components. This is the entity description for the datapath. The register controls (enable, mode) will go to the control unit when it is added.

This shows the component declarations and binding indications for the datapath.

It should have been possible (we believe) to use the syntax scan_out => OPEN, This is the component instantiations for the datapath. The mapping of individual bits of the D and Q input and output of the shift registers is necessary to reverse the inputs and outputs. Recall that the shift register was a “shift up” type where the scan_in input goes to D(0) and D(0) to D(6) go to D(1) to D(7) when in shift mode. What is needed for the multiplier is a “shift down” type register where scan_in goes to D(7), etc. It should have been possible (we believe) to use the syntax d => multiplier(0 to 7) in the shift_reg8_str PORT MAP to accomplish the same thing, but the QuickVHDL compiler gave a “warning” and the simulator crashed, so we don’t know if it really should work.

Acknowledgement (this and next 7 slides): http://www. people. vcu The next 7 slides appear in sld050.htm to sld056.htm of this module.

: Behavioral Description Now we are going to develop a behavioral description of the controller for the unsigned 8 bit multiplier. This is a flow chart of the algorithm that the controller uses.

This is state diagram of the controller state machine This is state diagram of the controller state machine. The outputs for each state aren’t shown for clarity. Notice that there is also a “count” variable that must be included in the state machine to count the number of iterations through the loop. The count variable is actually implemented as another state variable.

The state machine actually has two state variables, the current state of the control state machine (e.g., initialize, shift, add), and the present loop count. The loop count is a state variable in that it has a present value and a next value, and it is updated in the clock process. However, the value of count only affects the next control state the machine goes to and doesn’t affect the outputs. The implementation is actually more like two state machines in the same architecture.

Control signals (from the CU) This the entity description for the unsigned 8 bit multiplier control unit. It hooks to the datapath via the control signals listed.

This is the beginning of the architecture of the control unit This is the beginning of the architecture of the control unit. Note that the constrained subtype of integer is for synthesis - unconstrained integers are hard to synthesize! Also note the state variables are enumerated types. This allows the synthesis tools to encode the state variable using different schemes. Also included here is the clock process. Note that it is edge triggered and that both present_state and present_count are updated on the clock edge. Also note the asynchronous reset signal.

This is the state transition process for the state machine This is the state transition process for the state machine. Note the default assignment of next_state = present_state which is only really required for (some) synthesis tools.

Reset active low x_enable = 1 allows reg. x to be loaded w/ its i/ps: inp. bus or shift inp. x_mode = 1 load x from inp. bus x_mode = 0 shift inp. This is the output process. Note that the outputs are only dependent on the present_state variable (Moore machine).