EXPERIMENT Bit Binary Sequential Multiplier

Similar documents
EXPERIMENT Traffic Light Controller

Design at the Register Transfer Level

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Stop Watch (System Controller Approach)

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

CHW 261: Logic Design

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

Logic Design II (17.342) Spring Lecture Outline

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

Preparation of Examination Questions and Exercises: Solutions

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

ECE 341. Lecture # 3

EECS150 - Digital Design Lecture 23 - FSMs & Counters

ELEN Electronique numérique

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

The Design Procedure. Output Equation Determination - Derive output equations from the state table

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

Digital Fundamentals

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Digital Circuits ECS 371

Register Transfer Level

Ch 9. Sequential Logic Technologies. IX - Sequential Logic Technology Contemporary Logic Design 1

EECS150 - Digital Design Lecture 16 Counters. Announcements

課程名稱 : 數位邏輯設計 P-1/ /6/11

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Exam for Physics 4051, October 31, 2008

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Digital Design through Arduino

Design of Sequential Circuits

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Digital Electronics Final Examination. Part A

Shift Register Counters

CprE 281: Digital Logic

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

Digital Electronics Circuits 2017

Counters. We ll look at different kinds of counters and discuss how to build them

Finite State Machine (FSM)

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Example: vending machine

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

EE 209 Logic Cumulative Exam Name:

Digital Fundamentals

Models for representing sequential circuits

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

ECE 448 Lecture 6. Finite State Machines. State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code. George Mason University

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Digital Electronic Meters

Synchronous Sequential Circuit Design. Digital Computer Design

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

ALU, Latches and Flip-Flops

EEE2135 Digital Logic Design

CSE140: Design of Sequential Logic

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

PGT104 Digital Electronics. PGT104 Digital Electronics

Sequential logic and design

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

CHW 261: Logic Design

Design of Datapath Controllers

Table of Content. Chapter 11 Dedicated Microprocessors Page 1 of 25

Philadelphia University Student Name: Student Number:

Digital Design through Pi

Sample Test Paper - I

Laboratory Exercise #11 A Simple Digital Combination Lock

Lecture 10: Synchronous Sequential Circuits Design

FSM model for sequential circuits

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

Chapter 6. Synchronous Sequential Circuits


Digital Electronics. Part A

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

Adders, subtractors comparators, multipliers and other ALU elements

UNIVERSITY OF WISCONSIN MADISON

Q: Examine the relationship between X and the Next state. How would you describe this circuit? A: An inverter which is synched with a clock signal.

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

COE 328 Final Exam 2008

Philadelphia University Student Name: Student Number:

Carry Look Ahead Adders

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

DE58/DC58 LOGIC DESIGN DEC 2014

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Random Number Generator Digital Design - Demo

CSE 320: Spartan3 I/O Peripheral Testing

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

(Boolean Algebra, combinational circuits) (Binary Codes and -arithmetics)

Transcription:

12.1 Objectives EXPERIMENT 12 12. -Bit Binary Sequential Multiplier Introduction of large digital system design, i.e. data path and control path. To apply the above concepts to the design of a sequential multiplier. 12.2 Introduction: Design of Large Digital Systems Large and medium size digital systems are mostly sequential systems with large number of registers and counters. It is not practical to design such systems using FSM design techniques since this will result in a huge number of states (2 n, with n being the number of Flip-Flops (FF) including FFs used in all the registers and counters of the system). Generally, large digital systems are partitioned into two units: Data Path: This is the data processing unit. It includes both combinational and sequential modules of well-defined functions, e.g. registers, counters, adders, multiplexers, decoders, etc. Control Path: This is the control unit or simply controller which controls the operations performed by the data path and the proper sequencing of these operations. The controller is implemented as an FSM that may be designed in the conventional manner. In this lab, you will design the data path and controller of a -bit sequential multiplier. The design can be easily extended to an n-bit multiplier which uses the same controller and the same data path configuration but sizes of data path components (e.g. registers, and adder) should be adjusted accordingly. 12.3 Design Specifications Inputs: Multiplier: First -Bit operand (A). Multiplicand: Second -Bit operand (B). Reset: Reset signal which puts the controller into the initial state. Outputs: P: The 8-bit product result (P = A x B). Display: P: Displayed using 7-segment display digits. Cnt: The current counter content on one of the 7-segment display digits. Control Signals: Displayed using LED s.

