Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 150 - Fall 2005 – Lec #15: Microprogramming - 1 Controller Implementation--Part II Alternative controller FSM implementation approaches based on: –Classical.

Similar presentations


Presentation on theme: "CS 150 - Fall 2005 – Lec #15: Microprogramming - 1 Controller Implementation--Part II Alternative controller FSM implementation approaches based on: –Classical."— Presentation transcript:

1 CS 150 - Fall 2005 – Lec #15: Microprogramming - 1 Controller Implementation--Part II Alternative controller FSM implementation approaches based on: –Classical Moore and Mealy machines –Time-State: Divide and Conquer –Jump counters –Microprogramming (ROM) based approaches »Branch sequencers »Horizontal microcode »Vertical microcode

2 CS 150 - Fall 2005 – Lec #15: Microprogramming - 2 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

3 CS 150 - Fall 2005 – Lec #15: Microprogramming - 3 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 

4 CS 150 - Fall 2005 – Lec #15: Microprogramming - 4 Branch Sequencer Processor CPU Design Example Alpha, Beta multiplexer input setup

5 CS 150 - Fall 2005 – Lec #15: Microprogramming - 5 Example Processor FSM ROM ADDRESSROM CONTENTS (Reset, Current State, a, b)Next StateRegister Transfer Operations RES00000XX0001 (IF0)PC  MAR, PC + 1  PC IF000001000001 (IF0) 00001110010 (IF1)MAR  Mem, Read, Request IF100010000011 (IF2)MAR  Mem, Read, Request 00010110010 (IF1)Mem  MBR IF200011000011 (IF2) 00011110100 (OD)MBR  IR OD00100000101 (LD0)IR  MAR 00100011000 (ST0)IR  MAR, AC  MBR 00100101001 (AD0)IR  MAR 00100111101 (BR0)IR  MAR

6 CS 150 - Fall 2005 – Lec #15: Microprogramming - 6 Example Processor FSM ROM ADDRESSROM CONTENTS (Reset, Current State, a, b)Next StateRegister Transfer Operations LD000101XX0110 (LD1)MAR  Mem, Read, Request LD100110000111 (LD2)Mem  MBR 00110110110 (LD1)MAR  Mem, Read, Request LD200111XX0000 (RES)MBR  AC ST001000XX1001 (ST1)MAR  Mem, Write, Request, MBR  Mem ST101001000000 (RES) 01001111001 (ST1)MAR  Mem, Write, Request, MBR  Mem AD001010XX1011 (AD1)MAR  Mem, Read, Request AD101011001100 (AD2) 01011111011 (AD1)MAR  Mem, Read, Request AD201100XX0000 (RES)MBR + AC  AC BR001101000000 (RES) 01101110000 (RES)IR  PC

7 CS 150 - Fall 2005 – Lec #15: Microprogramming - 7 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: (14 + 4 x 4 + 2) x 16 = 512 ROM bits

8 CS 150 - Fall 2005 – Lec #15: Microprogramming - 8 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

9 CS 150 - Fall 2005 – Lec #15: Microprogramming - 9 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

10 CS 150 - Fall 2005 – Lec #15: Microprogramming - 10 Horizontal Microprogramming Horizontal Branch Sequencer  Mux bits 4 x 4 Next State bits 22 Control operation bits 40 bits total Next States A0 A1A2A3  mux  ALU PASS BMAR  Address Bus MBR  Data Bus ABUS  IR ABUS  MAR Data Bus  MBR RBUS  MBR  MBUS PC  ABUS IR  ABUS MBR  ABUS RBUS  AC  ALU A MBUS  ALU B ALU ADD 0  PC PC + 1  PC ABUS  PC Read/Write Request AC  RBUS ALU Result  RBUS

