Professional Documents
Culture Documents
Question 1: [Microprocessor]
a) Demonstrate in MIPS instruction; how can a value be loaded into a register $25 and how it will
be cleared from that register? [2 Marks]
b) Explain; would it be correct to shift the contents of register $8 and put the result back in register
$8? Why or why not?
i. ori $8, $0, 0x6F # put bit pattern register into $8
ii. sll $8, $8, 2 # shift left logical by two
[2 Marks]
c) Explain; is a 32-bit general register likely to hold the result of multiplying two other 32- bit
registers? [2 Marks]
d) The polynomial 5x2 -12x + 97 can be calculated for a value of x in memory and then stored
the result at a location poly in memory. Examine, how many lw and sw instructions will be
needed to solve the polynomial? [2 Marks]
e) Will a 32-bit address fit inside the 32-bit beq instruction? [2 Marks]
Compute the following operation and also show the carry and overflow in your computation (if any).
a) 1C37286A + 9395E84B (without transforming it into binary) [2 Marks]
b) 1C37286A - 9395E84B (using 2’s Complement) [2 Marks]
c) 11110110 - 10101011 (using 2’s Complement) [2 Marks]
Page 1 of 2
Question 4: [Performance]
a) A program has 50 percent of its code enhanced to yield a system speedup 2.3 times faster.
What is the factor of improvement of the portion enhanced? [3 Marks]
b) A compiler designer is trying to decide between two code sequences for a particular machine.
Based on the hardware implementation, there are three different classes of instructions: class
A, class B, and class C, and they require one, two, and three cycles per instruction, respectively.
The first code sequence has 8 instructions: 2 of A, 2 of B, and 4 of C
The second sequence has 7 instructions: 3 of A, 2 of B, and 2 of C
Compute the CPU cycles for each sequence. Which sequence is faster? What is the CPI for
each sequence? [3 Marks]
Utilizing MIPS ISA, create an assembly program that can calculate the area of a circle for user given
radius (r). However, if users give a radius <= 0, ask them to re-enter the correct radius value. (E.g.,
Area=πr2) [5 Marks]
Question 6: [Pipelining]
Discuss, Program Counter, Stack Pointer and Pipelining? Diagram a scenario how Pipelining improves
the performance of a processor [1+1+2+3=7 Marks]
Page 2 of 2