CS 251, Winter 2018, Assignment % of course mark

Similar documents
CS 251, Winter 2019, Assignment % of course mark

CS 251, Spring 2018, Assignment 3.0 3% of course mark

CS 251, Winter 2018, Assignment % of course mark

Comp 303 Computer Architecture A Pipelined Datapath Control. Lecture 13

Quiz #1 EEC 483, Spring 2019

Solutions for Chapter 6 Exercises

The single-cycle design from last time

Pipelining. Chapter 4

PART I: Adding Instructions to the Datapath. (2 nd Edition):

Review: Computer Organization

The final datapath. M u x. Add. 4 Add. Shift left 2. PCSrc. RegWrite. MemToR. MemWrite. Read data 1 I [25-21] Instruction. Read. register 1 Read.

PS Midterm 2. Pipelining

Chapter 3 & Appendix C Pipelining Part A: Basic and Intermediate Concepts

What do we have so far? Multi-Cycle Datapath

1048: Computer Organization

TDT4255 Friday the 21st of October. Real world examples of pipelining? How does pipelining influence instruction

The extra single-cycle adders

Exceptions and interrupts

EEC 483 Computer Organization

Review. A single-cycle MIPS processor

EXAMINATIONS 2010 END OF YEAR NWEN 242 COMPUTER ORGANIZATION

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University

EXAMINATIONS 2003 END-YEAR COMP 203. Computer Organisation

Chapter 6 Enhancing Performance with. Pipelining. Pipelining. Pipelined vs. Single-Cycle Instruction Execution: the Plan. Pipelining: Keep in Mind

Enhanced Performance with Pipelining

Computer Architecture

Instruction fetch. MemRead. IRWrite ALUSrcB = 01. ALUOp = 00. PCWrite. PCSource = 00. ALUSrcB = 00. R-type completion

EEC 483 Computer Organization

Overview of Pipelining

Prof. Kozyrakis. 1. (10 points) Consider the following fragment of Java code:

1048: Computer Organization

Computer Architecture

Review Multicycle: What is Happening. Controlling The Multicycle Design

EEC 483 Computer Organization. Branch (Control) Hazards

Chapter 6: Pipelining

The multicycle datapath. Lecture 10 (Wed 10/15/2008) Finite-state machine for the control unit. Implementing the FSM

Computer Architecture. Lecture 6: Pipelining

Winter 2013 MIDTERM TEST #2 Wednesday, March 20 7:00pm to 8:15pm. Please do not write your U of C ID number on this cover page.

Lecture 7. Building A Simple Processor

Hardware Design Tips. Outline

1048: Computer Organization

Lab 8 (All Sections) Prelab: ALU and ALU Control

Pipelined Datapath. Reading. Sections Practice Problems: 1, 3, 8, 12 (2) Lecture notes from MKP, H. H. Lee and S.

Chapter 6: Pipelining

Lecture 6: Microprogrammed Multi Cycle Implementation. James C. Hoe Department of ECE Carnegie Mellon University

CSE Introduction to Computer Architecture Chapter 5 The Processor: Datapath & Control

Lecture 9: Microcontrolled Multi-Cycle Implementations

cs470 - Computer Architecture 1 Spring 2002 Final Exam open books, open notes

4.13 Advanced Topic: An Introduction to Digital Design Using a Hardware Design Language 345.e1

Pipelined Datapath. Reading. Sections Practice Problems: 1, 3, 8, 12

ECE232: Hardware Organization and Design

Lecture 10: Pipelined Implementations

Review. How to represent real numbers

Instruction Pipelining is the use of pipelining to allow more than one instruction to be in some stage of execution at the same time.

SI232 Set #20: Laundry, Co-dependency, and other Hazards of Modern (Architecture) Life. Chapter 6 ADMIN. Reading for Chapter 6: 6.1,

Animating the Datapath. Animating the Datapath: R-type Instruction. Animating the Datapath: Load Instruction. MIPS Datapath I: Single-Cycle

CSE 141 Computer Architecture Summer Session I, Lectures 10 Advanced Topics, Memory Hierarchy and Cache. Pramod V. Argade

EC 413 Computer Organization - Fall 2017 Problem Set 3 Problem Set 3 Solution

CSSE232 Computer Architecture I. Mul5cycle Datapath

Computer Organization and Structure

CSE 378 Midterm 2/12/10 Sample Solution

Computer Architecture Lecture 6: Multi-cycle Microarchitectures. Prof. Onur Mutlu Carnegie Mellon University Spring 2012, 2/6/2012

comp 180 Lecture 25 Outline of Lecture The ALU Control Operation & Design The Datapath Control Operation & Design HKUST 1 Computer Science

MIPS Architecture. Fibonacci (C) Fibonacci (Assembly) Another Example: MIPS. Example: subset of MIPS processor architecture

Processor Design CSCE Instructor: Saraju P. Mohanty, Ph. D. NOTE: The figures, text etc included in slides are borrowed

CSEN 601: Computer System Architecture Summer 2014

Lecture 13: Exceptions and Interrupts

PIPELINING. Pipelining: Natural Phenomenon. Pipelining. Pipelining Lessons

Machine Organization & Assembly Language

POWER-OF-2 BOUNDARIES

ECE Exam II - Solutions November 8 th, 2017

Processor Design Pipelined Processor (II) Hung-Wei Tseng

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W12-M

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

4.13. An Introduction to Digital Design Using a Hardware Design Language to Describe and Model a Pipeline and More Pipelining Illustrations

Lecture 8: Data Hazard and Resolution. James C. Hoe Department of ECE Carnegie Mellon University

CS 251, Winter 2018, Assignment % of course mark

EECS 322 Computer Architecture Improving Memory Access: the Cache

Codeword[1] Codeword[0]

ECS 154B Computer Architecture II Spring 2009

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

CSE Quiz 3 - Fall 2009

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception

CS 251, Winter 2019, Assignment % of course mark

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

Processor (II) - pipelining. Hwansoo Han

CS 351 Exam 2 Mon. 11/2/2015

CS3350B Computer Architecture Quiz 3 March 15, 2018

ECE 313 Computer Organization EXAM 2 November 9, 2001

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

Midnight Laundry. IC220 Set #19: Laundry, Co-dependency, and other Hazards of Modern (Architecture) Life. Return to Chapter 4

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

Full Datapath. Chapter 4 The Processor 2

Pipelining. lecture 15. MIPS data path and control 3. Five stages of a MIPS (CPU) instruction. - factory assembly line (Henry Ford years ago)

Multiple-Choice Test Chapter Golden Section Search Method Optimization COMPLETE SOLUTION SET

ECE154A Introduction to Computer Architecture. Homework 4 solution

Pipelining Analogy. Pipelined laundry: overlapping execution. Parallelism improves performance. Four loads: Non-stop: Speedup = 8/3.5 = 2.3.

ECE232: Hardware Organization and Design

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

Chapter 4. The Processor

Transcription:

CS 25, Winter 28, Assignment 4.. 3% of corse mark De Wednesday, arch 7th, 4:3P Lates accepted ntil Thrsday arch 8th, am with a 5% penalty. (6 points) In the diagram below, the mlticycle compter from the corse notes is eecting the instrction 396 lw $2,($6) in the ID state. The ID/EX register bank will be written to at the end of the clock cycle. In the figre below, there are si dark lines, each above one of the lines in the path. Above each dark line write the vale on the line; if the vale on the line can not be determined from the information given, write?. IF/ID ID/EX EX/E E/ 4 reslt Shift left 2 PC ress register register 2 Registers 2 register Zero ALU ALU reslt ress Data 6 Sign etend 32 2 3 4 5 CONTROL

2. (4 points) Describe 3 differences between the lticycle path and the Single Cycle path. In addition to the 3 differences, discss how the individal instrction eection time has changed in the lticycle path. 3. ( points) Consider the following IPS code seqence: lw $, ($2) 4 addi $3, $, -5 8 sb $, $3, $ 2 sw $, ($3) (a) (5 pts) In the diagram below, each row is labeled with an eected instrction. ark all dependencies by drawing straight lines (similar to the figre in the corse notes: Pipelining page or Fig. 4.52 of the tet) between when the reslt is stored in the register file and when it needs to be taken from the register file. Assme that the code is to rn on the pipelined path of Fig. 4.5 of the 5th edition; this path implements neither stalling nor forwarding. For each dependency, label it either as a hazard or as a non-hazard. 2

(b) (5 pts) odify the code to remove the hazards by inserting a minimm nmber of NOPs. Line # Code 3

4. (6 points) odify the pipelined path provided on the net page to incorporate the jmp instrction as stdied in the Single Cycle path. a) (4 points) the jmp instrction to the pipeline stage where it is most efficient. Yo may add new control lines, mltipleors or additional components as needed. arks will be dedcted for gross inefficiency. Note: the jmp instrction will work eactly as it did in the Single Cycle path. Yo need to generate the jmp target address and allow this to pdate PC as was shown in the Single Cycle path. The following eection shows eamples of instrctions seqences that are possible with jmp. We want to implement the jmp instrction and modify PC with the jmp target address as soon as possible to avoid errant instrctions beginning eection. Yo do not need to implement any flshing. Yo may assme that nwanted instrctions following the jmp or following the branch are flshed. j 35 beq $2, $, -5 beq $2, $, -5 4 add $4, $3, $2 4 add $4, $3, $2 4 add $4, $3, $2 8 sb $6, $7, $8 8 j 35 8 addi $4,$4, -4 2 addi $4, $4, -4 2 addi $4, $4, -4 2 j 35 6 lw $3, ($2) 6 lw $3, ($2) 6 lw $3, ($2) Yo do not need to consider the case where branch is immediately followed by jmp. Yo do need to consider the cases listed above. b) (2 points) State the vale of any new control bits as needed for the jmp instrction added in part(a). Also, state the vale of the new control bits for all other instrctions sing the path. 4

PC [2 6] emtoreg ALUOp Branch RegDst ALUSrc 4 6 32 [5 ] reslt Registers register 2 register register 2 Sign etend ALU reslt Zero ALU control Shift left 2 Reg em Control ALU [5 ] 6 EX IF/ID PCSrc ID/EX EX/E E/ em ress Data 5ress

5. ( points) This qestion refers to the pipelined path withot forwarding, shown below and in Figre 4.5 in the tetbook. Consider the instrctions add $, $3, $5 4 sw $4, 4($8) 8 sb $4, $, $4 2 beq $, $2, 6 Consider the pipeline when the add instrction is in the stage, the 4 sw instrction is in the E stage, the 8 sb instrction is in the EX stage, and the 2 beq instrction is in the ID stage. In the figre below, label all of the control signals (inclding both those coming directly ot of the control nit and those coming ot of the pipeline registers) with their appropriate vales, sing don t cares where appropriate. In this figre, the instrctions have been drawn above the appropriate set of pipeline registers. We have also filled in the soltion for the stage, and given the names of the control signals whose vales yo need to determine for the other three stages. PCSrc beq $,$2,6 sb $4,$,$4 sw $4, 4($8) add $,$3,$5 Control ID/EX EX/E E/ IF/ID EX PC 4 ress register register 2 Registers 2 register Reg Shift left 2 reslt ALUSrc Zero ALU ALU reslt Branch ress em Data emtoreg 6 32 [5 ] Sign etend 6 ALU control em [2 6] [5 ] RegDst ALUOp emtoreg= Branch= em= RegDst= ALUOp= ALUSrc= Reg= em= emtoreg= Branch= em= RegDst= ALUOp= ALUSrc= Reg= em= emtoreg= Reg= Branch= em= em= Reg= emtoreg= 6

6. (5 points) This qestion refers to the pipelined path with forwarding in Figre 4.56 of the tetbook and also given in the corse notes. Consider the instrctions add $, $2, $4 4 add $2, $4, $ 8 sb $3, $2, $ Consider the sitation when the add instrction is in the stage, the 4 add instrction is in the E stage, and the 8 sb instrction is in the EX stage. In the figre below, trace back each of the two inpts to the ALU throgh the UXes back to the appropriate set of pipeline registers. (i.e., trace a path from the ALU back to the pipeline registers where the vales are stored). Yo may se bold dark or zigzag lines to clearly indicate yor work. IF/ID Control sb $3,$2,$ add $2,$4,$ add $,$2,$4 ID/EX EX EX/E E/ PC Registers ALU Data IF/ID.RegisterRs IF/ID.RegisterRt IF/ID.RegisterRt IF/ID.RegisterRd Rs Rt Rt Rd Forwarding nit EX/E.RegisterRd E/.RegisterRd 7

7. (7 points) This qestion refers to the pipelined path withot forwarding, shown below and in Figre 4.5 in the tetbook. Consider the instrctions add $, $3, $5 4 lw $4, 4($8) 8 beq $, $2, 6 2 sb $4, $, $4 Consider the pipeline when the add instrction is in the stage, the 4 lw instrction is in the E stage, the 8 beq instrction is in the EX stage, and the 2 sb instrction is in the ID stage. In the figre below, state the decimal vales on the nmbered blank lines -7. In this figre, the instrctions have been drawn above the appropriate set of pipeline stages. Note: The blank lines do not refer to control bits. Line #2 refers to read register, line #5 refers to the address going into. All other line nmbers refer to the decimal vale on the line immediately below or beside it. Yo may also assme each register i contains the vale + i. 8

8. (3 points) This qestion refers to the pipelined path from the previos qestion on this assignment. State how many bits wide the Intermediate Register ID/EX mst be in order to store all the reqired and control bits. Yo mst show yor work. 9

itional eercises for pipeline architectre: Eercise 4-9, 4-, 4-3, 4-4.