Controller Implementation--Part I. Cascading Edge-triggered Flip-Flops

Similar documents
Understanding Engineers #2

Chapter 9. sequential logic technologies

Chapter 9. sequential logic technologies

LOGIC DIAGRAM: HALF ADDER TRUTH TABLE: A B CARRY SUM. 2012/ODD/III/ECE/DE/LM Page No. 1

Department of Electronics and Communication Engineering

ICS 151 Final. (Last Name) (First Name)

Solutions. ICS 151 Final. Q1 Q2 Q3 Q4 Total Credit Score. Instructions: Student ID. (Last Name) (First Name) Signature

LIST OF EXPERIMENTS. KCTCET/ /Odd/3rd/ETE/CSE/LM

SRV ENGINEERING COLLEGE SEMBODAI RUKMANI VARATHARAJAN ENGINEERING COLLEGE SEMBODAI

Learning Outcomes. Spiral 2 3. DeMorgan Equivalents NEGATIVE (ACTIVE LO) LOGIC. Negative Logic One hot State Assignment System Design Examples

6.111 Lecture # 19. Controlling Position. Some General Features of Servos: Servomechanisms are of this form:

Computer Architecture and Organization: L08: Design Control Lines

Design of Microprogrammed Control Units (MCU) using VHDL Description. Arvutitehnika erikusus

CS302 - Digital Logic Design Glossary By

Digital Design and System Implementation. Overview of Physical Implementations

Chapter 5 Sequential Logic Circuits Part II Hiroaki Kobayashi 7/11/2011

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Fan in: The number of inputs of a logic gate can handle.

Practical Workbook Logic Design & Switching Theory

Computer Architecture and Organization:

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

Gomoku Player Design

2014 Paper E2.1: Digital Electronics II

! Sequential Logic. ! Timing Hazards. ! Dynamic Logic. ! Add state elements (registers, latches) ! Compute. " From state elements

IES Digital Mock Test

EE 42/100 Lecture 24: Latches and Flip Flops. Rev A 4/14/2010 (8:30 PM) Prof. Ali M. Niknejad

CONTENTS Sl. No. Experiment Page No

Data Logger by Carsten Kristiansen Napier University. November 2004

DIGITAL DESIGN WITH SM CHARTS

Selected Solutions to Problem-Set #3 COE 608: Computer Organization and Architecture Single Cycle Datapath and Control

RISC Central Processing Unit

Chapter 5 Sequential Logic Circuits Part II Hiroaki Kobayashi 6/30/2008

Introduction (concepts and definitions)

Lecture 3: Logic circuit. Combinational circuit and sequential circuit

Finite State Machines CS 64: Computer Organization and Design Logic Lecture #16

ANALOG TO DIGITAL CONVERTER

Brought to you by. Priti Srinivas Sajja. PS01CMCA02 Course Content. Tutorial Practice Material. Acknowldgement References. Website pritisajja.

Page 1. Last time we looked at: latches. flip-flop

Module -18 Flip flops

DELD MODEL ANSWER DEC 2018

Java Bread Board Introductory Digital Electronics Exercise 2, Page 1

Lecture 02: Digital Logic Review

Number system: the system used to count discrete units is called number. Decimal system: the number system that contains 10 distinguished

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER-16 EXAMINATION Model Answer


! Is it feasible? ! How do we decompose the problem? ! Vdd. ! Topology. " Gate choice, logical optimization. " Fanin, fanout, Serial vs.

Lecture 9: Clocking for High Performance Processors

Electronic Instrumentation

VLSI Design 11. Sequential Elements

Winter 14 EXAMINATION Subject Code: Model Answer P a g e 1/28

EECS-140/141 Introduction to Digital Logic Design Lecture 7:Sequential Logic Basics

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

Keyword: Stop Watch, 555 Timer, logic gate IC, Multisim, PSPICE

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

ENGR-4300 Fall 2008 Test 3. Name. Section 1(MR 8:00) 2(TF 2:00) (circle one) Question I (20 points) Question II (15 points) Question III (20 points)