12-2 Approach: The block diagram of the sequential multiplier is shown in Figure 12.1. Multiplier (A) Multiplicand (B) Data Path 8 Product (P) Control Signals Status (Branching) Information Start (S) Controller Reset Figure 12.1: Block Diagram of Sequential Multiplier. As in hand multiplication, we multiply the bits of the multiplier A (a 3 a 2 a 1 a 0 ) by the multiplicand (B) starting from the LSB (a 0 ) to the MSB (a 3 ). This forms four partial products a 0 B, a 1 B, a 2 B, and a 3 B. The resulting partial products are added with each product shifted lefts by one bit position from its predecessor as shown in Figure 12.2. 2 nd. Partial Product (a 1 B) 1 st. Partial Product (a 0 B) 3 rd. Partial Product (a 2 B) th. Partial Product (a 3 B) a 0 b 3 a 0 b 2 a 0 b 1 a 0 b 0 a 1 b 3 a 1 b 2 a 1 b 1 a 1 b 0. a 2 b 3 a 2 b 2 a 2 b 1 a 2 b 0.. a 3 b 3 a 3 b 2 a 3 b 1 a 3 b 0... P 7 P 6 P 5 P P 3 P 2 P 1 P 0 Figure 12.2: Binary Multiplication.

12-3 12.3.1 Multiplier Data Path 2-Bit Counter Cnt -Bit Register B -Bit Adder C out Sum 0 E -Bit Reg. P H -Bit R eg. P L P 0 Figure 12.3: Multiplier Data Path. The data path for the sequential multiplier is shown in Figure 12.3. It consists of several registers and an adder. The required registers include: B-Register: A -bit register which holds the multiplicand (B) P-Register: An 8-bit register which consists of two -bit registers P L (P-Low) and P H (P-High). o Initially the multiplier (A) is loaded in P L. o The final result (product) is stored in P = (P H, P L ). E-Register: A 1-bit register (FF), that is used to hold the carryout output of the adder Cnt: A 2-bit counter used to control the number of steps to be performed (total of steps). The counter counts from 0 down to 3. The operation is stopped when the counter reaches 3. This done condition () is detected by an AND gate. Notation: (E, P H ) refers to the 5-bit register consisting of E as the MSB and P H. (E, P H, P L ) refer to the 9-bit register consisting of E as the MSB, P H. and P L.

12- Computation Steps: Note that i=cnt all the time. 1. Initialize: P H 0, P L A, B-Reg B, Cnt 0. 2. (E,P H ) P H + a i B = P H + P 0 B. 3. Shift (E, P H, P L ) right by one bit, and increment Cnt.. IF Cnt = 3 then STOP else Loop back to step 2. Notes: The 1-bit register (E) may be considered as the MSB bit of the P H register. The -bit sum outputs of the adder are the parallel inputs of P H, while E is loaded with the adder carry out output (C out ). This expanded 5-bit register will be referred to as the (E, P H ) register. After initializing the P-Register, the partial products (a i B) are accumulated into the P H -register one by one. Instead of shifting the partial products lefts before accumulating into P, the P-Register (E, P H, P L ) is shifted rights and the partial products are then added to it. In the shift right step, the three registers (E, P H, P L ) are treated as one 9-bit shift register (P). In this shift right step, a zero is shifted into E. Since P L is initially loaded with A, and P is shifted rights one bit per iteration, then the LSB P 0 will always equal to a i, i.e. P 0 = a i iteration steps. Important Note: Control signals are asserted in some state but ACTUAL EXECUTION OF CORRESPONDING OPERATION DOES NOT TAKE PLACE EXCEPT AFTER THE NEXT ACTIVE CLOCK EDGE ARRIVES. Example: To perform the multiplication of A=1011 by B=1101, you can do it step-by-step as in Table 12.1. Note that the state entry shows the state after the clock. Table 12.1: Multiplication Example. Action State Cnt E P H P L P 0 B Reset 0 0 0 0000 0000 0000 Initiation 1 0 0 0000 1011 1101 Load 2 0 0 1101 1011 1101 Shift 1 1 0 0110 1101 1101 Load 2 1 1 0011 1101 1101 Shift 1 2 0 1001 1110 0000 Load 2 2 0 1001 1110 0000 Shift 1 3 0 0100 1111 1101 Load 2 3 1 0001 1111 1101 Shift 0 3 0 1000 1111 1101

