CSE 230 Final Exam Review (Ch. 9) Questions with Correct Answers
(Grade A+)
Question 1: 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.
Question 2: 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.
Question 3: 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).
Question 4: 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.
Question 5: 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)
Question 6: 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
Page 1
(Grade A+)
Question 1: 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.
Question 2: 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.
Question 3: 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).
Question 4: 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.
Question 5: 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)
Question 6: 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
Page 1