Discussion:
Sign extension?
(too old to reply)
Archit N.C.
2005-09-19 18:52:42 UTC
Permalink
In question 3.9 on the homework, it says that A_upper needs to be
adjusted because A_lower will be sign extended. But A_lower is a 16-bit
field (the 16 lower-order bits of A), and the immediate value in the lw
instruction is also 16 bits (as per the format of I-type instructions),
so why is any sign extension necessary in the first place?

Archit.
Alan Lee
2005-09-19 20:55:07 UTC
Permalink
The calculation in the load word instruction is performed using 32-bit
arithmetic because the base register is 32 bits even though the offset
is only 16 bits.
In question 3.9 on the homework, it says that A_upper needs to be adjusted
because A_lower will be sign extended. But A_lower is a 16-bit field (the 16
lower-order bits of A), and the immediate value in the lw instruction is also
16 bits (as per the format of I-type instructions), so why is any sign
extension necessary in the first place?
Archit.
Continue reading on narkive:
Loading...