1. Convert the following machine code instruction to assembly language
A) STUR X13, [X12 #16] B) AND X15, X14, X13
C) SUBS X13, X14, X15
D) ADDI X14, X15, #35
E) LSR X11, X10, #3
F) LDUR X11, [X10, #8] G) CBNZ X11, #68
H) CBZ X9, #72
I) B #96
J) BL #36
2. For the purpose of this problem, assume that the cbz instruction has a CPI of 7 but all other instructions in our ARM subset have a CPI of 5. A program consisting of 2,000,000 instruction is executed running at a 1 GHz clock rate. The program uses the following mix of instructions. 40% R-type, 10% Idur, 10% stur, 40% cbz.
What is the average CPI? (answer)
What speedup would result if the cbz were improved to CPI = 5? (answer)
3. Fill in the blanks with ARM assembly code corresponding to the given comments. USE ALL CAPS FOR MNEMONICS ANDLETTERS IN REGISTER NAMES FOR AUTOGRADING. Don’t include a semi-colon at the end of your statements.
Variables a,b,c and d are passed in as arguments, in that order.
(answer) #subtract a from b and place in register X13
(ANSWER) # If a==b jump to Else
(Answer) #add 100 to c
(ANSWER) #compute d= d+c
(ANSWER) #jump to exit
(Answer) #multiply c by 4
(Answer) #compute d=d-c
4. We are multiplying two eight bit numbers.
How may bits is the product? (ANSWER)
Out multiplier is 2710 and out multiplicand is 510
Given are the first three iterations of the flow chart above. Fill in step a and step b for iteration 4
Iteration Step a step b
1. 0000010100011011 -> 0000001010001101
2. 0000011110001101 -> 0000001111000110
3. 0000001111000110 -> 0000000111100011
4. (answer) -> (answer)
5.How many control lines are needed by a decoder to choose one of 47 outputs to activate?
STUR x9, [x10,0] What value is contained in register x10?
a) The value to be transferred from memory to register
b) The value to be transferred from register to memory
c) The address in memory of the value that is to be transferred to a register
d) The address in memory that a value in a register is to be transferred to