12-5 Controlling Data Path Registers Following is a list of data path registers and the various control signals: B-Register: Requires a parallel load capability to load the multiplicand (B) P H &P L -Registers: Requires the following features: o Asynchronous clear for initialization. o Parallel load to allow loading of the adder output sum bits. o Shift right. E-Register: Requires the following features: o Asynchronous clear for initialization. o Load to allow loading of the adder carry-out bit. Cnt: Requires the following features: o Asynchronous clear for initialization. o Increment by one. Figure 12. shows the control signals of data path registers. -Bit Register B 2-Bit Counter Cnt E -Bit Reg. P H -Bit Reg. P L P 0 CLR EN CLR EN CLR EN CLR LD EN CLR LD Figure 12.: Data path Register Control Signals. 12.3.2 Multiplier Controller The data path control signals are generated by the controller in a proper sequence to compute the required result (P = A x B). Controllers in general need status information to decide on the next proper actions. In the case of multiplier, the controller uses the signal to determine when to stop the computation. The state diagram of the controller is shown in Figure 12.5. The controller FSM has 3 states (S0, S1, and S2). The Reset signal resets the system to the first state S0 and clears all the components. The next clock edge moves the FSM to the second state S1, loads the multiplier (A) into P L, and the multiplicand (B) into the B-register. The next clock will take the FSM to the third state S2, loads the adder s sum and carry-out bits into the P H and E registers. Cnt 3 indicates that there are more multiplier bits to be processed. In this case, the next state of S2 is S1, otherwise the computation is done and controller returns back to state S0. In either case, the counter is incremented and the (E, P H, P L ) register is shifted right.

12-6 S0 Reset CLR_P H, CLR_P L CLR_Cnt, CLR_E Shft_Rt LD_P L, LD_B Shft_Rt, INC_Cnt S1 S2 LD_P H, LD_E Figure 12.5: Multiplier Controller.

12-7 12. Pre-Lab 12..1 First Week Phase 1 Bring the Multiplexed Seven-Segment Displays macro and its clock. Study and understand the design strategy explained in this document. On table below, show how the product of A=1010 and B=1110 is computed according to the above multiplier circuit. Action State Cnt E P H P L P 0 B 12..2 Second Week Phase 2 Design the controller FSM using D-FFs and generate all data path control signals. o Clr_P H = o Clr_P L = o Clr_Cnt = o Clr_E = o Ld_B = o Ld_ P L = o Ld_P H = o EN_P L = o EN_P H = o EN_Cnt = Bring the work of phase 1 with you completed.

12-8 12.5 In-Lab You need to complete the lab by breaking it to two stages. Design and verification of data path. You need to design the data path and provide the control signals manually and verify its functionality. Design and verification of controller. Design the controller using D-Flip-Flops. Verify that it is functionally correct by giving the external signals and observing the data path control signals. Complete the design. Join the two components of the multiplier together. Verify its functioning after downloading on the FPGA prototype board. 12.5.1 Multiplier Data Path Phase 1 Note that if an enabled shift register is clocked and its load (LD) control signal is low, the register will be shifted. Therefore, only one signal is used to determine the LOAD/SHIFT operation. 1. Use a counter with asynchronous clear and enabling capability. 2. You also need the following components: o Two shift registers (SRCLED) for P H and P L. o A -Bit register to store B (FDCE). o A -Bit adder with carry out. o One-Bit register to store E (FDC). 3. Construct a design similar to Figure 12.3 constraining the inputs of the multiplier (A) to be at decimal value 10, and constraining the inputs of the multiplicand (B) to be at decimal value 6.. E-Register should get the carry-out only when P H is loaded 5. Import the macro of the Multiplexed Seven-Segment Displays and its clock. 6. See Figure 12.6 for inputs/outputs connectivity. 7. Download your design and test it by following Table 12.2. Note that if LD of the shift register (SRCLED) is high, the register will load regardless of the enable signal. E LD1 LD 2 LD3 LD LD5 LD 6 LD7 LD8 SW1 SW2 SW3 SW SW5 SW6 SW7 SW8 0 BTN1 BTN2 BTN3 BTN 1 Push=1 Cnt P H P L B CLRALL ENB ENPH LDPH ENPL LDPL ENCnt CLKCnt CLKPH-E CLKPL CLKB Figure 12.6: Data Path Inputs/Outputs Assignment.

