For the following program, represent the CBZ and B instructions in binary:
ADDI X10, X1, #792
LOOP: LDUR X11, [X10, #0]
ADD X0, X0, X11
B END
SUBI X10, X10, #8
SUB X10, X10, X1
CBZ X10, LOOP
END:
Write the corresponding LEGv8 code for the following fragment of C code:
for(int i=1; i<30; i++) {
C[i] = C[i-1] - C[i+1]/16 - 5;
}
Assume that the index i is in register X5, C is an integer array, and the base address of C is in X10. Do not use division instruction in your code. Comment your assembly code.
We wish to compare the performance of two different machines: MI and M2. The following measurements have been made on these machines:
Program Time on M1 Time on M2
1 2 seconds 1.5 seconds
2 4 seconds 10 seconds
a) Which computer is faster for each program, and how many times as fast is it?
b) If the following additional measurements were made:
Program
Instructions executed on MI: 5x10^9
Instructions executed on M2: 6x10^9
and the clock rates of machine M1 and M2 are 2.5GHz and 2GHz respectively, find the clock cycles per instruction (CPI) for program I on each computer.
c) Assuming that CPI for program 2 on each computer is the same as the CPI for program 1 found in b, find the instruction count for program 2 running on each computer using the execution times from the first table.
Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI of 2.2.
b) If the processor P1 executes a program in 10 seconds, find the number of cycles and the number of instructions. What is the time reduction for P1?
Consider two different implementations of the same instruction set architecture. The instructions can be divided into four classes according to and2.
20% class D