QUESTION: What is the largest base-10 positive number that can be stored using 7 bits, where the 1st bit is used for the sign of the number; the 2nd bit for sign of the exponent; 3 bits for mantissa, and the rest of the bits for the exponent?
ANSWER: Remember the base is 2.
1st bit will need to be zero as the number is positive.
2nd bit will need to be zero as that will make the exponent positive as 2^positive. number will give higher number than 2^negative number.
The mantissa bits will need to be 111 as you are looking for largest number and that will give the number to be 1.111 (the 1 before radix point is automatic) in base of 2 or 1*2^0+1*2^(-1)+1*2^(-2)+1*2^(-3)=1.875 in base of 10.
Now the exponent: it uses 2 bits. This will need to be 11 in base 2 and that is 3 in base 10. So the exponent part is 2^(+3)=8.
Largest number is +1.875*8=15
Now think what will give you the smallest positive number.
This post is brought to you by
- Holistic Numerical Methods: Numerical Methods for the STEM undergraduate athttp://nm.MathForCollege.com
- Introduction to Matrix Algebra for the STEM undergraduate at http://ma.MathForCollege.com
- the textbook on Numerical Methods with Applications available from the lulu storefront,
- the textbook on Introduction to Programming Concepts Using MATLAB, and
- the Massive Open Online Course (MOOC) available at https://canvas.instructure.com/enroll/KYGTJR