Homework 3 Computer Architecture
Homework 3 Computer Architecture
Homework 3 Computer Architecture
• 5ED4 – 07A4 when these values represent signed 16-bit hexadecimal numbers stored in sign-
magnitude format:
5ED4 gives VALUE of 0101 1110 1101 0100
07A4 gives VALUE of 0000 0111 1010 0100
Therefore, 5ED4 – 07A4 = 0101 1110 1101 0100 − 0000 0111 1010 0100 = 0101 0111 0011 0000 =
5730
2/
• Calculate the product of the hexadecimal unsigned 6-bit integers 62 and 12
62hex=01100010bin
12hex=00010010bin
Interation Step Multiplier Multiplicand Product
0 Initialize 00010010 0000000001100010 0000000000000000
1 Rightmost bit = 0 00010010 0000000001100010 0000000000000000
Shift 00001001 0000000011000100 0000000000000000
2 Rightmost bit = 1 00001001 0000000011000100 0000000011000100
Shift 00000100 0000000110001000 0000000011000100
3 Rightmost bit = 0 00000100 0000000110001000 0000000011000100
Shift 00000010 0000001100010000 0000000011000100
4 Rightmost bit = 0 00000010 0000001100010000 0000000011000100
Shift 00000001 0000011000100000 0000000011000100
5 Rightmost bit = 1 00000001 0000011000100000 0000011011100100
Shift 00000000 0000110001000000 0000011011100100
6 Rightmost bit = 0 00000000 0000110001000000 0000011011100100
Shift 00000000 0001100010000000 0000011011100100
7 Rightmost bit = 0 00000000 0001100010000000 0000011011100100
Shift 00000000 0011000100000000 0000011011100100
8 Rightmost bit = 0 00000000 0011000100000000 0000011011100100
Shift 00000000 0110001000000000 0000011011100100
Result:
Quotient = 000 011 = 3
Remainder = 001 001 = 11
74/21 3 remainder 9
3/
5/
• 2.6125x101 + 4.150390625x101
2.6125x101 = 26.125 = 11010.001 = 1.1010001000x24
4.150390625x101 = .4150390625 = .011010100111 = 1.1010100111x2-2
Shift binary point 6 to the left to align exponents,
GR
1.1010001000 00
1.0000011010 10 0111 (Guard 5 1, Round 5 0, Sticky 5 1)
1.1010100010 10
In this case the extra bit (G,R,S) is more than half of the least signifi cant bit (0).
Thus, the value is rounded up.
1.1010100011x24 = 11010.100011x20 = 26.546875 = 2.6546875x101
• -8.0546875 x -1.79931640625x10-1
-8.0546875 = -1.0000000111x23
-1.79931640625x101 = -1.0111000010x2-3
Exp: -3 + 3 = 0, 0 + 16 = 16 (10000)
Signs: both negative, result positive Fraction:
1.0000000111
x 1.0111000010
00000000000
10000000111
00000000000
00000000000
00000000000
00000000000
10000000111
10000000111
10000000111
00000000000
10000000111
1.01110011000001001110
1.0111001100 00 01001110
Guard = 0,
Round = 0,
Sticky = 1:NoRnd
1.0111001100x20 = 0100000111001100 (1.0111001100 = 1.44921875)
-8.0546875 x .179931640625 = 1.4492931365966796875