Computer Science 152 - Fall 2001 - Kubiatowicz - Midterm 1

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

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

Midterm I October 10 th , 2001 John Kubiatowicz CS152 Computer Architecture and Engineering Problem 1: Short Answer Problem 1a [3 pts]:

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

View Full Document
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]:
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]:

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

View Full Document
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
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 If the input string is “10110” and the base is 2, the result register should contain 22

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern