Suppose the MIPS ALU, in addition to a zero flag output, also has an additional
ID: 653615 • Letter: S
Question
Suppose the MIPS ALU, in addition to a zero flag output, also has an additional flag output for negative which equals 1 whenever the computation result of the ALU is negative (i.e., has high-order bit set to 1. Show how to modify the data path to include, in addition to beq, the branch instructions bne (branch if not equal), bltz (branch if less than 0), and bgez (branch if greater than or equal to 0). You may assume the following: Control produces an additional 2-bit output, Branch Type that equals 00 for beq, 01 fo bne, 10 for bltz and 11 for bgez. The branch instructions bltz and bgez will make the second input register equal the $zero register. Hint: the circuitry that determines whether or not to take the branch (ie., the conditional that feeds into the MUX making that determination) gets a bit more complicatedExplanation / Answer
1.
beq $zero, 00, loop
bne $zero, 01, loop
bltz $zero, 10, loop
bsez $zero, 11, loop
2.
bltz $zero, $t, $t=$zero
bgez $zero, $t, $t=$zero
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.