CS 150 - Spring 2001 - Controller Implementation - 1 Overview Alternative controller FSM implementation approaches based on: –classical Moore and Mealy.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

Control Unit Implemntation
Lecture 15 Finite State Machine Implementation
Topics covered: CPU Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
ARITHMETIC LOGIC SHIFT UNIT
1 ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides8.ppt Modification date: Nov 3, 2014 Random Logic Approach The approach described so far.
Microprogramming. S 2/e C D A Computer Systems Design and Architecture Second Edition© 2004 Prentice Hall Microprogramming Main Points/Terminology Difference.
CS Spring 2007 – Lec #14: Control Implementation - 1 Controller Implementation--Part I Alternative controller FSM implementation approaches based.
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,
CS Fall 2005 – Lec #15: Microprogramming - 1 Controller Implementation--Part II Alternative controller FSM implementation approaches based on: –Classical.
CS364 CH17 Micro-programmed Control
Topics covered: CPU Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
CS Fall 2005 – Lec #14: Control Implementation - 1 Controller Implementation--Part I Alternative controller FSM implementation approaches based on:
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Preparation for Midterm Binary Data Storage (integer, char, float pt) and Operations, Logic, Flip Flops, Switch Debouncing, Timing, Synchronous / Asynchronous.
Chapter 15 IA 64 Architecture Review Predication Predication Registers Speculation Control Data Software Pipelining Prolog, Kernel, & Epilog phases Automatic.
Chapter 7. Basic Processing Unit
CS Spring 2007 – Lec #18 – Mid #2 Review - 1 Understanding Engineers #1 zThe graduate with a Science degree asks, "Why does it work?" zThe graduate.
Computer Architecture Lecture 12 Fasih ur Rehman.
Computer Organization. Motivation Computer Design as an application of digital logic design  Computer = Processing Unit + Memory System  Processing.
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
1 Computer Organization Today: First Hour: Computer Organization –Section 11.3 of Katz’s Textbook –In-class Activity #1 Second Hour: Test Review.
Lecture 16 Today’s topics: –MARIE Instruction Decoding and Control –Hardwired control –Micro-programmed control 1.
Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม.
Multiple-bus organization
EXECUTION OF COMPLETE INSTRUCTION
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
Chapter 16 Micro-programmed Control
MICROPROGRAMMED CONTROL CH 17 Team # 2 Members: Wilmer Saint-Hilaire Alberto Mollinedo Vinicius Schuina Luis Perez.
Microprogrammed Control Chapter11:. Two methods for generating the control signals are: 1)Hardwired control o Sequential logic circuit that generates.
5-1 Chapter 5—Processor Design—Advanced Topics Computer Systems Design and Architecture by V. Heuring and H. Jordan © 1997 V. Heuring and H. Jordan Chapter.
PART 6: (1/2) Enhancing CPU Performance CHAPTER 16: MICROPROGRAMMED CONTROL 1.
Computer Organization CDA 3103 Dr. Hassan Foroosh Dept. of Computer Science UCF © Copyright Hassan Foroosh 2002.
Lecture 15 Microarchitecture Level: Level 1. Microarchitecture Level The level above digital logic level. Job: to implement the ISA level above it. The.
Basic Elements of Processor ALU Registers Internal data pahs External data paths Control Unit.
MICROPROGRAMMED CONTROL
GROUP 2 CHAPTER 16 CONTROL UNIT Group Members ๏ Evelio L. Hernandez ๏ Ashwin Soerdien ๏ Andrew Keiper ๏ Hermes Andino.
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.
Basic Concepts Microinstructions The control unit seems a reasonably simple device. Nevertheless, to implement a control unit as an interconnection of.
Controller Implementation
CS161 – Design and Architecture of Computer Systems
Today’s Agenda Exam 2 Part 2 (11:15am-12:30pm)
Computer Organization and Architecture + Networks
CS161 – Design and Architecture of Computer Systems
Micro-programmed Control
Processor Organization and Architecture
Micro-programmed Control Unit
MICROPROGRAMMED CONTROL
Simple Processor Control Unit
Computer Architecture
Basic Processing Unit Unit- 7 Engineered for Tomorrow CSE, MVJCE.
Controller Implementation--Part II
Controller Implementation--Part I
Some Fundamental Concepts
Processor Organization and Architecture
William Stallings Computer Organization and Architecture 8th Edition
Computer Architecture
Chapter 14 Control Unit Operation
A Discussion on Assemblers
Basic Processing Unit UNIT-5.
CS Fall Controller Implementation - 1
MICROPROGRAMMED CONTROL
MICROPROGRAMMED CONTROL
Presentation transcript:

CS Spring Controller Implementation - 1 Overview Alternative controller FSM implementation approaches based on: –classical Moore and Mealy machines –jump counters –microprogramming (ROM) based approaches –branch sequencers –horizontal microcode –vertical microcode

CS Spring Controller Implementation - 2 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 MSI Functionality: Jump Counters –Counters, Multiplexers, Decoders Microprogramming: ROM-based methods –Direct encoding of next states and outputs

CS Spring Controller Implementation - 3 Random Logic Perhaps poor choice of terms for "classical" FSMs Contrast with structured logic: PAL/PLA, PGA, ROM Could just as easily construct Moore and Mealy machines with these components

CS Spring Controller Implementation - 4 Moore Machine State Diagram Note capture of MBR in these states

CS Spring Controller Implementation - 5 Memory-Register Interface Timing Valid data latched on IF2 to IF3 transition because data must be valid before Wait can go low

CS Spring Controller Implementation - 6 Moore Machine Diagram 16 states, 4 bit state register Next State Logic: 9 Inputs, 4 Outputs Output Logic: 4 Inputs, 18 Outputs These can be implemented via ROM or PAL/PLA Next State: 512 x 4 bit ROM Output: 16 x 18 bit ROM

CS Spring Controller Implementation - 7 Moore Machine State Table ResetWaitIR IR AC Current StateNext StateRegister Transfer Ops 1XXXXXRES (0000) 0XXXXRES (0000)IF0 (0001)0  PC 0XXXXIF0 (0001)IF1 (0001)PC  MAR, PC + 1  PC 00XXXIF1 (0010)IF1 (0010) 01XXXIF1 (0010)IF2 (0011) 01XXXIF2 (0011)IF2 (0011)MAR  Mem, Read, 00XXXIF2 (0011)IF3 (0100)Request, Mem  MBR 00XXXIF3 (0100)IF3 (0100)MBR  IR 01XXXIF3 (0100)OD (0101) 0X00XOD (0101)LD0 (0110) 0X01XOD (0101)ST0 (1001) 0X10XOD (0101)AD0 (1011) 0X11XOD (0101)BR0 (1110)

CS Spring Controller Implementation - 8 ResetWaitIR IR AC Current StateNext StateRegister Transfer Ops 0XXXXLD0 (0110)LD1 (0111)IR  MAR 01XXXLD1 (0111)LD1 (0111)MAR  Mem, Read, 00XXXLD1 (0111)LD2 (1000)Request, Mem  MBR 0XXXXLD2 (1000)IF0 (0001)MBR  AC 0XXXXST0 (1001)ST1 (1010)IR  MAR, AC  MBR 01XXXST1 (1010)ST1 (1010)MAR  Mem, Write, 00XXXST1 (1010)IF0 (0001)Request, MBR  Mem 0XXXXAD0 (1011)AD1 (1100)IR  MAR 01XXXAD1 (1100)AD1 (1100)MAR  Mem, Read, 00XXXAD1 (1100)AD2 (1101)Request, Mem  MBR 0XXXXAD2 (1101)IF0 (0001)MBR + AC  AC 0XXX0BR0 (1110)IF0 (0001) 0XXX1BR0 (1110)BR1 (1111) 0XXXXBR1 (1111)IF0 (0001)IR  PC Moore Machine State Table

CS Spring Controller Implementation - 9 Moore Machine State Transition Table Observations: –Extensive use of Don't Cares –Inputs used only in a small number of state e.g., AC examined only in BR0 state IR 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 Spring Controller Implementation - 10 Moore Machine Implementation Assume PAL/PLA implementation style First idea: run ESPRESSO with naive state assignment.i 9.o 4.ilb reset wait ir15 ir14 ac15 q3 q2 q1 q0.ob p3 p2 p1 p0.p e.i 9.o 4.ilb reset wait ir15 ir14 ac15 q3 q2 q1 q0.ob p3 p2 p1 p0.p e 21 product terms Compare with 512 product terms in ROM implementation!

