Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

Similar documents
Design at the Register Transfer Level

Design of Sequential Circuits

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

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

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

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

FSM model for sequential circuits

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

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

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

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

Fundamentals of Digital Design

Register Transfer Level

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

EXPERIMENT Bit Binary Sequential Multiplier

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

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

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

CprE 281: Digital Logic

Figure 4.9 MARIE s Datapath

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

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

Combinational Logic Design Combinational Functions and Circuits

Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc.

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

UNIVERSITY OF WISCONSIN MADISON

Logic Design II (17.342) Spring Lecture Outline

DE58/DC58 LOGIC DESIGN DEC 2014

ELCT201: DIGITAL LOGIC DESIGN

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

ECE 341. Lecture # 3

Enrico Nardelli Logic Circuits and Computer Architecture

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

Lecture 10: Synchronous Sequential Circuits Design

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

Digital Circuits and Systems

Philadelphia University Student Name: Student Number:

Sample Test Paper - I

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

Decoding A Counter. svbitec.wordpress.com 1

EECS150 - Digital Design Lecture 21 - Design Blocks

Shift Register Counters

A crash course in Digital Logic

Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1

Chapter 6. Synchronous Sequential Circuits

ELEN Electronique numérique

ELCT201: DIGITAL LOGIC DESIGN

Sequential logic and design

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

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

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Principles of Digital Techniques


Digital Design. Register Transfer Specification And Design

Finite State Machine (FSM)

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

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Verilog HDL:Digital Design and Modeling. Chapter 11. Additional Design Examples. Additional Figures

Adders, subtractors comparators, multipliers and other ALU elements

EE 209 Logic Cumulative Exam Name:

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

CSE 140 Lecture 11 Standard Combinational Modules. CK Cheng and Diba Mirza CSE Dept. UC San Diego

CPE100: Digital Logic Design I

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

on candidate s understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept.

EECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters

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

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

SRC Language Conventions. Class 6: Intro to SRC Simulator Register Transfers and Logic Circuits. SRC Simulator Demo. cond_br.asm.

EECS150 - Digital Design Lecture 23 - FSMs & Counters

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Lecture 17: Designing Sequential Systems Using Flip Flops

Hardware Design I Chap. 4 Representative combinational logic

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

7 Multipliers and their VHDL representation

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

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Lecture 8: Sequential Networks and Finite State Machines

Module 10: Sequential Circuit Design

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

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

Adders, subtractors comparators, multipliers and other ALU elements

or 0101 Machine

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

DIGITAL LOGIC CIRCUITS

CMP 334: Seventh Class

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

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

Review for Final Exam

Chapter 7. Sequential Circuits Registers, Counters, RAM

Combinational Logic. By : Ali Mustafa

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Synchronous Sequential Circuit Design. Digital Computer Design

Lecture (08) Synchronous Sequential Logic

Transcription:

Logic and Computer Design Fundamentals Chapter 8 Sequencing and Control

Datapath and Control Datapath - performs data transfer and processing operations Control Unit - Determines enabling and sequencing of operations Control signals Describe properties of state of datapath Control inputs Control unit Status signals Datapath Data outputs control unit receives: Control outputs External control inputs Status signals Data inputs control unit sends: Control signals Control outputs Chapter 8 2

Control Unit Types Two distinct classes: Programmable Non-programmable. A programmable control unit has: A program counter (PC) or other sequencing register with contents that points to the next instruction to be executed An external ROM or RAM array for storing instructions and control information Decision logic for determining the sequence of operations and logic to interpret the instructions A non-programmable control units does not fetch instructions from a memory and is not responsible for sequencing instructions Chapter 8 3

Algorithmic State Machines The function of a state machine (or sequential circuit) can be represented by a state table or a state diagram. A flowchart is a way of showing actions and control flow in an algorithm. Algorithmic State Machine (ASM) is simply a flowchartlike way to specify state diagrams for sequential logic and, optionally, actions performed in a datapath. While flowcharts typically do not specify time, an ASM explicitly specifies a sequence of actions and their timing relationships. Chapter 8 4

ASM Primitives 1.State Box (a rectangle) 2.Scalar Decision Box (a diamond) 3.Vector Decision Box (a hexagon) 4.Conditional Output Box (oval). State Box is a rectangle, marked with symbolic state name, containing register transfers and output signals activated when control unit is in the state. Scalar Decision Box is a diamond that describes effects of a specific input condition on the control. It has one input path and two exit paths, one for TRUE (1) and one for FALSE (0). Vector Decision Box is a hexagon that describes effects of a specific n-bit (n > 2) vector of input conditions on the control. It has one input path and up to 2 n exit paths, each corresponding to a binary vector value. Conditional Output Box is an oval with entry from a decision block and outputs activated for decision conditions being satisfied. Chapter 8 5

State Box A rectangle with: symbolic name for state marked outside upper left top Containing register transfer operations and outputs activated within or while leaving state An optional state code, if assigned, outside upper right top (Symbolic Name) IDLE (Register transfers or outputs) R 0 RUN (Optional state code) 0000 Chapter 8 6

Scalar Decision Box A diamond with: One input path (False Condition) (True Condition) (entry point). 0 (Input) 1 One input condition, placed START in the center of box, that is tested. A TRUE exit path taken if the condition is true (logic 1). A FALSE exit path taken if the condition is false (logic 0). Chapter 8 7

Vector Decision Box A hexagon with: One Input Path (entry point). A vector of input conditions, placed in the center of box, that is tested. Up to 2 n output paths. The path taken has a binary vector value that matches vector input condition (Binary Vector Values) 00 01 (Vector of Input Conditions) Z, Q0 (Binary Vector Values) 10 Chapter 8 8

Conditional Output Box An oval with: One input path from a decision box or decision boxes. One output path Register transfers or outputs that occur only if the conditional path to the box is taken. Transfers and outputs in a state box are Moore type - dependent only on state Transfers and outputs in a conditional output box are Mealy type - dependent on both state and inputs From Decision Box(es) (Register transfers or outputs) R 0 RUN Chapter 8 9

ASM Blocks One state box along with all decision and conditional output boxes connected to it is called an ASM Block. ASM Block includes all items on the path from current state to the same or other states. Exit IDLE AVAIL START R R + 1 R 0 Exit MUL0 Entry ASM BLOCK 0 1 Q0 MUL1 Exit Chapter 8 10

ASM Timing Outputs appear while in the state Register transfers occur at the clock while exiting state - New value occur in the next state! Clock cycle 1 Clock cycle 2 Clock cycle 3 Clock START Q 1 Q 0 State IDLE MUL 1 AVAIL A 0034 0000 Chapter 8 11

Multiplier Example Example: (101 x 011) Base 2 partial product summation for n digits, base 2 numbers requires adding up to n digits (with carries) in a column. 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 1 0 1 x 0 1 1 1 0 1 1 0 1 0 0 0 0 0 1 1 1 1 Chapter 8 12

Example (1 0 1) x (0 1 1) Again Reorganizing example to follow hardware algorithm: 1 0 1 x 0 1 1 0 0 0 0 Clear C A + 1 0 1 Multipler 0 = 1 => Add B 0 1 0 1 Addition 0 0 1 0 1 Shift Right (Zero-fill C) + 1 0 1 Multipler 1 = 1 => Add B 0 1 1 1 1 Addition 0 0 1 1 1 1 0 0 0 1 1 1 1 Shift Right Multipler 2 = 0 => No Add, Shift Right Chapter 8 13

Multiplier Example: Block Diagram log 2 n n2 1 Counter P IN n Multiplicand Register B n G (Go) Zero detect C out Parallel adder Control unit 4 Control signals Z Q o n Multiplier 0 C Shift register A Shift register Q n Product OUT n Chapter 8 14

Multiplexer Example: Operation 1. multiplicand (top operand) is loaded into register B. 2. multiplier (bottom operand) is loaded into register Q. 3. Register C Q is initialized to 0 when G becomes 1. 4. partial products are formed in register C A Q. 5. Each multiplier bit, beginning with 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, outgoing carry is recovered from C during 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 Chapter 8 15

Multiplier Example: ASM Chart IDLE MUL0 0 1 G C 0, A 0 P n 1 0 1 Q 0 A A + B, C C out MUL1 C 0, C A Q sr C A Q, P P 1 0 1 Z Chapter 8 16

Multiplier Example: ASM Chart Three states are employ using a combined Mealy - Moore output model: IDLE - state in which: outputs of the prior multiply is held until Q is loaded with the new multiplicand input G is used as condition for starting multiplication, and C, A, and P are initialized MUL0 - state in which conditional addition is performed based on Q 0. MUL1 - state in which: right shift is performed to capture partial product and position the next bit of the multiplier in Q 0 terminal count of 0 for down counter P is used to sense completion or continuation of the multiply. Chapter 8 17