Digital Circuits Laboratory LAB no. 12. REGISTERS

COLLEGE OF ENGINEERING, NASIK

Course Overview. Course Overview

Clock Signal Review Memory Elements

Logic 0 Logic To provide an output load (or two) 5 Voltage Measurement Point V CC +5 74LS00 GND

Digital Logic Circuits

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

EC4205 Microprocessor and Microcontroller

INF3430 Clock and Synchronization

! Review: Sequential MOS Logic. " SR Latch. " D-Latch. ! Timing Hazards. ! Dynamic Logic. " Domino Logic. ! Charge Sharing Setup.

First Optional Homework Problem Set for Engineering 1630, Fall 2014

Chapter 3 Digital Logic Structures

EECS150 - Digital Design Lecture 28 Course Wrap Up. Recap 1

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

CMOS Digital Integrated Circuits Lec 11 Sequential CMOS Logic Circuits

Data Sheet. HCTL-2000 Quadrature Decoder/Counter Interface ICs HCTL-2000, HCTL-2016, HCTL-2020

logic system Outputs The addition of feedback means that the state of the circuit may change with time; it is sequential. logic system Outputs

CHAPTER 16 SEQUENTIAL CIRCUIT DESIGN. Click the mouse to move to the next page. Use the ESC key to exit this chapter.

Lecture 20: Several Commercial Counters & Shift Register

Adder Comparator 7 segment display Decoder for 7 segment display D flip flop Analysis of sequential circuits. Sequence detector

EECS150 - Digital Design Lecture 15 - CMOS Implementation Technologies. Overview of Physical Implementations

Datapath Components. Multipliers, Counters, Timers, Register Files

I hope you have completed Part 2 of the Experiment and is ready for Part 3.

Mixed Synchronous/Asynchronous State Memory for Low Power FSM Design

A-PDF Split DEMO : Purchase from to remove the watermark 114 FSM

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

Chapter 4: FLIP FLOPS. (Sequential Circuits) By: Siti Sabariah Hj. Salihin ELECTRICAL ENGINEERING DEPARTMENT EE 202 : DIGITAL ELECTRONICS 1

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

ENGR-4300 Electronic Instrumentation Quiz 3 Spring 2011 Name Section

COMPUTER ORGANIZATION & ARCHITECTURE DIGITAL LOGIC CSCD211- DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF GHANA

PC-OSCILLOSCOPE PCS500. Analog and digital circuit sections. Description of the operation

First Name: Last Name: Lab Cover Page. Teaching Assistant to whom you are submitting

Sequential Logic Circuits

Module-20 Shift Registers

Lecture Topics. Announcements. Today: Pipelined Processors (P&H ) Next: continued. Milestone #4 (due 2/23) Milestone #5 (due 3/2)

Sr. No. Instrument Specifications. TTL (Transistor-Transistor Logic) based on bipolar junction transistors

a8259 Features General Description Programmable Interrupt Controller

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378:

DIGITAL INTEGRATED CIRCUITS A DESIGN PERSPECTIVE 2 N D E D I T I O N

EXPERIMENT #5 COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Exam #2 EE 209: Fall 2017

UNIT II: Clocked Synchronous Sequential Circuits. CpE 411 Advanced Logic Circuits Design 1

ECOM 4311 Digital System Design using VHDL. Chapter 9 Sequential Circuit Design: Practice

UNIVERSITI MALAYSIA PERLIS

EC O4 403 DIGITAL ELECTRONICS

Transcription:

Controller Implementation--Part I Alternative controller FSM implementation approaches based on: Classical Moore and Mealy machines Time state: Divide and Counter Jump counters Microprogramming (ROM) based approaches» branch sequencers» horizontal microcode» vertical microcode CS 5 - Spring 27 Lec #4: Control Implementation - Cascading Edge-triggered Flip-Flops Shift register New value goes into first stage While previous value of first stage goes into second stage Consider setup/hold/propagation delays (prop must be > hold) IN Q Q D Q D Q OUT IN Q Q CS 5 - Spring 27 Lec #4: Control Implementation - 2

