CS 351 Exam 2, Fall 2012

Similar documents
CS 351 Exam 2 Mon. 11/2/2015

CS 351 Exam 2 Wed. 4/5/2017

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

CENG 3531 Computer Architecture Spring a. T / F A processor can have different CPIs for different programs.

CSEN 601: Computer System Architecture Summer 2014

Computer Organization and Structure

Processor (I) - datapath & control. Hwansoo Han

CS 2506 Computer Organization II Test 1. Do not start the test until instructed to do so! printed

Lecture 10: Simple Data Path

CS 351 Exam 3, Fall 2011

Chapter 5 Solutions: For More Practice

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

COMP2611: Computer Organization. The Pipelined Processor

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

CS 351 Exam 2, Section 1 Wed. 11/2/2016

THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination

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

CS 351 Exam 3, Fall 2013

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

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

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

CSE Computer Architecture I Fall 2009 Lecture 13 In Class Notes and Problems October 6, 2009

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

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

CS 351 Exam 1, Fall 2010

4. (2 pts) What is the only valid and unimpeachable measure of performance?

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

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

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

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

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

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

CPE 335 Computer Organization. Basic MIPS Architecture Part I

Systems Architecture

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

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

CS232 Final Exam May 5, 2001

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

ECS 154B Computer Architecture II Spring 2009

Due Nov. 6 th, 23:59pm No Late Submissions Accepted

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

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

Machine Organization & Assembly Language

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

Department of Electrical Engineering and Computer Sciences Fall 2017 Instructors: Randy Katz, Krste Asanovic CS61C MIDTERM 2

ECE 313 Computer Organization FINAL EXAM December 11, Multicycle Processor Design 30 Points

COMPUTER ORGANIZATION AND DESIGN

Working on the Pipeline

4. What is the average CPI of a 1.4 GHz machine that executes 12.5 million instructions in 12 seconds?

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

Department of Electrical Engineering and Computer Sciences Fall 2003 Instructor: Dave Patterson CS 152 Exam #1. Personal Information

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

Final Exam Fall 2007

Computer Architecture V Fall Practice Exam Questions

Chapter 4. The Processor

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

The Processor: Datapath & Control

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

LECTURE 5. Single-Cycle Datapath and Control

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

CENG 3420 Lecture 06: Datapath

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007

3. (2 pts) Clock rates have grown by a factor of 1000 while power consumed has only grown by a factor of 30. How was this accomplished?

CSE 378 Midterm 2/12/10 Sample Solution

ECE232: Hardware Organization and Design

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

CS61C : Machine Structures

Pipelining. CSC Friday, November 6, 2015

CS Computer Architecture Spring Week 10: Chapter

The MIPS Processor Datapath

CS 2506 Computer Organization II Test 2

Processor Design Pipelined Processor (II) Hung-Wei Tseng

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

Pipelined Processor Design

Final Project: MIPS-like Microprocessor

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

Chapter 4. The Processor

ISA Instruction Operation

Codeword[1] Codeword[0]

Pipelined Processor Design

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

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

/ : Computer Architecture and Design Fall Midterm Exam October 16, Name: ID #:

CSE Quiz 3 - Fall 2009

Machine Organization & Assembly Language

Processor (multi-cycle)

MIPS-Lite Single-Cycle Control

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

Fundamentals of Computer Systems

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

Design of the MIPS Processor

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle?

Problem 4 The order, from easiest to hardest, is Bit Equal, Split Register, Replace Under Mask.

Lecture 7 Pipelining. Peng Liu.

Chapter 4. The Processor

CPU Organization (Design)

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100

Transcription:

CS 351 Exam 2, Fall 2012 Your name: Rules You may use one handwritten 8.5 x 11 cheat sheet (front and back). This is the only resource you may consult during this exam. Include explanations and comments in your answers in order to maximize your partial credit. However, you will be penalized for giving extraneous incorrect information. You may use the backs of these pages if you need more space, but make it clear where to find your answer to each question. Unless otherwise specified, you do not need to work out the arithmetic on math problems. Just do enough algebra to set up an answer of the form: Answer = [arithmetic expression] [units] Grade (instructor use only) Your Score Max Score Problem 1 30 Problem 2 20 Problem 3 20 Problem 4 15 Problem 5 15 Total 100

