Assignment 1 Solution
Assignment 1 Solution
Assignment 1 Solution
Assignment #1
Assignment # 1: Solution
(Due-Date: Sec-3: April 11, 2011, Due in Class)
(Due-Date: Sec-2: April 12, 2011, Due in Class)
(Due-Date: Sec-1: April 13, 2011, Due in Class)
Page 1 of 7
(35-Points)
EE2323
Assignment #1
(d). Convert the following from Decimal fraction to Single precision Floating point
representation and show result in hexadecimal form
79.35
= (1001111.010110)2
= 1. 001111010110 x 26 (Normalized Form)
Sign = 0
Exponent = 6
Biased Exponent = 127 + 6 = 133 = (10000101)2
Fraction = 001111010110
Mantissa = 00111101011000000000000
Single Precision Floating Point No. = 01000010_10011110_10110000_00000000
= 0x429EB000H
-143
= (10001111)2
= 1.0001111 x 27 (Normalized Form)
Sign = 1 (-ve Number)
Exponent = 7
Biased Exponent = 127 + 7 = 134 = (10000110)2
Fraction = 0001111
Page 2 of 7
EE2323
Assignment #1
Mantissa = 00011110000000000000000
Single Precision Floating Point No. = 11000011_00001111_00000000_00000000
= 0xC30F0000H
0.0325
= (0.00001000)2
= 1.000 x 2-5 (Normalized Form)
Sign = 0
Exponent = -5
Biased Exponent = 127 - 5 = 122 = (01111010)2
Fraction = 0000
Mantissa = 00000000000000000000000
Single Precision Floating Point No. = 00111101_00000000_00000000_00000000
= 0x3D000000H
Q #2. Do the following arithmetic
(20-Points)
(a) Do the following computation in 2s complement arithmetic and convert result back into
decimal
i.
64 71 in 2s complement
64 = (01000000)2
71 = (01000111)2
-71 = (10111001)2
Page 3 of 7
EE2323
Assignment #1
(0010101)2 = 21
(b) Do the following computation in BCD arithmetic and convert result back into decimal
i.
35+49
35 = 00110101
, 49 = 01001001
, 57 = 01010111
addressable memory starting from address 0x01F6. Data will be stored in same
sequence it is written.
(20-Points)
0xA0C0 , 0x42526272 , 0x7F , 0x4321 , 0x5A , 0x49 , 0xBBAA9988
(a). If memory is Little endian
Address
Memory Data
Address
Memory Data
0x0305
0x02FD
0x21
0x0304
0xBB
0x02FC
0x7F
0x0303
0xAA
0x02FB
0x42
0x0302
0x99
0x02FA
0x52
0x0301
0x88
0x02F9
0x62
0x0300
0x49
0x02F8
0x72
0x02FF
0x5A
0x02F7
0xA0
0x02FE
0x43
0x02F6
0xC0
Page 4 of 7
EE2323
Assignment #1
Memory Data
Address
Memory Data
0x0305
0x02FD
0x43
0x0304
0x88
0x02FC
0x7F
0x0303
0x99
0x02FB
0x72
0x0302
0xAA
0x02FA
0x62
0x0301
0xBB
0x02F9
0x52
0x0300
0x49
0x02F8
0x42
0x02FF
0x5A
0x02F7
0xC0
0x02FE
0x21
0x02F6
0xA0
(c ). Which of the data in part (a) & (b) is stored at aligned addresses and which data is
stored at mis-aligned addresses
0xA0C0 , 0x42526272 , 0x7F , 0x4321 , 0x5A , 0x49 , 0xBBAA9988
Data
Address
Aligned/Misaligned
0xA0C0
0x02F6
Aligned
0x42526272
0x02F8
Aligned
0x7F
0x02FC
Aligned
0x4321
0x02FD
Misaligned
0x5A
0x02FF
Aligned
0x49
0x0300
Aligned
0xBBAA9988
0x0301
Misaligned
(20-Points)
Q # 4.
(a). Compute value of 20-bit Physical address for following Base and Offset pairs:
Page 5 of 7
EE2323
Assignment #1
0x1050 : 0x1236
0xA125 : 0x4075
0x0A68 : 0x70B6
0xB1AB : 0x802A
0x850A : 0x1245 = PA ?
0xD765 :
= 0xDABC0
= 0xDABC0 0xD7650
Page 6 of 7
EE2323
Assignment #1
= 0x3570
? :
0xCD21 = 0x32D21
= 0x2600
Page 7 of 7