mt1sol - (ii) 10110110-111011 First extend the second...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE-C355-701 Solutions to Midterm # 1 Q1(i) 43 = 32+11 = 32 +8+2+1 gives 101011 2 Convert fractional part by repeated multiplication 0.375 X 2 0|.750 X2 1|.500 X 2 1|.000 which gives 0.375 = 0.011 2 So 43.375 = 101011.011 2 = 10|1011|.0110| = 2B.6 hex = 101|011|.011= 53.3 8 (ii) 345.67 8 = 011100101.110111 2 = 1110|0101|.1101|1100 = E5.DC hex = 64 7 8 6 5 8 * 4 64 * 3 + + + + = 192+32+5 +0.75+0.109375 = 229.859375 10 Q2. Worked out in class. Refer to your notes. Q3. (i) 10010111 +01110010 1|00001001 Carry =1 Overflow=0 (since numbers being added are of opposite signs) Interpretation: In unsigned representation, the numbers being added are 151 and 114 The sum is 265 which is out of range , the range for 8-bit unsigned numbers being 0-255. This error is indicated by the carry being set In signed representation the numbers being added are -105 and 114. The sum is +9 which is well within the range for signed 8 – bit numbers -128 to +127 Hence the overflow flag is not set
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (ii) 10110110-111011 First extend the second (unsigned) number to 8 bits as 00111011 Take its 1s complement as 11000100 Add 1 to get its 2s complement as 11000101 Add this to the first number as follows: 10110110 + 11000101 1|01111011 Since the carry arises the 8-bit result is correct and it is 01111011 Verify 182 59 = 123 Q4. Need 5 bits to represent both +11 and -9 in 2s complement Multiplicand = 01011 (+11) Multiplier = 10111 (-9) Set up table for Booths algorithm as given below: A Q Q -1 M Count Remarks 00000 10111 0 01011 5 Intitialize registers-01011 10 subtract A M 10101 10111 11010 11011 1 4 Shift right 11101 01101 1 3 11 shift right 11110 10110 1 2 11-Shift right +01011 01 add A+M 01001 10110 1 Ignore borrow 00100 11011 0 1 Shift right-01011 10 subtract A-M 11001 11011 11100 11101 1 0 11 Shift right , stop Product is 1110011101 = - 128+16+8+4+1= -99...
View Full Document

Page1 / 2

mt1sol - (ii) 10110110-111011 First extend the second...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online