1011
(multiplicand) times
1010
(multiplier)
tracing the value of the multiplicand, multiplier, and
product after each step.
In base ten this is 11 times 10 which should give us 110 as answer. We initially pad the significand on the left with zeros to make it 8 bits because we keep shifting it left and we need room to shift it so we don't lose bits off the left end.
multiplicand multiplier product ------------ ---------- ------- 00000000 <-- initial value 00001011 1010 00000000 00010110 0101 00010110 00101100 0010 00010110 01011000 0001 + 01011000 ---------- 01101110 <-- answer is 110ten
1010
(multiplicand) times
1011
(multiplier)
tracing the value of the multiplicand, multiplier, and
product after each step.
In base ten this is 10 times 11 which should give us 110 as answer.
multiplicand multiplier product ------------ ---------- ------- 00000000 <-- initial value 00001010 1011 00001010 00010100 0101 + 00010100 ----------- 00011110 00101000 0010 00011110 01010000 0001 + 01010000 ----------- 01101110 <-- answer is 110ten
A
and B
Using DeMorgan's the NAND of A and B is $\overline{AB} = \overline{A} + \overline{B}$ (where $+$ means OR). So we just need to set:
Ainvert = 1 Binvert = 1 CarryIn = X Operation = 01 Less = X
0.1
to IEEE single precision format and
express your answer in hexadecimal.
The easiest way to do this is to keep multiplying by 2 and looking at the 1 or 0 to the left of the decimal place and look for a repeating sequence. .1(2) = 0.2 0 .2(2) = 0.4 0 .4(2) = 0.8 0 .8(2) = 1.6 1 .6(2) = 1.2 1 .2(2) = 0.4 looks like 0011 will repeat
So 0.1ten = $0.0\overline{0011} = 0.00011\overline{0011}$. Normalized this is $1.\overline{1001} \times 2^{-4}$
So sign = 0 8-bit exponent = -4 + 127 = 123ten = 01111011two 23-bit mantissa = 10011001100110011001100 the bits are 0011 1101 1100 1100 1100 1100 1100 1100 3 D C C C C C C
-0.3
to IEEE single precision format and
express your answer in hexadecimal.
Same exercise as above .3(2) = 0.6 0 .6(2) = 1.2 1 .2(2) = 0.4 0 .4(2) = 0.8 0 .8(2) = 1.6 1 .6(2) = 1.2 looks like 1001 will repeat
So 0.3ten = $0.0\overline{1001}$. It helps to expand the repeat a little so we can normalize. Normalized this is $1.\overline{0011} \times 2^{-2}$
So sign = 1 (because it was a negative number) 8-bit exponent = -2 + 127 = 125ten = 01111101two 23-bit mantissa = 00110011001100110011001 the bits are 1011 1110 1001 1001 1001 1001 1001 1001 B E 9 9 9 9 9 9
bf840000
represent, assuming it is interpreted as an IEEE single precision number.
The first thing to do is to write out the bits. b f 8 4 0 0 0 0 1011 1111 1000 0100 0000 0000 0000 0000 The number is negative becuase the sign bit is 1 The exponent is the next 8 bits; 01111111 = 127ten which has a 127 bias so subtracting 127 gives us an exponent of 0. The mantissa is the next 23 bits (don't forget the hidden leading 1). mantissa = 1.00001000000000000000000two The number is -1.00001two × 20 This is -1.03125