Multiplier Example: Control Signal Table Control Signals for Binary Multiplier Block Diagram Module Microope ration Control Sign al Name Control Expression Register A: A 0 Initialize IDLE G A A + B Load MUL0 Q C A Q sr C A Q Shift_dec MUL1 Register B: B IN Load_B LOADB Flip-Flop C: C 0 Clear_C IDLE G + MUL1 C C out Load Register Q: Q IN Load_Q LOADQ C A Q sr C A Q Shift_dec Counter P: P n 1 Initialize P P 1 Shift_dec Chapter 8 18

Multiplier Example: Control Table Signals are defined on a register basis LOADQ and LOADB are external signals controlled from system using 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 outputs of control unit With outputs represented by table, they can be removed from ASM giving an ASM that represents only sequencing (next state) behavior Chapter 8 19

Multiplier Example - Sequencing Part of ASM IDLE 00 0 1 G MUL0 01 MUL1 10 0 1 Z Chapter 8 20

Hardwired Control 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, 1000. One Flip-flop per State - Flip-flop outputs as state signals, e. g., 0001, 0010, 0100, 1000. Chapter 8 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 Output Function State M1 M0 Second, find State Assignments (two bits required) We will use two state bits to encode three state IDLE, MUL0, and MUL1. IDLE 0 0 MUL0 0 1 MUL1 1 0 Unused 1 1 Chapter 8 22

Multiplier Example: Sequencer and Decoder Design (continued) Assuming that state variables M1 and M0 are decoded into states, the next state part of the state table is: Current State Input G Z Next State M1 M0 IDLE 0 0 0 0 IDLE 0 1 0 0 IDLE 1 0 0 1 IDLE 1 1 0 1 MUL0 0 0 1 0 MUL0 0 1 1 0 MUL0 1 0 1 0 MUL0 1 1 1 0 Current State M1 M0 Input G Z Next State M1 M0 MUL1 0 0 0 1 MUL1 0 1 0 0 MUL1 1 0 0 1 MUL1 1 1 0 0 Unused 0 0 d d Unused 0 1 d d Unused 1 0 d d Unused 1 1 d d Chapter 8 23

Multiplier Example: Sequencer and Decoder Design (continued) Finding equations for M1 and M0 is easier due to 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. output equations using decoded states: Initialize = IDLE G Load = MUL0 Q 0 Clear_C = IDLE G + MUL1 Shift_dec = MUL1 Chapter 8 24

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 resulting circuit using flip-flops, a decoder, and the above equations is given on the next slide. Chapter 8 25

Multiplier Example: Sequencer and Decoder Design (continued) G START D M 0 Initialize Clear_C Z C DECODER A0 0 1 2 A1 3 IDLE MUL0 MUL1 Shift_dec M 1 D C Q 0 Load Chapter 8 26

One Flip-Flop per State 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. Chapter 8 27

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. Entry STATE Entry STATE D Q Exit Exit Chapter 8 28

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. Entry Entry X 0 X 1 Exit 0 Exit 1 Exit 0 Exit 1 Chapter 8 29

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. (Binary Vector Values) 00 01 (Vector of Input Conditions) (Binary Vector Values) 10 X 1 X 1, X X 0 0 DEMUX Entry EN A 1 D 0 D 1 Exit 0 Exit 1 A 0 Exit2 D 2 D 3 Exit 3 Chapter 8 30

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 Entry 1 Entry 2 Entry 1 Entry 2 Exit Exit Chapter 8 31

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. Entry Entry X 1 X OUTPUT Exit 1 Exit 1 OUTPUT Chapter 8 32

Multiplier Example: Flip-flop per State Design Logic Diagram 4 IDLE D C G 1 2 DEMUX EN D 0 A 0 D 1 START 4 MUL0 D C 1 Q 0 5 5 Initialize Clear _C Load MUL1 D 1 5 Shift_dec Clock C 2 Z DEMUX EN D 0 D 1 A 0 Chapter 8 33

Speeding Up the Multiplier In processing each bit of the multiplier, the circuit visits states MUL0 and MUL1 in sequence. By redesigning multiplier, is it possible to visit only a single state per bit processed? Chapter 8 34

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! Chapter 8 35

Speeding Up Multiply (continued) By replacing shift register with a combinational shifter and combining adder and shifter, states can be merged. C-bit is no longer needed. IDLE 0 G 1 A 0 P n 1 In this case, Z and Q 0 have been made into a vector. This is not essential to solution. ASM chart => A Q sr C out (A + 0) Q 00 01 MUL P P 1 Z Q 0 A Q sr C out (A +0) Q 10 11 A Q sr C out (A +B) Q A Q sr C out (A+B) Q Chapter 8 36