1 COMP541 Sequencing and Control Montek Singh Mar 29, 2007.

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.
Table 7.1 Verilog Operators.
Give qualifications of instructors: DAP
EKT 221 : Digital 2 ASM.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
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.
Design at the Register Transfer Level
Chapter 16 Control Unit Operation No HW problems on this chapter. It is important to understand this material on the architecture of computer control units,
The Control Unit: Sequencing the Processor Control Unit: –provides control signals that activate the various microoperations in the datapath the select.
Ch 8 - Control Unit and Algorithmic State Machines
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
1 COMP541 State Machines Montek Singh Feb 6, 2007.
Sequencing and Control Mano and Kime Sections 8-1 – 8-7.
Chapter 15 IA 64 Architecture Review Predication Predication Registers Speculation Control Data Software Pipelining Prolog, Kernel, & Epilog phases Automatic.
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 20 Datapath and Control Datapath - performs data transfer and processing operations.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 8, 2007.
Chapter 6 Memory and Programmable Logic Devices
ENG241 Digital Design Week #10 Sequencing and Control.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Chapter 6-2 Multiplier Multiplier Next Lecture Divider
CoE3DJ4 Digital Systems Design Register transfers, sequencing and control (from chapters 7 and 8 of Mano and Kime)
Registers CPE 49 RMUTI KOTAT.
Algorithmic State Machines.  1) Create an algorithm, using pseudocode, to describe the desired operation of the device. 2) Convert the pseudocode into.
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.
Chap 8. Sequencing and Control. 8.1 Introduction Binary information in a digital computer –data manipulated in a datapath with ALUs, registers, multiplexers,
Instructor: Yuzhuang Hu Another Design Example: PIG (Chapter 7-10) PIG is a single dice game. Two players roll the dice in turns. When.
1/8/ L20 Project Step 8 - Data Path Copyright Joanne DeGroat, ECE, OSU1 State Machine Design with an HDL A methodology that works for documenting.
REGISTER TRANSFER & MICROOPERATIONS By Sohaib. Digital System Overview  Each module is built from digital components  Registers  Decoders  Arithmetic.
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.
Register Transfer Level & Design with ASM
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
EKT 221/4 DIGITAL ELECTRONICS II Chapter 2 SEQUENCING AND CONTROL.
Algorithmic state machines
Datapath - performs data transfer and processing operations The control unit sends: – Control signals – Control outputs The control unit receives: – External.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 11, 2010.
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles.
SYEN 3330 Digital SystemsJung H. Kim 1 SYEN 3330 Digital Systems Chapter 7 – Part 2.
1 COMP541 Datapaths I Montek Singh Mar 8, Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8.
Hardwired Control Department of Computer Engineering, M.S.P.V.L Polytechnic College, Pavoorchatram. A Presentation On.
Processor Organization and Architecture Module III.
1 강의노트 09 Logic Design with ASM Charts: Based on Digital Systems Design Using VHDL, Chapter 5, by Charles H. Roth, Jr.
1 (c) W. J. Dally Digital Design: A Systems Approach Lecture 7: Data Path State Machines.
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.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
Pusat Pengajian Kejuruteraan Mikroelektronik EMT 351/4 DIGITAL IC DESIGN Verilog Behavioural Modeling (Part 4) Week #
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
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.
Figure 8.1. The general form of a sequential circuit.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
KU College of Engineering Elec 204: Digital Systems Design
Overview Datapath and Control Algorithmic State Machines (ASM)
ECE 434 Advanced Digital System L13
Table 8.1 Verilog 2001 HDL Operators
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
ASM and Micro-programmed State Machines
The Verilog Hardware Description Language
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Presentation transcript:

1 COMP541 Sequencing and Control Montek Singh Mar 29, 2007

2Topics  Starting on Chapter 8  Control unit Multiplier as example Multiplier as example  Today: hardwired control  Next time: microprogrammed control

3 Control Units  Two types Programmable Programmable Non-programmable (what you are implementing) Non-programmable (what you are implementing)  Look at non-programmable first A multiplier A multiplier

4 Algorithmic State Machines  Like a flowchart to express hardware algorithms  ASM describes sequence of events and timing relationships  Can then turn automatically into circuit

5 Components (3 of them)  State box specifies a state And what register ops and/or outputs happen when in this state And what register ops and/or outputs happen when in this state

6 Decision Box  Based on a single variable  Paths for 0 and 1

7 Conditional Output  Register operation is executed if box is reached after decision

8Example  Somewhat like start of CPU

9 ASM Block  Another example  Machine idle until START  Then A set to 0  Decision based on Q 0

10 Timing is Normal  States change at clock (this is posedge clocked)

11 Example: Binary Multiplier  Two versions Hardwired control Hardwired control Microprogrammed Microprogrammed  Multiplies two unsigned binary numbers

12 Multiplication Algorithm  Either select multiplicand or zero  Shift left one each time  Sum all to get product  Result size 2n