Cascading Edge-triggered Flip-Flops Shift register New value goes into first stage While previous value of first stage goes into second stage Consider setup/hold/propagation delays (prop must be > hold) IN Q Q D Q D Q OUT Delay Clk IN Q Q Clk CS 5 - Spring 27 Lec #4: Control Implementation - 3 Clock Skew The problem Correct behavior assumes next state of all storage elements determined by all storage elements at the same time Difficult in high-performance systems because time for clock to arrive at flip-flop is comparable to delays through logic (and will soon become greater than logic delay) Effect of skew on cascaded flip-flops: In Q Q is a delayed version of original state: IN =, Q =, Q = due to skew, next state becomes: Q =, Q =, and not Q =, Q = CS 5 - Spring 27 Lec #4: Control Implementation - 4

Why Gating of Clocks is Bad! LD Reg Reg Clk GOOD Clk LD BAD gatedclk Do NOT Mess With Clock Signals! CS 5 - Spring 27 Lec #4: Control Implementation - 5 Why Gating of Clocks is Bad! LD generated by FSM shortly after rising edge of Clk LD gatedclk Runt pulse plays HAVOC with register internals! NASTY HACK: delay LD through negative edge triggered FF to ensure that it won t change during next positive edge event Clk LDn gatedclk Clk skew PLUS LD delayed by half clock cycle What is the effect on your register transfers? Do NOT Mess With Clock Signals! CS 5 - Spring 27 Lec #4: Control Implementation - 6

Why Gating of Clocks is Bad! Reset Counter Reg Clk BAD slowclk Do NOT Mess With Clock Signals! CS 5 - Spring 27 Lec #4: Control Implementation - 7 Why Gating of Clocks is Bad! Reset LD Counter Reg Clk Better! Do NOT Mess With Clock Signals! CS 5 - Spring 27 Lec #4: Control Implementation - 8

Alternative Ways to Implement Processor FSMs "Random Logic" based on Moore and Mealy Design Classical Finite State Machine Design Divide and Conquer Approach: Time-State Method Partition FSM into multiple communicating FSMs Exploit Logic Block Functionality: Jump Counters Counters, Multiplexers, Decoders Microprogramming: ROM-based methods Direct encoding of next states and outputs CS 5 - Spring 27 Lec #4: Control Implementation - 9 Random Logic Perhaps poor choice of terms for "classical" FSMs Contrast with structured logic: PLA, FPGA, ROM-based (latter used in microprogrammed controllers) Could just as easily construct Moore and Mealy machines with these components CS 5 - Spring 27 Lec #4: Control Implementation -

Moore Machine State Diagram RES Reset! PC IF PC! MAR, PC +! PC Note capture of MBR in these states IF IF2 MAR! Mem,! Read/Write,! Request, Mem! MBR IF3 MBR! IR OD LD LD IR! MAR MAR! Mem,! Read/Write,! Request, Mem! MBR = = ST ST IR! MAR, AC! MBR MAR! Mem,! Read/Write,! Request, MBR! Mem = AD AD = IR! MAR MAR! Mem,! Read/Write,! Request, Mem! MBR BR = BR = IR! PC LD2 MBR! AC AD2 MBR + AC! AC CS 5 - Spring 27 Lec #4: Control Implementation - Memory-Register Interface Timing IF IF2 IF2 IF2 IF3 WAIT Mem Bus Data Valid Latch MBR Invalid Data Latched Invalid Data Latched Valid Data Latched Valid data latched on IF2 to IF3 transition because data must be valid before Wait can go low CS 5 - Spring 27 Lec #4: Control Implementation - 2

