Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Imagine you are trying to represent the number: 4.0000003 in single precision. a

ID: 2267915 • Letter: I

Question

Imagine you are trying to represent the number: 4.0000003 in single precision. a. What bit pattern corresponds to the number 4? b. What bit pattern corresponds to the next largest number that can be represented? c. What decimal number corresponds to the bit pattern in (b)? d. Which of the above two binary patterns should be used to represent the number: 4.0000003? Why? e. What is the error introduced when this number is stored in single precision? Express your answer both as an absolute number, and as a fraction of the number being represented.

Explanation / Answer

Answer

a. Given we have to represent the number in single precision. This means that the fractional part of the number will be represented with a single bit. Therefore bit pattern corresponding to 4: '100.0'

(Here . represents the decimal)

b. Bit pattern for the next largest number is: '100.1'

c. This corresponds to: '4.5'

d. '100.0' should be used for representing the 4.0000003.

Reason

Error when '100.0' is used = |4 - 4.0000003| = 0.0000003

Error when '100.1' is used = |4.5 - 4.0000003| = 0.4999997

Therefore, error in case of '100.0' is less

e. Error introduced = 0.0000003 which is (0.0000003*100/4.0000003 = 7.5 x 10^(-6) %

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote