CSE 230 Final Exam Review (Ch. 9) With
Complete Solutions
Which of the following describes 2-bit history table branch prediction?
A history table is used to store multiple bits, mapped to the branch instruction
address, indicating the history of the branch behavior. A state machine is used
to update the table.
Hardware designer specifies to always predict a taken or untaken branch.
The next instruction to load after a branch instruction is randomly chosen from
instruction memory.
A history table is used to store a single bit mapped to the branch instruction
address, indicating that the branch was previously taken or untaken. - ANSWER
A history table is used to store multiple bits, mapped to the branch instruction
address, indicating the history of the branch behavior. A state machine is used
to update the table.
What is an advantage of static branch prediction?
Increases hardware complexity.
High branch prediction accuracy (better than chance)
Increased performance.
Low branch prediction accuracy (no better than chance).
Simple implementation. - ANSWER Simple implementation.
What is a disadvantage of static branch prediction?
Simple implementation.
High branch prediction accuracy (better than chance)
Increased performance.
Increases hardware complexity.
, Low branch prediction accuracy (no better than chance). - ANSWER Low branch
prediction accuracy (no better than chance).
What is a disadvantage of a dynamic branch prediction method, like history
table?
Increased performance.
Simple implementation.
Low branch prediction accuracy (no better than chance).
Increases hardware complexity.
High branch prediction accuracy (better than chance) - ANSWER Increases
hardware complexity.
What is an advantage of dynamic branch prediction methods, such as history
tables, over static branch prediction?
Increased hardware complexity.
Decreased hardware complexity
Improved branch prediction accuracy (better than chance)
Low branch prediction accuracy (no better than chance). - ANSWER Improved
branch prediction accuracy (better than chance)
Given the following code, what hazards occur?
lw $s1, 0($s0)
lw $s2, 4($s0)
add $s3, $s1, $s2
sw $s3, 12($s0)
lw $s4, 8($s0)
add $s5, $s1, $s4
Control Hazards
Structure Hazards
None of these.
Data Hazards - ANSWER Data Hazards
Complete Solutions
Which of the following describes 2-bit history table branch prediction?
A history table is used to store multiple bits, mapped to the branch instruction
address, indicating the history of the branch behavior. A state machine is used
to update the table.
Hardware designer specifies to always predict a taken or untaken branch.
The next instruction to load after a branch instruction is randomly chosen from
instruction memory.
A history table is used to store a single bit mapped to the branch instruction
address, indicating that the branch was previously taken or untaken. - ANSWER
A history table is used to store multiple bits, mapped to the branch instruction
address, indicating the history of the branch behavior. A state machine is used
to update the table.
What is an advantage of static branch prediction?
Increases hardware complexity.
High branch prediction accuracy (better than chance)
Increased performance.
Low branch prediction accuracy (no better than chance).
Simple implementation. - ANSWER Simple implementation.
What is a disadvantage of static branch prediction?
Simple implementation.
High branch prediction accuracy (better than chance)
Increased performance.
Increases hardware complexity.
, Low branch prediction accuracy (no better than chance). - ANSWER Low branch
prediction accuracy (no better than chance).
What is a disadvantage of a dynamic branch prediction method, like history
table?
Increased performance.
Simple implementation.
Low branch prediction accuracy (no better than chance).
Increases hardware complexity.
High branch prediction accuracy (better than chance) - ANSWER Increases
hardware complexity.
What is an advantage of dynamic branch prediction methods, such as history
tables, over static branch prediction?
Increased hardware complexity.
Decreased hardware complexity
Improved branch prediction accuracy (better than chance)
Low branch prediction accuracy (no better than chance). - ANSWER Improved
branch prediction accuracy (better than chance)
Given the following code, what hazards occur?
lw $s1, 0($s0)
lw $s2, 4($s0)
add $s3, $s1, $s2
sw $s3, 12($s0)
lw $s4, 8($s0)
add $s5, $s1, $s4
Control Hazards
Structure Hazards
None of these.
Data Hazards - ANSWER Data Hazards