Moore Machine Diagram Reset Wait IR<5> IR<4> AC<5> Clock Next State Logic State 6 states, 4 bit state register Next State Logic: 9 Inputs, 4 Outputs Output Logic: 4 Inputs, 8 Outputs Output Logic Read/Write Request! PC PC +! PC PC! ABUS IR! ABUS ABUS! MAR ABUS! PC MAR! Memory Address Bus Memory Data Bus! MBR MBR! Memory Data Bus MBR! MBUS MBUS! IR MBUS! ALU B MBUS! AC RBUS! AC RBUS! MBR ALU ADD These can be implemented via ROM or PAL/PLA Next State: 52 x 4 bit ROM Output: 6 x 8 bit ROM CS 5 - Spring 27 Lec #4: Control Implementation - 3 Moore Machine State Table ResetWaitIR<5> IR<4> AC<5>Current State Next State Register Transfer Ops X X X X X RES () X X X X RES () IF ()! PC X X X X IF () IF () PC! MAR, PC +! PC X X X IF () IF () X X X IF () IF2 () X X X IF2 () IF2 () MAR! Mem, Read, X X X IF2 () IF3 () Request, Mem! MBR X X X IF3 () IF3 () MBR! IR X X X IF3 () OD () X X OD () LD () X X OD () ST () X X OD () AD () X X OD () BR () CS 5 - Spring 27 Lec #4: Control Implementation - 4

Moore Machine State Table ResetWait IR<5> IR<4> AC<5> Current State Next State Register Transfer Ops X X X X LD () LD () IR! MAR X X X LD () LD () MAR! Mem, Read, X X X LD () LD2 () Request, Mem! MBR X X X X LD2 () IF () MBR! AC X X X X ST () ST () IR! MAR, AC! MBR X X X ST () ST () MAR! Mem, Write, X X X ST () IF () Request, MBR! Mem X X X X AD () AD () IR! MAR X X X AD () AD () MAR! Mem, Read, X X X AD () AD2 () Request, Mem! MBR X X X X AD2 () IF () MBR + AC! AC X X X BR () IF () X X X BR () BR () X X X X BR () IF () IR! PC CS 5 - Spring 27 Lec #4: Control Implementation - 5 Moore Machine State Transition Table Observations: Extensive use of Don't Cares Inputs used only in a small number of state e.g., AC<5> examined only in BR state IR<5:4> examined only in OD state Some outputs always asserted in a group ROM-based implementations cannot take advantage of don't cares However, ROM-based implementation can skip state assignment step CS 5 - Spring 27 Lec #4: Control Implementation - 6

Synchronous Mealy Machines Standard Mealy Machine has asynchronous outputs Change in response to input changes, independent of clock Revise Mealy Machine design so outputs change only on clock edges One approach: non-overlapping clocks Synchronizer Circuitry at Inputs and Outputs A D Q A' ƒ D Q ƒ' Output Logic STATE A STATE A STATE A' ƒ D Q Output Logic ƒ D Q ƒ' Output Logic CS 5 - Spring 27 Lec #4: Control Implementation - 7 Synchronous Mealy Machines Case I: Synchronizers at Inputs and Outputs A A' cycle cycle cycle 2 S S A/ƒ ƒ ƒ' S2 A asserted in Cycle, ƒ becomes asserted after 2 cycle delay! This is clearly overkill! CS 5 - Spring 27 Lec #4: Control Implementation - 8