Problem 1: Datapath mechanics (30 points) You are tracing the following instruction on the single-cycle datapath (attached): Assembly code: BEQ $zero, $zero, L Instruction format: opcode / rs / rt / imm Machine code: 000100 00000 00000 000000000001000 Provide the exact numerical answer to each question if possible. If not, describe the value without stating an exact number. a) [2 points] What is the input to the control unit for this instruction? b) [4 points] What values does this instruction send to the Read Register 1 and Read Register 2 ports? c) [4 points] What values end up on the Read data 1 and Read data 2 ports? Page 2 of 11

d) [6 points] What operation does the ALU do this cycle? What are its exact operands? e) [4 points] What gets put on the register fileʼs Write register port? What data gets put on the register fileʼs Write data port? f) [4 points] What address goes to the memoryʼs address port? What data goes to the memoryʼs data port? g) [2 points] How is the next PC computed? h) [4 points] Which of your answers to parts (a)-(g) are eventually discarded? That is, which of these answers do NOT have an impact on the state of the processor? Page 3 of 11

Problem 2: Extending the datapath (20 points) You are modifying the attached datapath to support the JAL instruction. Remember that the JAL instruction does two things: Jumps to the jump target address (see datapath) Saves a copy of PC+4 in register $ra (register 31) JAL is a J-format instruction, encoded as follows: Opcode = 000011 The remaining bits are used to compute the jump address. A. [10 points] State the value of each control signal for the JAL instruction, and briefly explain. If the value of a control signal does not matter, use an X (donʼt care). You will lose points if you use a 1 or a 0 for a signal whose value does not matter. MemWrite: RegWrite: Branch: Jump: RegDst: MemtoReg: ALUSrc: Page 4 of 11

B. [10 points] Describe in detail any hardware you would need to add to the existing datapath to implement this instruction, including any new control signals. If you are adding any muxes, please draw them below with their inputs and outputs clearly labeled. It should be 100% clear where each mux links up with the attached datapath diagram. Page 5 of 11

Problem 3: Pipelining and performance (20 points) Assume that the stages of a MIPS instructionʼs execution take the following amounts of time: Instruction fetch: 500 ps Instruction decode / register read: 600 ps Execution: 450 ps Memory: 500 ps Write back: 250 ps A. [5 points] What is the minimum clock cycle time of a single-cycle implementation of this processor? How long (in seconds, not cycles) will a single instruction take to execute on this implementation? B. [5 points] What is the minimum clock cycle time of a version of this processor with a 5-stage pipeline? How long (in seconds, not cycles) will a single instruction take to execute on this implementation? Page 6 of 11

C. [5 points] How long does will it take 10 independent instructions to complete on the implementation from Part A? What about Part B? D. [5 points] What information is saved into the pipeline register between the IF and ID stages? What would happen if this register did not exist? Page 7 of 11

Problem 4: Data hazards (15 points) Consider the 5-stage MIPS pipeline with all possible forwarding paths implemented. A. [5 points] Show a sequence of instructions that will require the pipeline to stall for at least one cycle due to a data dependency. Do not include branches or jumps in your sequence. B. [5 points] Show a sequence of instructions that will require a result to be forwarded from the end of the EX stage to the beginning of the EX stage in order to avoid stalling. Do not include branches or jumps in your sequence. C. [5 points] Show a sequence of instructions that will require a result to be forwarded from the end of the MEM stage to the beginning of the EX stage. Do not include branches or jumps in your sequence. Page 8 of 11

Problem 5: Control hazards and branch prediction (15 points) Consider the following 4 branch prediction schemes: Predict taken Predict not taken 1-bit predictor 2-bit predictor A. [5 points] Show a sequence of branch decisions (e.g. T, NT, NT, T, T) for which the 1-bit predictor outperforms or ties the other three schemes in the steady state. Explain. B. [5 points] Show a sequence of branch decisions for which the 2-bit predictorʼs accuracy in the steady state depends on its initial values. (For example, the steady-state accuracy might be 50% if the predictor is initialized to weak NT and 75% if it is initialized to strong T.) Explain. C. [5 points] In the MIPS pipeline, when is a branch misprediction detected? What needs to be done when this happens? Page 9 of 11

[intentionally left blank] Page 10 of 11

Page 11 of 11