This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CMPT 250 Midterm 2 March 15, 2002 Answers • You have 50 minutes to complete this exam. • Answer all questions in an answer booklet. Hand in your question sheet with your booklet. • There is a total of 40 points on this exam; points for each question are indicated. • Read through the entire exam before you begin. • There are 6 pages ( not counting this page); make sure you have them all. • No books, calculators or any other aids are allowed. • Where appropriate, clarity and simplicity of your solutions count, as well as correctness. • All “Figures” are at the back of the exam. Surname: Given Name(s): CMPT 250 Midterm 2, Mar. 15, 2002 Student Number: Student number: 2 CMPT 250 Midterm 2, Mar. 15, 2002 1. [10 points] For each assembly instruction below, convert it to a register transfer statement (eg. “ R 1 ← R 2” is a register transfer statement). A table of the addressing modes used can be found in Figure 1. Where an accumulator is used, it should be called ACC . (a) LD R1, 800 [ R 1 ← M [800] ] (b) ADD (400) [ ACC ← M [ M [400]] ] (c) ADD R1, #400 [ R 1 ← R 1 + 200 ] (d) LD [100] [ ACC ← M [ M [100]] ] (e) LD 300 (R2) [ ACC ← M [ R 2 + 300] ] (a) LD R1, #800 [ R 1 ← 800 ] (b) ADD $400 [ ACC ← M [ PC + 400] ] (c) ADD R2, 400 [ R 2 ← R 2 + M [400] ] (d) LD (R1) [ ACC ← M [ R 1]] ] (e) LD 600 (R1) [ ACC ← M [ R 1 + 600] ] 2. [10 points] Have a look at the datapath in Figure 2. This datapath will use the function unit in Figure 3. The outputs of the function unit are described in Figure 4....
View
Full
Document
This note was uploaded on 01/16/2010 for the course CS 251 taught by Professor Various during the Spring '97 term at Simon Fraser.
 Spring '97
 various

Click to edit the document details