11 CS 150 - Fall 2005 – Lec #15: Microprogramming - 11 Horizontal Microprogramming Moore Processor ROM Alpha inputs: 0 = Wait, 1 = IR Beta inputs: 0 = AC, 1 = IR Current State (Address) RES (0000) IF0 (0001) IF1 (0010) IF2 (0011) IF3 (0100) OD (0101) LD0 (0110) LD1 (0111) LD2 (1000) ST0 (1001) ST1 (1010) AD0 (1011) AD1 (1100) AD2 (1101) BR0 (1110) BR1 (1111) ABUS  IR ABUS  MAR Data Bus  MBR RBUS  MBR  MBUS 0  PC PC + 1  PC ABUS  PC Read/Write Request AC  RBUS ALU Result  RBUS 0 1 0 0 1 0 0001 0010 0100 0110 0111 1000 0001 1010 0001 1100 1101 0001 0010 0100 1001 0111 1000 0001 1010 0001 1100 1101 0001 1111 0001 0010 0011 0101 1011 0111 0001 1010 1100 0001 0010 0011 0101 1110 0111 0001 1010 1100 0001 1111 0001 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 Next States A0A1A2A3  mux  0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ALU ADD ALU PASS BMAR  Address Bus MBR  Data Bus PC  ABUS IR  ABUS MBR  ABUS RBUS  AC  ALU A MBUS  ALU B

12 CS 150 - Fall 2005 – Lec #15: Microprogramming - 12 Horizontal Microprogramming Advantages: most flexibility -- complete parallel access to datapath control points Disadvantages: very long control words -- 100+ 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

13 CS 150 - Fall 2005 – Lec #15: Microprogramming - 13 Horizontal Microprogramming Partially Encoded Control Outputs

14 CS 150 - Fall 2005 – Lec #15: Microprogramming - 14 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

15 CS 150 - Fall 2005 – Lec #15: Microprogramming - 15 Vertical Microprogramming Branch Jump Compare indicated signal to 0 or 1 Register Transfer Source, Destination, Operation 10 ROM Bits

16 CS 150 - Fall 2005 – Lec #15: Microprogramming - 16 Vertical Microprogramming ROM ADDRESSSYMBOLIC CONTENTSBINARY CONTENTS 000000RESRTPC  MAR, PC +1  PC0001011100 000001IF0RTMAR  M, Read0100000101 000010BJWait=0, IF01000000001 000011IF1RTMAR  M, M  MBR, Read0100100101 000100BJWait=1, IF11001000011 000101IF2RTMBR  IR0011010000 000110BJWait=0, IF21000000101 000111RTIR  MAR0010011000 001000ODBJIR =1, OD11101010101 001001BJIR =1, ST01111010000 001010LD0RTMAR  M, Read0100000101 001011LD1RTMAR  M, M  MBR, Read0100100101 001100BJWait=1, LD11001001011 001101LD2RTMBR  AC0110001010 001110BJWait=0, RES1000000000 001111BJWait=1, RES1001000000

17 CS 150 - Fall 2005 – Lec #15: Microprogramming - 17 Vertical Microprogramming ROM ADDRESSSYMBOLIC CONTENTSBINARY CONTENTS 010000ST0RTAC  MBR0101101000 010001RTMAR  M, MBR  M, Write0100111110 010010ST1RTMAR  M, MBR  M, Write0100111110 010011BJWait=0, RES1000000000 010100BJWait=1, ST11001010010 010101OD1BJIR =1, BR01111011101 010110AD0RTMAR  M, Read0100000101 010111AD1RTMAR  M, M  MBR, Read0100100101 011000BJWait=1, AD11001010111 011001AD2RTAC + MBR  AC0110001001 011010BJWait=0, RES1000000000 011011BJWait=1, RES1000000000 011100BR0BJAC =0, RES1010000000 011101RTIR  PC0010110000 011110BJAC =1, RES1011000000 31 words x 10 ROM bits = 310 bits total versus 16 x 38 = 608 bits horizontal

18 CS 150 - Fall 2005 – Lec #15: Microprogramming - 18 Vertical Programming Controller Block Diagram

19 CS 150 - Fall 2005 – Lec #15: Microprogramming - 19 Vertical Microprogramming Condition Logic

20 CS 150 - Fall 2005 – Lec #15: Microprogramming - 20 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

21 CS 150 - Fall 2005 – Lec #15: Microprogramming - 21 Controller Implementation Summary-- Part II Control Unit Organization –Register transfer operation –Classical Moore and Mealy machines –Time State Approach –Jump Counter –Branch Sequencers –Horizontal and Vertical Microprogramming


Download ppt "CS 150 - Fall 2005 – Lec #15: Microprogramming - 1 Controller Implementation--Part II Alternative controller FSM implementation approaches based on: –Classical."

Similar presentations


Ads by Google