Answered step by step
Verified Expert Solution
Question
1 Approved Answer
bit 53 is 0 bit 53 is 1 and at least one known bit 54 or higher is 1 bit 53 is 1 and all
- bit 53 is 0
- bit 53 is 1 and at least one known bit 54 or higher is 1
- bit 53 is 1 and all known bits 54 and higher are 0 and bit 52 is 1
- bit 53 is 1 and all known bits 54 and higher are 0 and bit 52 is 0
Help with these cases, please!
Hw1: 1. (computer) Floating point operations are done by loading the operands into extended precision registers, performing the operation in extended precision, and then rounding the result to the nearest double precision number. Write a matlab script rounding.m to verify the IEEE double precision rounding of the result to nearest (page 10), by computing the sum 1+x with x =2^q or x=2^p +2^q, for suitable negative p,q. Bit numbers refer the bits of the mantissa to the right of the binary point, so 52 is the last stored bit. You should distinguish various cases, the first two are bit 53 is o bit 53 is 1 and at least one known bit 54 or higher is 1 Add the rest yourself. "known bit" means a bit stored in the extended precision. For each case, print the description as one line, then 1+x as string, e.g. '1+(21-53+21-54)' and the bits of 1+x using the function num2bitchar, and a one-line explanation. For example, in the first case above, the code disp('bit 53 is 0:') disp(['fl(1+(21-54))=', num2bitchar(1+(21-54)),'_2']) disp('rounding down, bit 53 stays zero') results in the output: bit 53 is 0: fl(1+(2454))=0011111111110000000000000000000000000000000000000000000000000000_2 rounding down, bit 53 stays zero Hw1: 1. (computer) Floating point operations are done by loading the operands into extended precision registers, performing the operation in extended precision, and then rounding the result to the nearest double precision number. Write a matlab script rounding.m to verify the IEEE double precision rounding of the result to nearest (page 10), by computing the sum 1+x with x =2^q or x=2^p +2^q, for suitable negative p,q. Bit numbers refer the bits of the mantissa to the right of the binary point, so 52 is the last stored bit. You should distinguish various cases, the first two are bit 53 is o bit 53 is 1 and at least one known bit 54 or higher is 1 Add the rest yourself. "known bit" means a bit stored in the extended precision. For each case, print the description as one line, then 1+x as string, e.g. '1+(21-53+21-54)' and the bits of 1+x using the function num2bitchar, and a one-line explanation. For example, in the first case above, the code disp('bit 53 is 0:') disp(['fl(1+(21-54))=', num2bitchar(1+(21-54)),'_2']) disp('rounding down, bit 53 stays zero') results in the output: bit 53 is 0: fl(1+(2454))=0011111111110000000000000000000000000000000000000000000000000000_2 rounding down, bit 53 stays zeroStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started