ENEE350
Sample Midterm-Fall 2008
CLOSED BOOK AND NOTES
EXAM PERIOD 75 MINUTES
Instructions:
• Points for each problem are indicated right after the problem. The total score is 100 points.
• Use the space provided below each problem. if you need more space, please ask a proctor.
• Write your name and student id on the cover sheet.
• Promptly hand in your test to a proctor when the test is over.
NAME:
STUDENT ID:
Problem 1 (20 points): Consider the following Vesp 2.0 program. Specify the values in memory
locations 0, 10 and 32 (addresses are expressed in decimal) after the execution of the program is
completed, and explain your answer in each case.
100 2000 0020
102 2001 0021
104 1000 0000
106 8000
107 300A 0000
109 3020 0001
10B 0000 D000
10D 7000
Note: All addresses and operand values in the program are expressed in
hexadecimal.
Problem 2 (20 points): Write a Vesp 2.0 program to find the maximum of a set of numbers
stored in memory locations 0x100 through 0x200.
Problem 3 (20 points): A given processor has four operand registers W, X, Y, and Z in addition to
a program counter (PC), an instruction register (IR), memory address register, and memory data
register, MDR. The following sequence of steps describes the instruction fetch, decode, and
execute steps of this CPU:
while (reset == 0)
{Step 1: MAR = PC; PC = PC +1;
Step 2: MD R = MEMOR Y[MAR];
Step 3: IR = MDR;
Step 4: switch(IR[0:1])
{case 0: W = W << X; break;
case 1: W = W+X; Y = Y+Z; break;
case 2: W = W+ X+ Y + Z; break;
case 3: W = W + X-Y-Z; break;
}
}
Give a control (sequential) circuit that performs the instruction fetch-decode-execute sequence of
this processor, clearly indicating the events that occur at each state of the circuit.