1) 10111 is a 5bit pattern that is express is excess-16 notation. What is the decimal number?
so i went 1x16^4 + 1x16^2 + 1x16^1=65809, but the answer is 7.
notaton means that a numbers should be represented by the bit pattern equivalent to such number plus
. So, using
as input, you have
16+7 = 23 = 10111b
polska03 wrote:2) Convert 193(decimal) to a 10-but pattern using 2
s compliment notation/
is positive, you haven't to complement (just use
193 = 0011000001b
polska03 wrote:3)convert 3.4375(decimal) to an 8-bit floating point binarty patter that uses 1 bit for the sign, 3 bits for the exponent(excess-4 notation), and 4 bits of rthe manitssa.
I had no idea how to this one.
The sign is
since we have a positive number:
sign = 0b
Usually there is an implicit leading
in the mantissa, as, for instance in "IEEE 754 standard"
. I will follow such a convention. Hence your
bits mantissa is
i.e. a number ranging from
1.1111b = 2^0+2^-1+2^-2+2^-3+2^-4
); We need to multiply such a range by
, to include the given number, (
2 < 3.4375 < 3.875
), hence the exponent must be
, that is
exponent = 101b
now the mantissa, we have:
3.375 = 11.011b < 3.4375 < 3.5 = 11.100b
We've to pick one (they are at same distance from the given number). I choose
mantissa = 1100b
The final result is the following eight bit number
(Hope it makes sense).
polska03 wrote:for number 3, my prof gave told us the answer was 0 110 1110
That (probably) means your professor doesn't use the 'implicit leading 1 in the mantissa
' convention; this way your mantissa is
and we need an exponent of
(need to multiply the mantissa by
), that is
exponent = 6 = 110b
11.01b = 3.250 < 3.4375 < 3.500 = 11.10b
as best match, we obtain