EECC550 - Shaaban #1 Selected Chapter 5 For More Practice Exercises Winter 2005 1-19-2006 The MIPS jump and link instruction, jal is used to support procedure.

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)
EECC550 - Shaaban #1 Lec # 4 Summer Major CPU Design Steps 1Using independent RTN, write the micro- operations required for all target ISA.
The Processor: Datapath & Control
EECC550 - Shaaban #1 Lec # 5 Winter Major CPU Design Steps 1. Analyze instruction set operations using independent RTN ISA => RTN => datapath.
EECC550 - Shaaban #1 Lec # 5 Winter CPU Design Steps 1. Analyze instruction set operations using independent ISA => RTN => datapath requirements.
Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.
Processor II CPSC 321 Andreas Klappenecker. Midterm 1 Tuesday, October 5 Thursday, October 7 Advantage: less material Disadvantage: less preparation time.
CPU Organization (Design)
EECC550 - Shaaban #1 Lec # 5 Winter CPU Design Steps 1. Analyze instruction set operations using independent RTN => datapath requirements.
EECC550 - Shaaban #1 Lec # 5 Winter CPU Design Steps 1. Analyze instruction set operations using independent RTN => datapath requirements.
EECC550 - Shaaban #1 Lec # 4 Winter CPU Organization Datapath Design: –Capabilities & performance characteristics of principal Functional.
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
331 Lec 14.1Fall 2002 Review: Abstract Implementation View  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions:
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
ECE 232 L13. Control.1 ©UCB, DAP’ 97 ECE 232 Hardware Organization and Design Lecture 13 Control Design
Computer Structure - Datapath and Control Goal: Design a Datapath  We will design the datapath of a processor that includes a subset of the MIPS instruction.
EECC550 - Shaaban #1 Lec # 4 Winter CPU Organization (Design) Datapath Design: –Capabilities & performance characteristics of principal.
EECC550 - Shaaban #1 Lec # 4 Winter CPU Organization (Design) Datapath Design: –Capabilities & performance characteristics of principal.
EECC550 - Shaaban #1 Lec # 4 Winter Major CPU Design Steps 1Using independent RTN, write the micro- operations required for all target.
EECC550 - Shaaban #1 Lec # 5 Winter Major CPU Design Steps 1. Analyze instruction set operations using independent RTN ISA => RTN => datapath.
Datapath and Control Andreas Klappenecker CPSC321 Computer Architecture.
EECC550 - Shaaban #1 Lec # 5 Spring CPU Design Steps 1. Analyze instruction set operations using independent RTN => datapath requirements.
Major CPU Design Steps 1. Analyze instruction set operations using independent RTN ISA => RTN => datapath requirements. This provides the the required.
EECC550 - Shaaban #1 Lec # 5 Spring CPU Design Steps 1. Analyze instruction set operations using independent RTN => datapath requirements.
The Processor: Datapath & Control. Implementing Instructions Simplified instruction set memory-reference instructions: lw, sw arithmetic-logical instructions:
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
CASE STUDY OF A MULTYCYCLE DATAPATH. Alternative Multiple Cycle Datapath (In Textbook) Minimizes Hardware: 1 memory, 1 ALU Ideal Memory Din Address 32.
EEM 486: Computer Architecture Designing a Single Cycle Datapath.
CDA 3101 Fall 2013 Introduction to Computer Organization Multicycle Datapath 9 October 2013.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
CS3350B Computer Architecture Winter 2015 Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2) Marc Moreno Maza [Adapted.
EECC550 - Shaaban #1 Lec # 4 Winter CPU Organization (Design) Datapath Design: –Capabilities & performance characteristics of principal.
MIPS processor continued. In Class Exercise Question Show the datapath of a processor that supports only R-type and jr reg instructions.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
EECC550 - Shaaban #1 Midterm Review Winter Midterm Questions Overview Four questions from the following: Performance Evaluation: –Given.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
MIPS processor continued
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
EEM 486: Computer Architecture Lecture 3 Designing Single Cycle Control.
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single-Cycle CPU Datapath & Control Part 2 Instructors: Krste Asanovic & Vladimir Stojanovic.
Single Cycle Controller Design
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
CS161 – Design and Architecture of Computer Systems
Problem with Single Cycle Processor Design
Computer Architecture
Single Cycle Processor
Processor (I).
CS/COE0447 Computer Organization & Assembly Language
MIPS processor continued
CPU Organization (Design)
Design of the Control Unit for One-cycle Instruction Execution
CSCI206 - Computer Organization & Programming
Datapath & Control MIPS
The Processor Lecture 3.2: Building a Datapath with Control
Datapath: Instruction Store/Fetch & PC Increment
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
Access the Instruction from Memory
Review Fig 4.15 page 320 / Fig page 322
MIPS processor continued
Instructors: Randy H. Katz David A. Patterson
The Processor: Datapath & Control.
COMS 361 Computer Organization
Processor: Datapath and Control
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

EECC550 - Shaaban #1 Selected Chapter 5 For More Practice Exercises Winter The MIPS jump and link instruction, jal is used to support procedure calls by jumping to jump address (similar to j ) and saving the address of the following instruction PC+4 in register $ra ($31) jal Address jal uses the j instruction format: We wish to add jal to the single cycle datapath in Figure 5.24 page 314. Add any necessary datapaths and control signals to the single-clock datapath and justify the need for the modifications, if any. Specify control line values for this instruction. Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20) op (6 bits) Target address (26 bits)

EECC550 - Shaaban #2 Selected Chapter 5 For More Practice Exercises Winter Instruction Word  Mem[PC] R[31]  PC + 4 PC  Jump Address Exercise 5.20: jump and link, jal support to Single Cycle Datapath (For More Practice Exercise 5.20) PC + 4 Jump Address PC + 4 rs rt rd imm16 R[rs] R[rt] Branch Target PC + 4

EECC550 - Shaaban #3 Selected Chapter 5 For More Practice Exercises Winter Memto- Reg Mem Mem RegDst ALUSrc Reg Write Read Write Branch ALUOp1 ALUOp0 Jump R-format lw sw xx 1 xx beq xx 0 xx J xx x xx x x x 1 JAL 10 x x x x 1 Adding Control Lines Settings for jal (For Textbook Single Cycle Datapath including Jump) Exercise 5.20: jump and link, jal support to Single Cycle Datapath PC  Jump Address PC+ 4 R[31] (For More Practice Exercise 5.20) MemtoReg Is now 2 bits RegDst Is now 2 bits Instruction Word  Mem[PC] R[31]  PC + 4 PC  Jump Address

EECC550 - Shaaban #4 Selected Chapter 5 For More Practice Exercises Winter We wish to add a variant of lw (load word) let’s call it LWR to the single cycle datapath in Figure 5.24 page 314. LWR $rd, $rs, $rt The LWR instruction is similar to lw but it sums two registers (specified by $rs, $rt) to obtain the effective load address and uses the R-Type format Add any necessary datapaths and control signals to the single cycle datapath and justify the need for the modifications, if any. Specify control line values for this instruction. Adding Support for LWR to Single Cycle Datapath (For More Practice Exercise 5.22) (For More Practice Exercise 5.22)

EECC550 - Shaaban #5 Selected Chapter 5 For More Practice Exercises Winter Memto- Reg Mem Mem RegDst ALUSrc Reg Write Read Write Branch ALUOp1 ALUOp0 Jump R-format lw sw x 1 x beq x 0 x J x x x x x x 1 LWR Adding Control Lines Settings for LWR (For Textbook Single Cycle Datapath including Jump) Exercise 5.22: LWR (R-format LW) support to Single Cycle Datapath rd Instruction Word  Mem[PC] PC  PC + 4 R[rd]  Mem[ R[rs] + R[rt] ] No new components or connections are needed for the datapath just the proper control line settings R[rt] Add (For More Practice Exercise 5.22)

EECC550 - Shaaban #6 Selected Chapter 5 For More Practice Exercises Winter We wish to add a new instruction jm (jump memory) to the single cycle datapath in Figure 5.24 page 314. jm offset($rs) The jm instruction loads a word from effective address ($rs + offset), this is similar to lw except the loaded word is put in the PC instead of register $rt. Jm used the I-format with field rt not used. Add any necessary datapaths and control signals to the single cycle datapath and justify the need for the modifications, if any. Specify control line values for this instruction. Adding Support for jm to Single Cycle Datapath (Based on “For More Practice Exercise 5.44” but for single cycle) OPrs rt address 6 bits 5 bits 5 bits 16 bits Not Used

EECC550 - Shaaban #7 Selected Chapter 5 For More Practice Exercises Winter Instruction Word  Mem[PC] PC  Mem[R[rs] + SignExt[imm16 ]] Adding jump memory, jm support to Single Cycle Datapath 2 Jump 2 2 (Based on “For More Practice Exercise 5.44” but for single cycle) rs rt rd imm16 PC + 4 Branch Target R[rs] R[rt]

EECC550 - Shaaban #8 Selected Chapter 5 For More Practice Exercises Winter Memto- Reg Mem Mem RegDst ALUSrc Reg Write Read Write Branch ALUOp1 ALUOp0 Jump R-format lw sw x 1 x beq x 0 x J x x x x x x 01 JAL x 1 x x Adding Control Lines Settings for jm (For Textbook Single Cycle Datapath including Jump) Adding jm support to Single Cycle Datapath PC  Mem[R[rs] + SignExt[imm16 ]] R[rs] Jump is now 2 bits add

EECC550 - Shaaban #9 Selected Chapter 5 For More Practice Exercises Winter You are to add support for a new instruction, swap that exchanges the values of two registers to the MIPS multicycle datapath of Figure 5.28 on page 232 swap $rs, $rt Swap used the R-Type format with: the value of field rs = the value of field rd Add any necessary datapaths and control signals to the multicycle datapath. Find a solution that minimizes the number of clock cycles required for the new instruction without modifying the register file. Justify the need for the modifications, if any. Show the necessary modifications to the multicycle control finite state machine of Figure 5.38 on page 339 when adding the swap instruction. For each new state added, provide the dependent RTN and active control signal values. Adding Support for swap to Multi Cycle Datapath (For More Practice Exercise 5.42)

EECC550 - Shaaban #10 Selected Chapter 5 For More Practice Exercises Winter Adding swap Instruction Support to Multi Cycle Datapath Swap $rs, $rt R[rt]  R[rs] R[rs]  R[rt] We assume here rs = rd in instruction encoding The outputs of A and B should be connected to the multiplexor controlled by MemtoReg if one of the two fields (rs and rd) contains the name of one of the registers being swapped. The other register is specified by rt. The MemtoReg control signal becomes two bits. op rs rt rd [31-26] [25-21] [20-16] [10-6] (For More Practice Exercise 5.42) rs rt rd imm16 PC+ 4 Branch Target R[rs] R[rt]

EECC550 - Shaaban #11 Selected Chapter 5 For More Practice Exercises Winter A  R[rs] B  R[rt] ALUout  PC + (SignExt(imm16) x4) IR  Mem[PC] PC  PC + 4 IF ID R[rd]  B R[rt]  A ALUout  A func B R[rd]  ALUout ALUout   A + SignEx(Imm16) EX MEM WB Swap takes 4 cycles WB1 WB2 Adding swap Instruction Support to Multi Cycle Datapath (For More Practice Exercise 5.42) Zero  A -B Zero: PC  ALUout

EECC550 - Shaaban #12 Selected Chapter 5 For More Practice Exercises Winter You are to add support for a new instruction, add3, that adds the values of three registers, to the MIPS multicycle datapath of Figure 5.28 on page 232 For example: add3 $s0,$s1, $s2, $s3 Register $s0 gets the sum of $s1, $s2 and $s3. The instruction encoding uses a modified R-format, with an additional register specifier rx added replacing the five low bits of the “funct” field. Add necessary datapath components, connections, and control signals to the multicycle datapath without modifying the register bank or adding additional ALUs. Find a solution that minimizes the number of clock cycles required for the new instruction. Justify the need for the modifications, if any. Show the necessary modifications to the multicycle control finite state machine of Figure 5.38 on page 339 when adding the add3 instruction. For each new state added, provide the dependent RTN and active control signal values. Adding Support for add3 to Single Cycle Datapath (For More Practice Exercise 5.45) OPrs rt rd rx $s1$s2 Not used 6 bits [31-26] 5 bits [25-21] 5 bits [20-16] 5 bits [15-11] add3 5 bits [4-0] $s0$s3 6 bits [10-5]

EECC550 - Shaaban #13 Selected Chapter 5 For More Practice Exercises Winter Exercise 5.45: add3 instruction support to Multi Cycle Datapath Add3 $rd, $rs, $rt, $rx R[rd]  R[rs] + R[rt] + R[rx] rx is a new register specifier in field [0-4] of the instruction No additional register read ports or ALUs allowed 1. ALUout is added as an extra input to first ALU operand MUX to use the previous ALU result as an input for the second addition. 2. A multiplexor should be added to select between rt and the new field rx containing register number of the 3rd operand (bits 4-0 for the instruction) for input for Read Register 2. This multiplexor will be controlled by a new one bit control signal called ReadSrc. op rs rt rd rx [31-26] [25-21] [20-16] [10-6] [4-0] Modified R-Format WriteB 3. WriteB control line added to enable writing R[rx] to B PC+ 4 Branch Target imm16 rx rd rs rt

EECC550 - Shaaban #14 Selected Chapter 5 For More Practice Exercises Winter Exercise 5.45: add3 instruction support to Multi Cycle Datapath A  R[rs] B  R[rt] ALUout  PC + (SignExt(imm16) x4) IR  Mem[PC] PC  PC + 4 IF ID ALUout  A + B B  R[rx] ALUout  ALUout + B ALUout  A func B Zero  A -B Zero: PC  ALUout ALUout   A + SignEx(Im16) EX MEM WB EX1 EX2 R[rd]  ALUout Add3 takes 5 cycles WriteB (For More Practice Exercise 5.45)