CS Spring Controller Implementation - 11 Moore Machine Implementation NOVA assignment does better NOVA State Assignment SUMMARY onehot_products = 22 best_products = 18 best_size = 414 states[0]:IF0 Best code: 0000 states[1]:IF1 Best code: 1011 states[2]:IF2 Best code: 1111 states[3]:IF3 Best code: 1101 states[4]:OD Best code: 0001 states[5]:LD0 Best code: 0010 states[6]:LD1 Best code: 0011 states[7]:LD2 Best code: 0100 states[8]:ST0 Best code: 0101 states[9]:ST1 Best code: 0110 states[10]:AD0 Best code: 0111 states[11]:AD1 Best code: 1000 states[12]:AD2 Best code: 1001 states[13]:BR0 Best code: 1010 states[14]:BR1 Best code: 1100 states[15]:RES Best code: product terms improves on 21!

CS Spring Controller Implementation - 12 Synchronizer Circuitry at Inputs and Outputs Synchronizer Circuitry at Inputs and Outputs Synchronous Mealy Machines Standard Mealy Machine has asynchronous outputs These 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

CS Spring Controller Implementation - 13 Synchronous Mealy Machines Case I: Synchronizers at Inputs and Outputs A asserted in Cycle 0, ƒ becomes asserted after 2 cycle delay! This is clearly overkill!

CS Spring Controller Implementation - 14 Synchronous Mealy Machine Case II: Synchronizers on Inputs A asserted in Cycle 0, ƒ follows in next cycle Same as using delayed signal (A') in Cycle 1!

CS Spring Controller Implementation - 15 Synchronous Mealy Machines Case III: Synchronized Outputs A asserted during Cycle 0, ƒ' asserted in next cycle Effect of ƒ delayed one cycle

CS Spring Controller Implementation - 16 Synchronous Mealy Machines Implications for Processor FSM Already Derived Consider inputs: Reset, Wait, IR, AC –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 Spring Controller Implementation - 17 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 < 0, AC  0)

CS Spring Controller Implementation - 18 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 Condition State: stored in AC 

CS Spring Controller Implementation - 19 Time State (Divide & Conquer) Generation of Microoperations 0  PC: Reset PC + 1  PC: T0 PC  MAR: T0 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  MAR: T5 (LD + ST + ADD) IR  PC: T6 BRN 1  Read/Write: T2 + T6 (LD + ADD) 0  Read/Write: T6 ST 1  Request: T2 + T6 (LD + ST + ADD)

CS Spring Controller Implementation - 20 Jump Counter Concept Implement FSM using MSI functionality: counters, mux, decoders Pure jump counter: only one of four possible next states Single "Jump State" function of the current state Hybrid jump counter: Multiple "Jump States" — function of current state + inputs

CS Spring Controller Implementation - 21 Jump Counters Pure Jump Counter Logic blocks implemented via discrete logic, PALs/PLAs, ROMs NOTE: No inputs to jump state logic

CS Spring Controller Implementation - 22 Jump Counters Problem with Pure Jump Counter Difficult to implement multi-way branches Logical State Diagram Pure Jump Counter State Diagram Extra States:

CS Spring Controller Implementation - 23 Jump Counters Hybrid Jump Counter Load inputs are function of state and FSM inputs

CS Spring Controller Implementation - 24 Jump Counters Implementation Example State assignment attempts to take advantage of sequential states

CS Spring Controller Implementation - 25 Jump Counters Implementation Example, Continued CNT = (s0 + s5 + s8 + s10) + Wait (s1 + s3) + Wait (s2 + s6 + s9 + s11) CNT = Wait (s1 + s3) + Wait (s2 + s6 + s9 + s11) CLR = Reset + s7 + s12 + s13 + (s9 Wait) CLR = Reset s7 s12 s13 (s9 + Wait) LD = s4 Address Contents (Symbolic State) 0101 (LD0) 1000 (ST0) 1010 (AD0) 1101 (BR0) Contents of Jump State ROM