12-9 Table 12.2: Testing the Data Path Logic. SW1 SW3 SW SW5 SW6 SW7 SW8 BTN BTN2 BTN3 BTN 7-Seg. Displays LD1 No CLR ALL EN B EN PH LD PH EN PL LD PL ED Cnt CLK Cnt CLK PH-E CLK PL CLK B Cnt P H P L B E 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 2 0 1 0 0 0 0 0 X 0 0 1 0 0 0 6 0 3 0 0 1 1 1 1 0 X 1 1 X 0 0 A 6 0 0 0 0 0 1 0 1 0 X 1 X 0 0 5 6 0 5 0 0 0 1 0 0 1 1 1 X X 1 6 5 6 0 6 0 0 0 1 0 0 1 1 1 X X 2 C 5 6 0 7 0 0 0 1 0 0 0 X 1 X X 2 2 5 6 1 8 0 0 1 0 0 0 0 X 1 X X 2 9 5 6 0 9 1 X X X X X X X X X X 0 0 0 0 0

12-10 12.5.2 Multiplier Controller Phase 2 To design the multiplier data path you can follow these steps: 8. Use a push button for Reset and use it to clear all design components (BTN1). 9. Connect another push button to BUFGS and use it to clock all sequential components in the design (BTN). 10. You need two bits to store you states (S0, S1, and S2). Use two FFs with clearing capability for that (FDC). 11. Connect the outputs of the FFs to two LEDs (LD7 and LD8). LD8 should be the least significant FF. 12. The Boolean expressions of the various control signals can be easily derived from the state diagram. See Figure 12.7 for inputs/outputs connectivity. 13. Download your design and test it. It should follow Table 12.3. Notice that if you press Reset at any time the system will go to S0. ENB ENPH LDPH ENPL LDPL ENCnt State LD1 LD2 LD3 LD LD 5 LD6 LD7 LD8 BTN1 BTN2 BTN3 BTN Push=1 Reset CLK Figure 12.7: Controller Inputs/Outputs Assignment. Table 12.3: Testing the Controller Logic. LD7&8 BTN BTN2 LD1 LD2 LD3 LD LD5 LD6 LD7&8 State In CLK EN B LD PL EN PL LD PH EN PH EN Cnt State Out 0 X 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 1 1 0 1 1 0 X 0 0 0 1 1 0 1 1 1 X 0 0 1 0 1 1 2 2 0 0 0 0 1 0 1 1 2 2 0 1 0 0 1 0 1 0 2 2 1 0 0 0 0 1 1 0 1 2 1 1 0 0 0 0 0 0 0

12-11 12.5.3 Multiplier Data Path and Controller Combine the multiplier data path and controller taking into account the following: 1. The signal should be high if the counter has the value 3 15. Use four switches (SW5-SW8) to load the multiplier (A) into P L, and four switches (SW1-SW) to load the multiplicand (B) into its register as in Figure 12.8. 16. Download your design and show it to the lab instructor. ENB State LD1 LD2 LD3 LD LD5 LD6 LD7 LD8 SW1 SW2 SW3 SW SW5 SW6 SW7 SW8 0 BTN1 BTN2 BTN3 BTN 1 Push=1 Cnt E P H P L B 3 B 2 B 1 B 0 A 3 A 2 A 1 A 0 Reset CLK ENPH LDPH ENPL LDPL ENCnt Figure 12.8: Multiplier Inputs/Outputs Assignment. 12.6 Post-Lab You have to hand in a lab report that contains the following: Work sheet of the multiplication example on the Pre-lab All tables, k-maps, and Boolean expirations used in your design.