If the clock frequency of a processor is 1 GHz and the avera
If the clock frequency of a processor is 1 GHz and the average cycles per instruction (CPI) Is 1.5 how long will it take to execute 1 billion (1 times 109) instructions? Given the value for x is stored in register $t0 give the MIPS assembly language statements to compute: 2x + 5 Which of the following items is not true of the MIPS processor? It has very few registers. It has very simple instructions. It tries to make the common case fast for instructions. All instructions are 32 bits.
Solution
Ans1:
CPU time = I * CPI * C
, where I = Number of instructions executed
CPI = Average CPI for program
C = CPU clock cycle
And C = 1/ clock frequency
=> CPU time = 109 * 1.5 * (1 / 109) = 1.5 sec
Ans 2:
.text
.globl main
main:
ori $t0, $0, 1 #Given put x into $t0
ori $8, $0, 2 #puts 2 into $8
ori $9, $0, 5 #puts 5 into $9
mult $8, $t0 # lo = 2x
mflo $10 #$10 = 2x
add $11, $10, $9 #$11 = 2x + 5
## End of file
Ans 3 : Option (a) is not true
Registers make the faster executions. CPU cycle is related to registers. S CPU cycle is faster in MIPS. therefore MIPS have more registers.
