Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20)

Similar documents
CPU Organization (Design)

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

COMP303 Computer Architecture Lecture 9. Single Cycle Control

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

Midterm Questions Overview

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

ECE232: Hardware Organization and Design

Midterm Questions Overview

CSEN 601: Computer System Architecture Summer 2014

The Processor: Datapath & Control

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

CPU Design Steps. EECC550 - Shaaban

CS3350B Computer Architecture Winter Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2)

CS61C : Machine Structures

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer

Chapter 4. The Processor. Computer Architecture and IC Design Lab

Outline. EEL-4713 Computer Architecture Designing a Single Cycle Datapath

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

Ch 5: Designing a Single Cycle Datapath

Single Cycle CPU Design. Mehran Rezaei

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

Major CPU Design Steps

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations

361 control.1. EECS 361 Computer Architecture Lecture 9: Designing Single Cycle Control

MIPS-Lite Single-Cycle Control

Computer Organization and Structure

Systems Architecture

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

Guerrilla Session 3: MIPS CPU

Chapter 5 Solutions: For More Practice

Lecture #17: CPU Design II Control

EEM 486: Computer Architecture. Lecture 3. Designing Single Cycle Control

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

How to design a controller to produce signals to control the datapath

Processor (I) - datapath & control. Hwansoo Han

For More Practice FMP

Inf2C - Computer Systems Lecture Processor Design Single Cycle

CS61C : Machine Structures

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

Midterm I March 3, 1999 CS152 Computer Architecture and Engineering

ECS 154B Computer Architecture II Spring 2009

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single- Cycle CPU Datapath & Control Part 2

UC Berkeley CS61C : Machine Structures

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

LECTURE 5. Single-Cycle Datapath and Control

Review: Abstract Implementation View

Laboratory 5 Processor Datapath

Midterm I October 6, 1999 CS152 Computer Architecture and Engineering

University of California College of Engineering Computer Science Division -EECS. CS 152 Midterm I

CS3350B Computer Architecture Quiz 3 March 15, 2018

CS61C : Machine Structures

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1

The MIPS Processor Datapath

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

CS61C : Machine Structures

CS 61C Summer 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control)

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade

UC Berkeley CS61C : Machine Structures

Midterm I March 12, 2003 CS152 Computer Architecture and Engineering

Systems Architecture I

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 19 CPU Design: The Single-Cycle II & Control !

Design of the MIPS Processor

Designing a Multicycle Processor

CS 61C Fall 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control)

Working on the Pipeline

EE457. Note: Parts of the solutions are extracted from the solutions manual accompanying the text book.

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I ! Nasty new windows vulnerability!

UC Berkeley CS61C : Machine Structures

Topic #6. Processor Design

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours.

CSCI 402: Computer Architectures. Fengguang Song Department of Computer & Information Science IUPUI. Today s Content

CS152 Computer Architecture and Engineering Lecture 10: Designing a Single Cycle Control. Recap: The MIPS Instruction Formats

Machine Organization & Assembly Language

CPE 335 Computer Organization. Basic MIPS Architecture Part I

CS 61C: Great Ideas in Computer Architecture Control and Pipelining

CS 351 Exam 2 Mon. 11/2/2015

CSE 378 Midterm 2/12/10 Sample Solution

CS3350B Computer Architecture Winter 2015

CS 351 Exam 2, Fall 2012

ECE 3056: Architecture, Concurrency and Energy of Computation. Single and Multi-Cycle Datapaths: Practice Problems

Chapter 5: The Processor: Datapath and Control

ECE Exam I - Solutions February 19 th, :00 pm 4:25pm

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Midterm I March 1, 2001 CS152 Computer Architecture and Engineering

Fundamentals of Computer Systems

Exercise 1. Due to Sunday, 27/12/2009

ECE369. Chapter 5 ECE369

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

Recap: The MIPS Subset ADD and subtract EEL Computer Architecture shamt funct add rd, rs, rt Single-Cycle Control Logic sub rd, rs, rt

EE557--FALL 1999 MAKE-UP MIDTERM 1. Closed books, closed notes

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

Transcription:

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20) 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: op (6 bits) Target address (26 bits) 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. #1 Selected Chapter 5 For More Practice Exercises Winter 2005 1-19-2006

Exercise 5.20: jump and link, jal support to Single Cycle Datapath Instruction Word R[31] PC + 4 PC Jump Address Mem[PC] Jump Address PC + 4 PC + 4 Branch Target PC + 4 31 2 rd rs rt R[rt] R[rs] 2 imm16 1. Expand the multiplexor controlled by RegDst to include the value 31 as a new input 2. 2. Expand the multiplexor controlled by MemtoReg to have PC+4 as new input 2. (For More Practice Exercise 5.20) #2 Selected Chapter 5 For More Practice Exercises Winter 2005 1-19-2006

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

Adding Support for LWR to Single Cycle Datapath (For More Practice Exercise 5.22) 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. (For More Practice Exercise 5.22) #4 Selected Chapter 5 For More Practice Exercises Winter 2005 1-19-2006

Exercise 5.22: LWR (R-format LW) support to Single Cycle Datapath 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 Adding Control Lines Settings for LWR (For Textbook Single Cycle Datapath including Jump) Memto- Reg Mem Mem RegDst ALUSrc Reg Write Read Write Branch ALUOp1 ALUOp0 Jump R-format 1 0 0 1 0 0 0 1 0 0 lw 0 1 1 1 1 0 0 0 0 0 sw x 1 x 0 0 1 0 0 0 0 beq x 0 x 0 0 0 1 0 1 0 J x x x 0 0 0 x x x 1 LWR 1 0 1 1 1 0 0 0 0 0 rd R[rt] (For More Practice Exercise 5.22) Add #5 Selected Chapter 5 For More Practice Exercises Winter 2005 1-19-2006

Adding Support for jm to Single Cycle Datapath (Based on For More Practice Exercise 5.44 but for single cycle) 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. OP rs rt address 6 bits 5 bits 5 bits 16 bits 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. #6 Selected Chapter 5 For More Practice Exercises Winter 2005 1-19-2006

Adding jump memory, jm support to Single Cycle Datapath Instruction Word Mem[PC] PC Mem[R[rs] + SignExt[imm16]] 1. Expand the multiplexor controlled by Jump to include the Read Data (data memory output) as new input 2. The Jump control signal is now 2 bits Jump 2 2 Jump PC + 4 Branch Target 2 rs rt R[rt] R[rs] rd imm16 (Based on For More Practice Exercise 5.44 but for single cycle) #7 Selected Chapter 5 For More Practice Exercises Winter 2005 1-19-2006

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