Computer Science 152 - Fall 2001 - Kubiatowicz - Midterm 1

Computer Science 152 - Fall 2001 - Kubiatowicz - Midterm 1...

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

View Full Document Right Arrow Icon
Midterm I October 10 th , 2001 John Kubiatowicz CS152 Computer Architecture and Engineering Problem 1: Short Answer Problem 1a [3 pts]:
Background image of page 1

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

View Full DocumentRight Arrow Icon
What is Amdhal’s law? Give a formula and define the terms. How is this useful? Problem 1b [2 pts]: How can clock skew cause incorrect behavior in a synchronous circuit? Problem 1c [3 pts]: Is the multi-cycle data path always faster than the single-cycle data page? Explain. Problem 1d [2 pts]: What is the difference between horizontal and vertical microcode? Problem 1d [3 pts]:
Background image of page 2
Suppose that you have analyzed a benchmark that runs on your company’s processor. This processor runs at 500MHz and has the following characteristics: Instruction Type Frequency (%) Cycles Arithmetic and logical 40 1 Load and Store 30 2 Branches 20 3 Floating Point 10 7 What is the CPI and MIPS rating of this processor running this benchmark? Problem 1e [4 pts]: The micro-sequencer shown in class had three options: “zero (or fetch)”, “dispatch”, and “increment”. Assume an 8-bit μPC if some external condition is true, or advance to the next microinstruction (increment the μPC), if the condition is false. Draw a block-diagram of this micro-sequencer, complete with 2-bit control input, 8-bit μPC output, 1-bit condition input, and 4-bit signed branch offset input. Problem 1f [3 pts]:
Background image of page 3

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

View Full DocumentRight Arrow Icon
The 1-bit Booth algorithm recodes one of the operands of a multiplier from binary into trinary logic with symbols: 1 , 1, and 0. The transformation occurs one bit at a time, as given in class: Cur Prev Out 0 0 0 0 1 1 1 0 1 1 1 0 Suppose we encode 3 bits at a time. Finish filling out the following transformation table: Cur Prev Out 000 0 0 000 1 1 001 0 1 001 1 2 010 0 010 1 011 0 011 1 100 0 100 1 101 0 101 1 110 0 110 1 111 0 111 1 Problem 2: General Base Conversions
Background image of page 4
In this problem, construct a subroutine that can convert a string of any base (from 2 to 16) to an integer. The specifications are as follows: The first argument (a0) contains a pointer to a null-terminated string The second argument (a1) contains the base and will be such that 2 a1 16 (you can assume that this is true) On exit, v0 will contain the result and v1 will contain an error code This procedure (call it “convert”) must adhere to all MIPS conventions If any character in the string (before the final null character) is not a legal character for the specified base, then the result is an error. Also, a zero-length string (no characters at all) is an error. Finally, an overflow (result doesn’t fit in 32-bits) is an error. In the case of an error, the value of v0 is undefined. Examples: If the input string is “B6” and the base is 16, the result register (v0) should contain 182 If the input string is “B6” and the base is 12, the result register, should contain 138 If the input string is “B6” and the base is 10, this is a “bad character” error If the input string is “” (i.e. first character is null), this is a “null string” error
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 17

Computer Science 152 - Fall 2001 - Kubiatowicz - Midterm 1...

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

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