Professional Documents
Culture Documents
Exam2 Spr12 (ARM Version)
Exam2 Spr12 (ARM Version)
2. Convert these numbers between signed decimal and 16-bit two's complement
representation. (4 pts. each)
a. +113 _________
b. ________ 0x0145
c. -113 _________
d. ________ 0xfbae
3. Give the most negative 8-bit two's complement number in two formats: (4 pts. each)
5. Show the hexadecimal results of binary addition and subtraction of signed 16-bit two's
complement numbers. Identify any signed overflows. (4 pts ea).
r0 r1 r2
? ? ?
7. Give a sequence of ARM shift and orr instructions to rotate the value in register r0 by 4
bits to the left and place the result in register r1. You may use registers r2 and r3 as
temporaries. (As one example, if r0 contains 0x12345678, the result in r1 should be
0x23456781. However, your answer must work for any given value in r0.) (5 pts.)
8. Show the HARDWARE steps required in multiplication of two unsigned 4-bit binary
numbers, 1110 times 1101. (1110 is the multiplicand and 1101 is the multiplier.) The
details of mulscc are not required, but you should show the 3-register format of ACC,
MQ, and MDR, and be sure to place the multiplicand and multiplier in the correct
registers. (12 pts.)
9. Show the big-endian and little-endian byte ordering of the following data values. Start
the byte numbering of m at address 102. (8 pts.)
byte address: 102 103 104 105 106 107 108 109
little-endian ordering: ____ ____ ____ ____ ____ ____ ____ ____
big-endian ordering: ____ ____ ____ ____ ____ ____ ____ ____
Extra Credit
XC. Show how restoring division handles the division of an unsigned 8-bit binary
dividend, 11001001, by a 4-bit unsigned binary divisor, 0011. First, show the 3-
register format of ACC, MQ, and MDR, and be sure to place the dividend and
divisor in the correct registers. Then explain what happens. (5 pts.)