unsigned sign two's biased-127
magnitude complement
------------------------------------------------
01010100
------------------------------------------------
10111110
------------------------------------------------
10111110
------------------------------------------------
11001001
------------------------------------------------
01100111
+ 10010101
-------------
10010111
- 11001010
-------------
PART B (4 points) Show your work in doing
the following two's complement arithmetic.
If the result cannot fit in 8 bits, write the 8-bit result and
the word OVERFLOW.
11101011
+ 10111001
-------------
01010111
- 11001010
-------------
10010101
x 11110111
-------------
1010010 / 0110
x,
y, and
z,
after EACH of the following instructions in the SAL
code fragment is executed.
.data
x: .word 0x01234567
y: .word 0xffff0000
z: .word 0x99995555
.text
sll y, y, 12
nand y, y, x
xor z, z, x
sra z, z, 8
Turn in your file containing answers by running the script:
handinHW2 hw2file
where hw2file is an example name of a file
containing the homework answers.
The handinHW script submits your homework for you.
No printout will be turned in.
(We assume that you have put
/p/course/cs354-common/public/bin
in your path by now.)