You are on page 1of 4

Computer

Architecture and Logic (CSE4010)

Midterm Exam

2016.04.18 AM 9:00

* General instructions
A. Write clearly. Illegible answers will receive no credit.
B. Show your work! Answers without proper explanation/calculation will be penalized.





<Problems>
1. (10pt) Consider a computer running programs with CPU times shown in the following table.
FP Instr. INT Instr. L/S Instr. Branch Instr. Total time
35 s 85 s 50 s 30 s 200 s
How much is the total time reduced if the time for L/S operations is reduced by 40%?
Answer)


2. (10pt) The following table shows the number of instructions for a program.

Arith Store Load Branch Total

300 100 50 50 500


Assuming that arith instructions take 1 cycle, load and store 5 cycles, and branches 2 cycles.
The program runs in 2 GHz processor. If the number of Store instructions can be reduced by one
half, what is the new CPI?
Answer)


3. (10pt) Suppose we have developed new versions of a processor with the following
characteristics.

Version Voltage Clock Rate


Ver.1 4 V 1 GHz
Ver.2 x V 1.5 GHz
Assuming that the capacitive load of version 2 is 60% the capacitive load of version 1, find the
voltage for version 2 if the dynamic power of version 2 is reduced by 50% from version 1.
Answer)


4. (10pt) Assume when you parallelize a portion of the program, the speedup for that portion
is 3. Your application is 75% parallelizable. By how much could you decrease the frequency and
get the same performance?
Answer)


5. (10pt) The table below shows translated ARM assembly code from the C code. Fill the blank.
f:
push {r7}
sub sp, sp, #20
add r7, sp, #0
str r0, [r7, #12]
str r1, [r7, #8]
str r2, [r7, #4]
ldr r3, [r7, #8]
lsl r3, r3, #2
ldr r2, [r7, #12]
adds r3, r2, r3
ldr r2, [r3, #0]
ldr r3, [r7, #4]
cmp r2, r3
bne .L3
mov r3, #0
b .L4
.L3:
mov r3, #1
.L4:
mov r0, r3
add r7, r7, #20
mov sp, r7
pop {r7}
bx lr
int f (int* arg0, int arg1, int arg2) {
( )
else return 1;
}
Answer)


6. (15pt) Take a look at the clear(int* array, int size) function below. You could optimize this
code with arithmetic operations on a pointer. Fill the blanks
MOV r4, #0 ; i = 0
MOV r5, #0 ; r5 = 0
loop1:
STR r5, [r0, r4, LSL #2] ; array[i] = 0
ADD r4, r4, #1 ; i = i + 1
CMP r4, r1 ; i < size
BLT loop1
MOV r4, r0
MOV r5, #0
ADD r6, r0, r1, LSL #2
loop2:
( )
( )
BLT loop2
Answer)

7. (15pt) Describe briefly the following computers
(a) Desktop computers
(b) Server computers
(c) Embedded computer


















8. (10pt) Briefly compare the power, performance(speed) and capacity(size) among the
memory storages.
Register Cache Main Memory Storage
Power a. <--------------------------> b.
Speed c. <--------------------------> d.
Size e. <--------------------------> e.

Answer)


9. (10pt) Using 4-bit numbers to save space, multiply 0000 00102 01112. Complete the
table 1.

Table 1.

Iteration Step Multiplier Multiplicand Product


0 Initial values 0111 0000 0010 0000 0000
1

1 2

2 2

3 2

4 2

You might also like