Computer Organization and Design: The Hardware/Software Interface

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CS152 Spring ‘03 Midterm II Page 1 University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2003 John Kubiatowicz Midterm II SOLUTIONS May 7 th , 2003 CS152 Computer Architecture and Engineering Your Name: SID Number: Discussion Section: Problem Possible Score 1 20 2 25 3 30 4 25 Total
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS152 Spring ‘03 Midterm II Page 2 [ This page left for π ] 3.141592653589793238462643383279502884197169399375105820974944
Background image of page 2
CS152 Spring ‘03 Midterm II Page 3 Problem 1: Short Answers Problem 1a[2pts]: Give a simple definition of precise interrupts/exceptions. Why is this important? A precise interrupt or exception leaves the machine in a state for which there is a single instruction (PC) such that all instructions before that PC have committed their state and the instruction at the specified PC and all following instructions have not committed their state. This is important because it makes restarting the user program very simple. Problem 1b[3pts]: Explain why exceptions can occur out of order (in time) in an in-order, 5- stage pipeline. Give an example and explain how to achieve a precise exception point anyway. Exceptions can occur out of order because they can occur in different pipeline stages. For example, you could have a page-fault in the MEM stage of an early instruction after an illegal instruction fault in the DECODE stage of another: PC: F D E M W Fault in mem stage PC+4: F D E M W Fault in decode stage (earlier) Precise exceptions can be recovered by waiting until the M/W boundary to declare a fault. Problem 1c[3pts]: Name and define 3 types of pipeline data hazards. For each hazard, explain how it is prevented in the 5-stage pipeline: RAW: Read after Write hazard. This occurs if a later instruction reads a register from an earlier instruction while it is still in the pipeline. Fixed by forwarding. WAR: Write after read hazard. This occurs if a later instruction writes a register read by an earlier instruction before that instruction gets the old value. Fixed by the fact that the 5-stage pipeline executes in order and reads values early and writes them late. WAW: Write after Write hazard. This occurs if a later instruction writes a register written by an earlier instruction – and the result of the earlier instruction persists. Fixed by the fact that the 5- stage pipeline commits instructions in order.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS152 Spring ‘03 Midterm II Page 4 Problem 1d[2pts]: How do you refresh a DRAM, and why does this work (i.e. what is happening internally)? You refresh a DRAM by reading each ROW once every so often. This works because the DRAM reading process is restoring (the SENSE amps reinforce the values stored in the cells). Problem 1e[2pts]:
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This homework help was uploaded on 01/29/2008 for the course CS 152 taught by Professor Kubiatowicz during the Spring '04 term at University of California, Berkeley.

Page1 / 17

midterm2 solutions - CS152 Spring `03 Midterm II Page 1...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online