Synchronous Mealy Machine Case II: Synchronizers on Inputs cycle cycle cycle 2 S A/ƒ S A S S A' A'/ƒ ƒ A asserted in Cycle, ƒ follows in next cycle Same as using delayed signal (A') in Cycle! CS 5 - Spring 27 Lec #4: Control Implementation - 9 Synchronous Mealy Machines Case III: Synchronized Outputs A ƒ cycle cycle cycle 2 S S A/ƒ ƒ' A asserted during Cycle, ƒ' asserted in next cycle Effect of ƒ delayed one cycle CS 5 - Spring 27 Lec #4: Control Implementation - 2

Synchronous Mealy Machines Implications for Processor FSM Already Derived Consider inputs: Reset, Wait, IR<5:4>, AC<5> Latter two already come from registers, and are sync'd to clock Possible to load IR with new instruction in one state & perform multiway branch on opcode in next state Best solution for Reset and Wait: synchronized inputs» Place D flipflops between these external signals and the» control inputs to the processor FSM» Sync'd versions of Reset and Wait delayed by one clock cycle CS 5 - Spring 27 Lec #4: Control Implementation - 2 Time State Divide and Conquer Overview Classical Approach: Monolithic Implementations Alternative "Divide & Conquer" Approach:» Decompose FSM into several simpler communicating FSMs» Time state FSM (e.g., IFetch, Decode, Execute)» Instruction state FSM (e.g., LD, ST, ADD, BRN)» Condition state FSM (e.g., AC <, AC " ) CS 5 - Spring 27 Lec #4: Control Implementation - 22

Time State (Divide & Conquer) Time State FSM Most instructions follow same basic sequence Differ only in detailed execution sequence Time State FSM can be parameterized by opcode and AC states Instruction State: stored in IR<5:4> Condition State: stored in AC<5> = = IR = = LD ST ADD BRN AC < AC<5>= AC?# T T T2 T3 T4 T5 T6 T7 AC<5>= CS 5 - Spring 27 Lec #4: Control Implementation - 23 BRN AC! / (LD + ST + ADD) BRN + (ST Wait)/ (LD + ADD) Wait Time State (Divide & Conquer) Generation of Microoperations! PC: Reset PC +! PC: T PC! MAR: T MAR! Memory Address Bus: T2 + T6 (LD + ST + ADD) Memory Data Bus! MBR: T2 + T6 (LD + ADD) MBR! Memory Data Bus: T6 ST MBR! IR: T4 MBR! AC: T7 LD AC! MBR: T5 ST AC + MBR! AC: T7 ADD IR<3:>! MAR: T5 (LD + ST + ADD) IR<3:>! PC: T6 BRN! Read/Write: T2 + T6 (LD + ADD)! Read/Write: T6 ST! Request: T2 + T6 (LD + ST + ADD) CS 5 - Spring 27 Lec #4: Control Implementation - 24

Jump Counter Concept Implement FSM using MSI functionality: counters, mux, decoders Pure jump counter: only one of four possible next states N HOLD CLR CNT LOAD N+ XX Single "Jump State" function of the current state Hybrid jump counter: Multiple "Jump States" function of current state + inputs CS 5 - Spring 27 Lec #4: Control Implementation - 25 Jump Counters Pure Jump Counter Inputs Count, Load, Clear Logic Clear Load Count CLOCK Jump State Logic Synchronous Counter State Register NOTE: No inputs to jump state logic Logic blocks implemented via discrete logic, PLAs, ROMs CS 5 - Spring 27 Lec #4: Control Implementation - 26

Jump Counters Problem with Pure Jump Counter Difficult to implement multi-way branches OD 4 OD Extra States: 5 8 OD BR LD ST AD BR Logical State Diagram 6 OD2 9 AD 7 LD ST Pure Jump Counter State Diagram CS 5 - Spring 27 Lec #4: Control Implementation - 27 Jump Counters Hybrid Jump Counter Inputs Count, Load, Clear Logic Load Count Clear CLOCK Jump State Logic Synchronous Counter State Register Load inputs are function of state and FSM inputs CS 5 - Spring 27 Lec #4: Control Implementation - 28

Jump Counters Implementation Example RES IF Reset IF 2 State assignment attempts to take advantage of sequential states IF2 OD 3 4 LD 5 ST 8 AD BR 3 LD 6 ST 9 AD LD2 7 AD2 2 CS 5 - Spring 27 Lec #4: Control Implementation - 29 Jump Counters Implementation Example, Continued CNT = (s + s5 + s8 + s) + Wait (s + s3) + Wait (s2 + s6 + s9 + s) CNT = Wait (s + s3) + Wait (s2 + s6 + s9 + s) CLR = Reset + s7 + s2 + s3 + (s9 Wait) CLR = Reset s7 s2 s3 (s9 + Wait) LD = s4 Contents of Jump State ROM Address Contents (Symbolic State) (LD) (ST) (AD) (BR) CS 5 - Spring 27 Lec #4: Control Implementation - 3

/S9 Wait Jump Counters Implementation Example, continued Wait /S /S9 /S6 /S3 /S2 /S OR IR5 IR4 /Reset /S7 /S2 /S3 Cnt PAL Wait S S9 S6 HOLD S3 S2 S Jump State IR<5> IR<4> AND 3 2 Implement CLR CNT /S4 7 P T 2 6 D 5 C 4 3 9 Wait B A LOAD CLR Implement CNT using active lo PAL 63 5 RCO QD QC 2 QB 3 QA 4 /Reset /Wait 9 8 2 D 2 C 22 B 23 A CS 5 - Spring 27 Lec #4: Control Implementation - 3 G2 G 54 5 4 3 2 9 8 7 6 5 4 3 2 7 6 5 4 3 9 8 7 6 5 4 3 2 NOTE: Active lo outputs from decoder /S5 /S4 /S3 /S2 /S /S /S9 /S8 /S7 /S6 /S5 /S4 /S3 /S2 /S /S Jump Counters CLR, CNT, LD implemented via Mux Logic CLR = CLRm + Reset CLR = CLRm + Reset /CLRm /Reset Reset Wait /CLR Jump State IR5 IR<5> IR4 IR<4> /Reset /Wait 3 2 CNT /LD /CLR P T D C B A LOAD CLR 63 RCO QD QC QB QA G2 G D C B A 54 5 4 3 2 9 8 7 6 5 4 3 2 \S3 \S2 \S \S \S9 \S8 \S7 \S6 \S5 \S4 \S3 \S2 \S \S Active Lo outputs: hi input inverted at the output Note that CNT is active hi on counter so invert MUX inputs! S3 S2 S S G E5 5 E4 + E3 + E2 E E E9 E8 E7 E6 E5 E4 E3 Wait E2 /Wait E E S3 S2 S S G G E5 5 E5 5 E4 E4 E3 E3 E2 E2 E E E E /Wait E9 E9 EOUT E8 E8 EOUT CNT /CLRm EOUT E7 E6 E5 E4 E3 E2 E E + S3 S2 S S E7 E6 E5 E4 E3 E2 E E /LD CS 5 - Spring 27 Lec #4: Control Implementation - 32

Jump Counters Microoperation implementation! PC = Reset PC +! PC = S PC! MAR = S MAR! Memory Address Bus = Wait (S + S2 + S5 + S6 + S8 + S9 + S + S2) Memory Data Bus! MBR = Wait (S2 + S6 + S) MBR! Memory Data Bus = Wait (S8 + S9) MBR! IR = Wait S3 MBR! AC = Wait S7 AC! MBR = IR5 IR4 S4 AC + MBR! AC = Wait S2 IR<3:>! MAR = (IR5 IR4 + IR5 IR4 + IR5 IR4) S4 IR<3:>! PC = AC5 S3! Read/Write = Wait (S + S2 + S5 + S6 + S + S2)! Read/Write = Wait (S8 + S9)! Request = Wait (S + S2 + S5 + S6 + S8 + S9 + S + S2) Jump Counters: CNT, CLR, LD function of current state + Wait Why not store these as outputs of the Jump State ROM? Make Wait and Current State part of ROM address 32 x as many words, 7 bits wide CS 5 - Spring 27 Lec #4: Control Implementation - 33 Controller Implementation Summary (Part I!) Control Unit Organization Register transfer operation Classical Moore and Mealy machines Time State Approach Jump Counter Next Time:» Branch Sequencers» Horizontal and Vertical Microprogramming CS 5 - Spring 27 Lec #4: Control Implementation - 34