Download presentation
Presentation is loading. Please wait.
1
Data Hazard Example (stall)
2
Code add $1, $1, $1 lw $2, 0($1) add $4, $2, $5 add $4, $4, $2
Where contents of $1 is initially 6 contents of $2 is initially 20 contents of $4 is initially 32 contests of $5 is 57 contents of memory location 12 is -1
3
add $1, $1, $1
4
lw $2, 0($1) add $1, $1, $1 1 6 1 6 1 1 1 1
5
add $4, $2, $5 lw $2, 0($1) add $1, $1, $1 1 6 6 6 2 12 ? 6 6 1 2 2 1 1 1
6
Hazard Unit compares these registers
add $4, $4, $2 add $4, $2, $5 lw $2, 0($1) add $1, $1, $1 1 2 5 2 1 2 20 6 12 5 12 10 12 57 2 12 5 4 2 2 1 5 1 1 1 2
7
add $4, $4, $2 add $4, $2, $5 nop lw $2, 0($1) add $1, $1, $1 2 20 5
12 -1 1 57 12 12 2 12 5 5 2 4
8
add $9, $4, $4 add $4, $4, $2 add $4, $2, $5 nop lw $2, 0($1) 4 32 20
-1 -1 2 -1 2 01 56 -1 20 -1 57 -1 57 12 4 12 2 2 5 4 4 4 2 2 5 1
9
add $9, $4, $4 add $4, $4, $2 add $4, $2, $5 nop 4 32 32 56 4 56 10 55
-1 -1 4 56 4 4 2 4 4 9 4 4 4 1 2
10
add $9, $4, $4 add $4, $4, $2 add $4, $2, $5 32 56 55 55 10 4 110 56 32 56 56 55 56 55 10 55 4 9 4 9 4 4 1 4 4 1
11
add $9, $4, $4 add $4, $4, $2 4 55 55 55 110 9
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.