Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1-suppose that ALUSrc=1 and MemWrite=0. Which of the following MIPS instructions

ID: 3762004 • Letter: 1

Question

1-suppose that ALUSrc=1 and MemWrite=0. Which of the following MIPS instructions might be executing?

sw $t0,4($t1)
lw $t0,4($t1)
beq $t0,$t1,l
andi $t0,$t1,2
add $t0,$t1,$t2

This multiblue choise question, which of above are correct(check all the apply)

---------------------------------------------------

2-You know that to multiply a binary integer by 16, all you have to do is shift the value over by 4 bit positions -- which in hardware can literally be done without a function unit simply by connecting bus wires such that bit k goes to position k+4 and positions 0-3 are connected to ground. Well, it's harder to multiply by 14. However, by using Booth's algorithm, a single 32-bit add/subtract ALU is sufficient to implement multiply of a 32-bit number by 14 as a fast combinatorial circuit. Explain how this would be done by giving a formula for X*14 as a C expression (for example, X*5 would be(X<<2)+X).

Explanation / Answer

1.

The following MIPS instructions might be executed when ALUSrc=1 and MemWrite=0

beq $t0,$t1,l

add $t0,$t1,$t2

2.

X*7 is normally computed as (X<<0) + (X<<1) + (X<<2);

Booth's algorithm does it as (X*8) - X:

(X<<3) - (X<<0)