Computer Science 152 - Fall 1996 - Culler - Midterm 1

# Computer Science 152 - Fall 1996 - Culler - Midterm 1 -...

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

Name: 1 Feb 21, 1996 University of California College of Engineering Computer Science Division -EECS Fall 1996 D.E. Culler CS 152 Midterm I Your Name:_______________________________________________________ ID Number:_______________________________________________________ Discussion Section:__________________________________________________ You may bring one double-sided pages of notes and you may use a calculator, but no book or computer. Please print your name clearly on the cover sheet and on every page. Show your work. Write neatly and be well organized. It never hurts to make it easy to grade. Good luck. Mean: 69, Max 97 Distribution: 100 - 85 (11), 84 - 70 (21), 69 - 55 (24), 54 - 40 (7), 39 - (2) Problem Possible Score 12 5 22 0 32 5 42 0 51 0 Total 100

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

View Full Document
Name: 2 Feb 21, 1996 Problem 1 (25 points) 1a [5] State the ﬁve major components of a computer (according to Patterson and Hennes- sey). 1. Processor datapath 2. Processor Control 3. Memory 4. Input 5. Output 1b [5 ]: Assemble the following MIPS instruction into its binary machine representation XORI \$15, \$0, 0x8000 answer: op(6) rsrtimmediate 001110 00000 01111 1000 0000 0000 0000 1c [5 ]: Decode your answer to 1b as a 32-bit 2’s-complement integer a) b) c) d) answer: b) 0011 1000 0000 1111 1000 0000 0000 0000 1d [5 ]: Decode your answer to 1b as an single precision IEEE ﬂoating-point number a) b) c) d) answer: c) 0 01110000 000 1111 1000 0000 0000 0000 Grading: 1a) 1 point for each component; 1b) 1 point for each ﬁeld; 1c), 1d) hit or miss for multiple choice. 2 29 2 28 2 27 2 20 +++ 2 30 2 27 –3 1 2 15 × +7 2 27 × 31 2 20 × +1 4 2 27 × 31 2 15 × + 2 71 31 256 -------- × 2 15 31 256 × 2 15 287 256 × 2 112 287 256 ×
Name: 3 Feb 21, 1996 1e[5] What are the four basic addressing modes supported by the MIPS R3000 instruction set? Draw a diagram of each. (Do not include the special cases that arise from setting one of the operands to zero.) register-addressing: value is contained in a register speciﬁed in the instruction base (or displacement) addressing immediate addressing: value is contained in the instruction PC-relative addressing: PC <- PC + sign_ext(Imm16) Points: 1 for each type. -2 for lack of diagrams, or lack of description. Other

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.

## This note was uploaded on 05/17/2009 for the course CS 152 taught by Professor Kubiatowicz during the Spring '04 term at Berkeley.

### Page1 / 9

Computer Science 152 - Fall 1996 - Culler - Midterm 1 -...

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

View Full Document
Ask a homework question - tutors are online