CS Spring Controller Implementation - 26 Jump Counters Implementation Example, continued Implement CNT using active lo PAL NOTE: Active lo outputs from decoder Implement CLR

CS Spring Controller Implementation - 27 Jump Counter CLR, CNT, LD implemented via Mux Logic Active Lo outputs: hi input inverted at the output Note that CNT is active hi on counter so invert MUX inputs! CLR = CLRm + Reset

CS Spring Controller Implementation - 28 Jump Counters Microoperation implementation 0  PC = Reset PC + 1  PC = S0 PC  MAR = S0 MAR  Memory Address Bus = Wait(S1 + S2 + S5 + S6 + S8 + S9 + S11 + S12) Memory Data Bus  MBR = Wait(S2 + S6 + S11) MBR  Memory Data Bus = Wait(S8 + S9) MBR  IR = WaitS3 MBR  AC = WaitS7 AC  MBR = IR15IR14S4 AC + MBR  AC = WaitS12 IR  MAR = (IR15IR14 + IR15IR14 + IR15IR14)S4 IR  PC = AC15S13 1  Read/Write = Wait(S1 + S2 + S5 + S6 + S11 + S12) 0  Read/Write = Wait(S8 + S9) 1  Request = Wait(S1 + S2 + S5 + S6 + S8 + S9 + S11 + S12) 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 Spring Controller Implementation - 29 Branch Sequencers Concept Implement Next State Logic via ROM Address ROM with current state and inputs Problem: ROM doubles in size for each additional input Note: Jump counter trades off ROM size vs. external logic Only jump states kept in ROM Even in hybrid approach, state + input subset form ROM address Branch Sequencer: between the extremes Next State stored in ROM Each state limited to small number of next states Always a power of 2 Observe: only a small set of inputs are examined in any state

CS Spring Controller Implementation - 30 Branch Sequencers 4 Way Branch Sequencer Current State selects two inputs to form part of ROM address These select one of four possible next states (and output sets) Every state has exactly four possible next states Mux I n p u t s 64 Word ROM   state x11 x10 x01 x00 Z Y X W C o n t r o l S i g n a l s a0 a1 a2 a3 a4 a5 N WX Y Z 

CS Spring Controller Implementation - 31 Branch Sequencer Processor CPU Design Example Alpha, Beta multiplexer input setup

CS Spring Controller Implementation - 32 Example Processor FSM ROM ADDRESSROM CONTENTS (Reset, Current State, a, b)Next StateRegister Transfer Operations RES00000XX0001 (IF0)PC  MAR, PC + 1  PC IF (IF0) (IF1)MAR  Mem, Read, Request IF (IF2)MAR  Mem, Read, Request (IF1)Mem  MBR IF (IF2) (OD)MBR  IR OD (LD0)IR  MAR (ST0)IR  MAR, AC  MBR (AD0)IR  MAR (BR0)IR  MAR

CS Spring Controller Implementation - 33 Example Processor FSM ROM ADDRESSROM CONTENTS (Reset, Current State, a, b)Next StateRegister Transfer Operations LD000101XX0110 (LD1)MAR  Mem, Read, Request LD (LD2)Mem  MBR (LD1)MAR  Mem, Read, Request LD200111XX0000 (RES)MBR  AC ST001000XX1001 (ST1)MAR  Mem, Write, Request, MBR  Mem ST (RES) (ST1)MAR  Mem, Write, Request, MBR  Mem AD001010XX1011 (AD1)MAR  Mem, Read, Request AD (AD2) (AD1)MAR  Mem, Read, Request AD201100XX0000 (RES)MBR + AC  AC BR (RES) (RES)IR  PC

CS Spring Controller Implementation - 34 Branch Sequencers Alternative Horizontal Implementation Input MUX controlled by encoded signals, not state Much fewer inputs than unique states! In example FSM, input MUX can be 2:1! Adding length to ROM word saves on bits vs. doubling words Vertical format: (14 + 4) x 64 = 1152 ROM bits Horizontal format: ( x 4 + 2) x 16 = 512 ROM bits

CS Spring Controller Implementation - 35 Microprogramming How to organize the control signals Implement control signals by storing 1's and 0's in a ROM Horizontal vs. vertical microprogramming Horizontal: 1 ROM output for each control signal Vertical: encoded control signals in ROM, decoded externally some mutually exclusive signals can be combined helps reduce ROM length

CS Spring Controller Implementation - 36 Microprogramming Register Transfer/Microoperations 14 Register Transfer operations become 22 Microoperations: PC  ABUS IR  ABUS MBR  ABUS RBUS  AC AC  ALU A MBUS  ALU B ALU ADD ALU PASS B MAR  Address Bus MBR  Data Bus ABUS  IR ABUS  MAR Data Bus  MBR RBUS  MBR MBR  MBUS 0  PC PC + 1  PC ABUS  PC Read/Write Request AC  RBUS ALU Result  RBUS

CS Spring Controller Implementation - 37 Horizontal Microprogramming Horizontal Branch Sequencer  Mux bits 4 x 4 Next State bits 22 Control operation bits 40 bits total

CS Spring Controller Implementation - 38 Horizontal Microprogramming Moore Processor ROM Alpha inputs: 0 = Wait, 1 = IR Beta inputs: 0 = AC, 1 = IR

CS Spring Controller Implementation - 39 Horizontal Microprogramming Advantages: most flexibility -- complete parallel access to datapath control points Disadvantages: very long control words bits for real processors Output Encodings: Group mutually exclusive signals Use external logic to decode NOTE: Not all microoperation combinations make sense! Example: 0  PC, PC + 1  PC, ABUS  PC mutually exclusive Save ROM bit with external 2:4 Decoder

CS Spring Controller Implementation - 40 Horizontal Microprogramming Partially Encoded Control Outputs

CS Spring Controller Implementation - 41 More extensive encoding to reduce ROM word length Typically use multiple microword formats: –Horizontal microcode -- next state + control bits in same word –Separate formats for control outputs and "branch jumps" –may require several microwords in a sequence to implement same function as single horizontal word In the extreme, very much like assembly language programming Vertical Microprogramming

CS Spring Controller Implementation - 42 Vertical Microprogramming Branch Jump Compare indicated signal to 0 or 1 Register Transfer Source, Destination, Operation 10 ROM Bits

CS Spring Controller Implementation - 43 Vertical Microprogramming ROM ADDRESSSYMBOLIC CONTENTSBINARY CONTENTS RESRTPC  MAR, PC +1  PC IF0RTMAR  M, Read BJWait=0, IF IF1RTMAR  M, M  MBR, Read BJWait=1, IF IF2RTMBR  IR BJWait=0, IF RTIR  MAR ODBJIR =1, OD BJIR =1, ST LD0RTMAR  M, Read LD1RTMAR  M, M  MBR, Read BJWait=1, LD LD2RTMBR  AC BJWait=0, RES BJWait=1, RES

CS Spring Controller Implementation - 44 Vertical Microprogramming ROM ADDRESSSYMBOLIC CONTENTSBINARY CONTENTS ST0RTAC  MBR RTMAR  M, MBR  M, Write ST1RTMAR  M, MBR  M, Write BJWait=0, RES BJWait=1, ST OD1BJIR =1, BR AD0RTMAR  M, Read AD1RTMAR  M, M  MBR, Read BJWait=1, AD AD2RTAC + MBR  AC BJWait=0, RES BJWait=1, RES BR0BJAC =0, RES RTIR  PC BJAC =1, RES words x 10 ROM bits = 310 bits total versus 16 x 38 = 608 bits horizontal

CS Spring Controller Implementation - 45 Vertical Programming Controller Block Diagram

CS Spring Controller Implementation - 46 Vertical Microprogramming Condition Logic

CS Spring Controller Implementation - 47 Vertical Microprogramming Writeable Control Store –Part of control store addresses map into RAM »Allows assembly language programmer to implement own instructions »Extend "native" instruction set with application specific instructions »Requires considerable sophistication to write microcode »Not a popular approach with today's processors –Make the native instruction set simple and fast –Write "higher level" functions as assembly language sequences

CS Spring Controller Implementation - 48 Controller Implementation Summary Control Unit Organization –Register transfer operation –Classical Moore and Mealy machines –Time State Approach –Jump Counter –Branch Sequencers –Horizontal and Vertical Microprogramming