The following code has a control hazard
beq $t1, $t1, label2
label 1: add $s0, $s1, $s2
label2: sub $s3, $s4, $s5
True or false?
True
A control hazard can be resolved via a stall
True or False
True
To reduce stall due to branches, branch prediction involves executing a next instruction
even if the processor is not sure that instruction should be next
True or False
True
i1:lw $t0, 0($t0)
i2:add $t1, $t0, $t0
a. must stall
b. can avoid stalls using only forwarding
c. execute without stall or forwarding
i1: add $t1, $t0, $t0
i2: addi $t2, $t0, #5
i3: addi $t4, $t1, #5
a. must stall
b. can avoid stalls using only forwarding
c. execute without stall or forwarding
i1: addi $t1, $t0, #1
i2: addi $t2, $t0, #2
i3: addi $t3, $t1, #2
i4: addi $t3, $t0, #4
i5: addi $t5, $t0, #5
a. must stall
b. can avoid stalls using only forwarding
c. execute without stall or forwarding
,In CC 2, Instr1 and Instr2 are both in stage IM
true or false
False
the figure indicates that three ALUs are needed.
true or false
False
two instructions could possibly need to use the ALU simultaneously
true or false
false
Assuming a program has hundreds of instrustion( rather than just three as shown
above), how many instructions might possibly be executing during one clock cycle
A. 3
b. 5
Which is NOT part of stage 1L IF(instruction fetch)
A. instruction memory is read
B. the register file is written
C. the IF/ID register is written
Which is NOT part of stage 2: ID(instruction decode)
a. pc is incremented
b. register file is read
c. sign extension
d. control signals are generate for the current instruction
e. the IF/ID register is read, and the ID/EX register is written
Which is NOT part of stage 3: EX(execution)
a. the ALU operates
b. data memory is written
c. the ID/EX register is read, and the EX/MEM register is written
Which is NOT part of stage 4: MEM(memory)
a. instruction memory is read
b. Data memory is read
c. The EX/MEM register is read, and the MEM/WB register is written
Which is NOT part of stage 5: WB
, a. the register file is written
b. the MEM/WB register is read, and the IF/ID register is written
The store and load instruction behave similarly in stage 1(IF: instruction fetch)
True or False
True
The store and load instructions behave similarly in stage 2 (ID:instruction decode).
True or False
True
The store and load instructions behave similarly in stage 3:(EX: execute)
true or false
False
the store and load instructions both write the data memory in stage 4: (MEM: memory)
true or false
false
the store and load instructions differ in stage 5L (WB: write back) in that load writes to
the register file whereas store reads the register file
true or false.
False
Instr5 ( add $14..)
a. being fetched
b. being decoded
c. executing on the ALU
Instr3 ( add $12..)
a. being fetched
b. being decoded
c. executing on the ALU
Instr1(lw$10)
a. being fetched
b. writing back
c. Nothing, already done
Consider CC 6(clock cycle 6) What is Instr1(lw$10) doing?
a.writing back
b.Nothing, already done