13 Hardware-Friendly Variation  Partial product  Right shift  Only n bit adder instead of 2n  Each step either add/shift or just shift

14Datapath Counter size – ceiling of log n Holds multiplier as well as shifted result. How?

15More Counter preset to n- 1. Counts down. Signals when it hits zero.

16 ASM Chart  Look at it in parts

17Idle  Wait until G asserted  Then clear C and A, and set P to n-1  Then multiplication begins

18Multiplication  Test Q 0 If 1, add B If 1, add B  Recall that MUL1 done all at same time What happens to C? What happens to C?  Test counter zero To IDLE

19 Hardwired Control Two aspects to control 1. Control of the microoperations Generating signals, such as those for the ALU operations, register numbers, etc. Generating signals, such as those for the ALU operations, register numbers, etc. 2. Sequencing What happens next? What happens next? The order of any microoperations The order of any microoperations Like states of our locks Like states of our locks

20 Create Control Sig from ASM  Can look at it one set at a time

21 Register A  All microops on Reg A  Last column is combinational expression that controls microop  Signal name is just assigned by designer

22 Register B  LOADB is not listed on ASM chart  It’s an external signal that commands reg to load

23 Flip-Flop C

24 Register Q  Similar External load External load Shift same as for Reg A Shift same as for Reg A

25 Counter P  Both of counter’s Ops happen with others, so no new signals

26Sequencing  Now can look purely at sequencing  Only decisions affecting next state are left Q 0 did not affect state Q 0 did not affect state

27 Have State Diagram  This should look familiar  Similar to state diagram, such as used in your locks  We’ll look at manual design briefly, then Verilog

28 What We Need to Do  Have decided how to generate control signals  Have separated control of timing  Now: implement in logic

29 Sequence Register and Decoder  Make register with enough bits to represent states  Add decoder to generate signal for each state  For our example (3 states) need 2-bit register 2-bit register 2-to-4 decoder (only need 3 lines of it) 2-to-4 decoder (only need 3 lines of it)

30 State Table  Let’s recall how this works by stepping through

31 Generate Signals Using Tables

32Circuit

33 One-Hot Encoding (review)  One Flip-Flop per state Only one of the FFs has value 1 Only one of the FFs has value 1 The single 1 propagates, controlled by combinational logic The single 1 propagates, controlled by combinational logic  Seems wasteful at first glance Need n FFs instead of log n Need n FFs instead of log n  However, it’s easy to design

34 Design from ASM  Just use transformation rules to convert ASM to logic  Here’s state box

35 Decision Box  Represents both possibilities

36Junction  Junction just an OR gate

37 Conditional Output  The action is triggered by the generated control line

38 Circuit from Chart  FFs labeled 1, decisions 2, junctions 3, control 4

39 Verilog Version  Similar to the digital lock  Case statement for sequence of states Transition to next state if criteria are true Transition to next state if criteria are true

40 Verilog (1) module binary_multiplier_v (CLK, RESET, G, LOADB, LOADQ, MULT_IN, MULT_OUT); input CLK, RESET, G, LOADB, LOADQ; input [3:0] MULT_IN; output [7:0] MULT_OUT; reg [1:0] state, next_state, P; parameter IDLE = 2'b00, MUL0 = 2'b01, MUL1 = 2'b10; reg [3:0] A, B, Q; reg C; wire Z; assign Z = ~| P; assign MULT_OUT = {A,Q};

41 Verilog (2)  Reset or go to next state //state register CLK or posedge RESET) begin if (RESET == 1) state <= IDLE; else state <= next_state; end

42 Verilog (3) – Next State //next state function or Z or state) begin case (state) IDLE: if (G == 1) next_state <= MUL0; else next_state <= IDLE; MUL0: next_state <= MUL1; MUL1: if (Z == 1) next_state <= IDLE; else next_state <= MUL0; endcaseend

43 Verilog (4) – Datapath CLK) begin if (LOADB == 1) B <= MULT_IN; if (LOADQ == 1) Q <= MULT_IN; case (state) IDLE: if (G == 1) begin C <= 0; A <= 4'b0000; P <= 2'b11; endMUL0: if (Q[0] == 1) {C, A} <= A + B; MUL1:begin C <= 1'b0; A <= {C, A[3:1]}; Q <= {A[0], Q[3:1]}; P <= P - 2'b01; endendcaseend

44Simulation  Multiply 1011 by 0110

45 My version has no next_state //state register CLK or posedge RESET) begin if (RESET == 1) state <= IDLE; else case (state) IDLE: if (G == 1) state <= MUL0; else state <= IDLE; MUL0: state <= MUL1; MUL1: if (Z == 1) state <= IDLE; else state <= MUL0; endcaseend

46Today  We’ve taken example  Created ASM  Divided into control and sequencing Looked at two ways to implement using logic Looked at two ways to implement using logic Looked at Verilog example Looked at Verilog example  Next time Look at microprogrammed control of multiplier Look at microprogrammed control of multiplier