question archive Please read the following code, and answer the questions: main: addi x5, x0, 10 addi x6, x0, 0 jal x0, block_b block_a: add x6, x6, x7 addi x10, x0, 1 addi x11, x6, 0 ecall jal x0, end block_b: addi x7, x0, 0 addi x8, x0, 0 jal x0, block_c block_c: sub x9, x5, x7 bge x8, x9, block_a add x7, x7, x8 add x12, x8, x7 addi x8, x8, 1 jal x0, block_c end: 1
Subject:Electrical EngineeringPrice: Bought3
Please read the following code, and answer the questions: main: addi x5, x0, 10 addi x6, x0, 0 jal x0, block_b
block_a:
add x6, x6, x7
addi x10, x0, 1
addi x11, x6, 0
ecall
jal x0, end
block_b:
addi x7, x0, 0
addi x8, x0, 0
jal x0, block_c
block_c:
sub x9, x5, x7
bge x8, x9, block_a
add x7, x7, x8
add x12, x8, x7
addi x8, x8, 1
jal x0, block_c
end:
1. What technique do you think is the most effective way of addressing the hazards in this program? Justify your choice
2. how do we get a new program that resolves all hazards using the technique you selected in the previous question. Indicate the number of cycles required to complete execution. What is the cycle difference compared to a program that ignores hazards?
3. Based on your implementation, discuss the advantages and disadvantages of the hazard-handling method. How might you reduce the cycle count even further?