Exam 2 Review Two’s Complement Arithmetic Ripple carry ALU logic and performance Look-ahead techniques Basic multiplication and division ( non- restoring)

Slides:



Advertisements
Similar presentations
1 Datapath and Control (Multicycle datapath) CDA 3101 Discussion Section 11.
Advertisements

CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.
Week 11Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 11: Microprogramming [Adapted from Dave Patterson’s UCB CS152.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
Class 9.1 Computer Architecture - HUJI Computer Architecture Class 9 Microprogramming.
EECC550 - Shaaban #1 Lec # 6 Winter Control may be designed using one of several initial representations. The choice of sequence control,
S. Barua – CPSC 440 CHAPTER 5 THE PROCESSOR: DATAPATH AND CONTROL Goals – Understand how the various.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
EECS 322: Computer Architecture
1 Computer Organization & Design Microcode for Control Sec. 5.7 (CDROM) Appendix C (CDROM) / / pdf / lec_3a_notes.pdf.
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
1 CS/COE0447 Computer Organization & Assembly Language Multi-Cycle Execution.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
Gary MarsdenSlide 1University of Cape Town Stages.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
Overview of Control Hardware Development
Multicycle Implementation
EEM 486: Computer Architecture Lecture 3 Designing Single Cycle Control.
Single Cycle Controller Design
CDA 3101 Spring 2016 Introduction to Computer Organization Microprogramming and Exceptions 08 March 2016.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Design a MIPS Processor (II)
Access the Instruction from Memory
EE204 Computer Architecture
CS161 – Design and Architecture of Computer Systems
Exceptions Another form of control hazard Could be caused by…
IT 251 Computer Organization and Architecture
/ Computer Architecture and Design
Systems Architecture I
Computer Organization & Design Microcode for Control Sec. 5
Extensions to the Multicycle CPU
CS/COE0447 Computer Organization & Assembly Language
Multiple Cycle Implementation of MIPS-Lite CPU
CS/COE0447 Computer Organization & Assembly Language
CSCE 212 Chapter 5 The Processor: Datapath and Control
Processor: Finite State Machine & Microprogramming
Computer Architecture
Single-Cycle CPU DataPath.
Chapter Five The Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
The Multicycle Implementation
Vishwani D. Agrawal James J. Danaher Professor
Processor: Datapath and Control (part 2)
Computer Organization Ellen Walker Hiram College
Datapath & Control MIPS
Chapter Five The Processor: Datapath and Control
CSE 331 Computer Organization and Design Fall 2007 Week 12
Systems Architecture I
CpE 442 Microprogramming and Exceptions
Vishwani D. Agrawal James J. Danaher Professor
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Processor: Multi-Cycle Datapath & Control
Access the Instruction from Memory
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Multi-Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Review Fig 4.15 page 320 / Fig page 322
Datapath and Control Exceptions
CS/COE0447 Computer Organization & Assembly Language
Systems Architecture I
Alternative datapath (book): Multiple Cycle Datapath
Control Implementation Alternatives For Multi-Cycle CPUs
COMS 361 Computer Organization
Processor: Datapath and Control
CS161 – Design and Architecture of Computer Systems
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Exam 2 Review Two’s Complement Arithmetic Ripple carry ALU logic and performance Look-ahead techniques Basic multiplication and division ( non- restoring) algorithms IEEE 754 floating point standard (definition provided) Write a sequence of register transfers to implement a given instruction for MIPS Given a set of Register Transfers, design the control needed for some component

S0 M[PC] IR, PC + 4 PC,S1 S S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 S S2 A + sign_ext(IR[15-0]) ALUOut, ‘LW’S3 + ‘SW’S5 S S3 M[ ALUOut] MDR, S4 S S4 MDR R[ IR[20-16]], S0 S S5 B M[ ALUOut], S0 S S6 A op B ALUOut, S7 S S7 ALUOut R[IR[15-11]], S0 S S8 Zero PC + Zero ALUOut PC, S0 S S9 PC[31-28] : shlt2(IR[25-0]) PC, S0 S State Register Transfers

Next State Function with a Sequencer 16 Control Lines ROM PLA STATE Adder 1 Addr Select logic Op(5 –0) AddrCtl Looks like a Computer !

Microprogramming Define a symbolic set of microinstructions used to implement each instruction

Microprogramming Define a symbolic set of microinstructions used to implement each instruction The microassembler will check for inconsistencies and convert to binary code

Microprogramming Define a symbolic set of microinstructions used to implement each instruction The microassembler will check for inconsistencies and convert to binary code Define independent fields to determine datapath control signals that must be asserted

Microprogramming Define a symbolic set of microinstructions used to implement each instruction The microassembler will check for inconsistencies and convert to binary code Define independent fields to determine datapath control signals that must be asserted Define a field to determine the next state

Microinstruction Design Label Label controls microcode sequencing Location of entry points Used for sequencing Value can be any string Note: A numeric last character is special for dispatching

IR MDR ALU Control

Microinstruction Design ALU Label control ALU control Add Subt Func – Use funct field of Op to define operation

Microinstruction Design ALU Label control SRC1 SRC2 ALU control Add Subt Func – Use funct field of Op to define operation SRC1 # Select first ALU input PC A SRC2 # Select second ALU input B 4 Extend # sign extended (imm16) Extshft # shift left 2 [sign extended (imm16)]

IR MDR Register Control

Microinstruction Design ALU Register Label control SRC1 SRC2 control Register control Read# Read Reg(rs) into A, Reg(rt) into B Write ALU# Write ALUOut into Reg(rd) Write MDR# Write MDR into Reg(rt)

IR MDR Memory Control

Microinstruction Design ALU Register Label control SRC1 SRC2 control Memory Memory Read PC# Read M[PC] into IR ( and MDR) Read ALU# Read M[ALUOut] into MDR Write ALU # Write B into M[ALUOut]

IR MDR PCWrite Control

Microinstruction Design ALU Register PCWrite Label control SRC1 SRC2 control Memory control PCWrite control ALU # Load ALU result into PC ALUOut-cond # If Zero = 1, load ALUOut into PC Jump # Load jump address into PC

Microinstruction Design ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Sequencing Seq# Go to next microinstruction in sequence Fetch# Go to microinstruction with Label “Fetch” Dispatch i# Dispatch with ROM i

Microinstruction Design ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Sequencing Seq# Go to next microinstruction in sequence Fetch# Go to microinstruction with Label “Fetch” Dispatch i# Dispatch with ROM i See Summary Of Microcode Fields page C-29

Basic steps all instructions execute 1.Access the Instruction from Memory 2.Decode Instruction and Access the Data from Registers 3. Perform the Instruction 4. Write the Result

S0 M[PC] IR, PC + 4 PC,S1 S S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 S S2 A + sign_ext(IR[15-0]) ALUOut, ‘LW’S3 + ‘SW’S5 S S3 M[ ALUOut] MDR, S4 S S4 MDR R[ IR[20-16]], S0 S S5 B M[ ALUOut], S0 S S6 A op B ALUOut, S7 S S7 ALUOut R[IR[15-11]], S0 S S8 Zero PC + Zero ALUOut PC, S0 S S9 PC[31-28] : shlt2(IR[25-0]) PC, S0 S State Register Transfers

S0 M[PC] IR, PC + 4 PC,S1 S State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch

S0 M[PC] IR, PC + 4 PC,S1 S State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add

S0 M[PC] IR, PC + 4 PC,S1 S State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4

S0 M[PC] IR, PC + 4 PC,S1 S State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC

S0 M[PC] IR, PC + 4 PC,S1 S State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU

S0 M[PC] IR, PC + 4 PC,S1 S State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq

State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 S

State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 S

State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 S

State Register Transfers ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 S Dispatch 1 Op Code Label lw or swMem1 R – typeRformat1 beqBEQ1 jJUMP1

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing lw rt, imm16 (rs) or sw rt, imm16 ( rs) M[ R[rs] + sign_ext(imm16) ] R[rt] R[rt] M[ R[rs] + sign_ext(imm16) ] Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Mem1

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing lw rt, imm16 (rs) or sw rt, imm16 ( rs) M[ R[rs] + sign_ext(imm16) ] R[rt] R[rt] M[ R[rs] + sign_ext(imm16) ] Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Mem1 Add A Extend Dispatch 2

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing lw rt, imm16 (rs) or sw rt, imm16 ( rs) M[ R[rs] + sign_ext(imm16) ] R[rt] R[rt] M[ R[rs] + sign_ext(imm16) ] Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Mem1 Add A Extend Dispatch 2 LW2 Read ALU Seq Write MDR Fetch

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing lw rt, imm16 (rs) or sw rt, imm16 ( rs) M[ R[rs] + sign_ext(imm16) ] R[rt] R[rt] M[ R[rs] + sign_ext(imm16) ] Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Mem1 Add A Extend Dispatch 2 LW2 Read ALU Seq Write MDR Fetch SW2 Write ALU Fetch

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Rfmat1 op rd, rs, rt R – Arithmetic – Logic Instruction R[rs] op R[rt] R [rd]

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Rfmat1 Func A B Seq op rd, rs, rt R – Arithmetic – Logic Instruction R[rs] op R[rt] R [rd]

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Rfmat1 Func A B Seq Write ALU Fetch op rd, rs, rt R – Arithmetic – Logic Instruction R[rs] op R[rt] R [rd]

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 BEQ1 beq rs, rt, imm16 I -type Zero (PC+4) + Zero SUM[ (ShLt2[Sign_Ext(imm16)])+PC+4] PC Zero =1 iff rs - rt = 0

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 BEQ1 Subt A B beq rs, rt, imm16 I -type Zero (PC+4) + Zero SUM[ (ShLt2[Sign_Ext(imm16)])+PC+4] PC Zero =1 iff rs - rt = 0

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 BEQ1 Subt A B ALUOut-con Fetch beq rs, rt, imm16 I -type Zero (PC+4) + Zero SUM[ (ShLt2[Sign_Ext(imm16)])+PC+4] PC Zero =1 iff rs - rt = 0

ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 JUMP1 Jump Addr Fetch j Label go to Label

Microinstruction Design ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Mem1 Add A Extend Dispatch 2 LW2 Read ALU Seq Write MDR Fetch SW2 Write ALU Fetch Rfmat1 Func A B Seq Write ALU Fetch BEQ1 Subt A B ALUOut-con Fetch JUMP1 Jump Addr Fetch

Each field in the microinstruction implies a set of control signals to be asserted. See fig C.21 p.C-29 Implementing the microprogram

Each field in the microinstruction implies a set of control signals to be asserted. See fig C.21 p.C-29 If a field that affects a state (memory) is blank, then no control signal should be active. Implementing the microprogram

Each field in the microinstruction implies a set of control signals to be asserted. See fig C.21 p.C-29 If a field that affects a state (memory) is blank, then no control signal should be active. If a field that affects a mux or ALU operation is blank, the output is not used, so it is a “don’t care”. Implementing the microprogram

Each field in the microinstruction implies a set of control signals to be asserted. See fig C.21 p.C-29 If a field that affects a state (memory) is blank, then no control signal should be active. If a field that affects a mux or ALU operation is blank, the output is not used, so it is a “don’t care”. The microcode assembler 1. Converts the symbolic fields to a truth table for the control signals [ microcode ] 2. Resolves labels to addresses 3. Builds the Dispatch ROM code Implementing the microprogram

Microprogram Assembler Microcode ROM Fabrication Control ROM

16 Control Lines Control ROM [Microcode] Micro Counter Adder 1 Addr Select logic Op(5 –0) AddrCtl Contains Dispatch ROM 1 Dispatch ROM 2

addi – Add Immediate addi $s1, $s2, 100 # $s1 = $s rs rt imm ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 ADDI1 Add ? ? Expand Dispatch 1

addi – Add Immediate addi $s1, $s2, 100 # $s1 = $s rs rt imm ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 ADDI1 Add A Extend Seq

addi – Add Immediate addi $s1, $s2, 100 # $s1 = $s rs rt imm ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 ADDI1 Add A Extend Seq ? Write ALU uses rd field !

addi – Add Immediate addi $s1, $s2, 100 # $s1 = $s rs rt imm ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 ADDI1 Add A Extend Seq Write ALU rt Fetch Write ALU uses rd field ! Define: Write ALU rt = Write Reg[rt] with ALUOut

Design Tools Register Transfer Language Initial Finite State Microprogram Representation Diagram Sequencing Explicit next- Microprogram Control State Function Counter + Dispatch ROMs Logic Logic Truth Representation Equations Tables Implementation Programable Read – Only Technique Logic Arrays Memory

Exceptions are unexpected or error events. Ex: Undefined instruction Arithmetic overflow

Exceptions are unexpected or error events. Ex: Undefined instruction Arithmetic overflow EPC: Exception Program Counter A 32 bit register to hold the address of the affected instruction

Exceptions are unexpected or error events. Ex: Undefined instruction Arithmetic overflow EPC: Exception Program Counter A 32 bit register to hold the address of the affected instruction Cause: A 32 bit register to record the cause of the exception.( Option is to vector into OS) Undefined instruction = 0 Arithmetic overflow = 1 OS entry point for exception handling = C hex

Undefined instruction Save Address in EPC, Load 0 in Cause, Jump to C S0 M[PC] IR, PC + 4 PC,S1 S S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 S

Undefined instruction Save Address in EPC, Load 0 in Cause, Jump to C S0 M[PC] IR, PC + 4 PC,S1 S S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 + ‘Other’S10 S S10

Undefined instruction Save Address in EPC, Load 0 in Cause, Jump to C S0 M[PC] IR, PC + 4 PC,S1 S S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 + ‘Other’S10 S S10 PC – 4 EPC,

Undefined instruction Save Address in EPC, Load 0 in Cause, Jump to C S0 M[PC] IR, PC + 4 PC,S1 S S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 + ‘Other’S10 S S10 PC – 4 EPC, 0 Cause,

Undefined instruction Save Address in EPC, Load 0 in Cause, Jump to C S0 M[PC] IR, PC + 4 PC,S1 S S1 R[IR[25-21]] A, R[IR[20-16]] B, PC + shlt2[sign_ext(IR[15-0])] ALUOut, (‘LW’+’SW’)S2 + ‘R’S6 + ‘BEQ’S8 + ‘J’S9 + ‘Other’S10 S S10 PC – 4 EPC, 0 Cause, C PC, S0 S