Write a C/C++ program to extract the sign bit, exponent field, and the fraction field of a 32-bit hexadecimal number (in the IEEE 754 standard) and then compute the corresponding floating- point in decimal using the formula sign (-1)*8" × (1+ fraction × 2-23 ) ×2(exponent-127) (You can ignore special cases including 0). Print each field as unsigned hexadecimal (%X) and the decimal value in scientific notation ("%E"). Then apply for your program to the following four representations (single precision only) 19 ten- -716 ten- 0.3 ten. 63.50 ten-

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 7PP: (Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point...
icon
Related questions
Question
Write a C/C++ program to extract the sign bit, exponent field, and the fraction field of a 32-bit
hexadecimal number (in the IEEE 754 standard) and then compute the corresponding floating-
point in decimal using the formula
sign
)x2(ехponent-27)
(-1)"8" × (1+ fraction × 223 )×2(exponent–127)
(You can ignore special cases including 0). Print each field as unsigned hexadecimal (%X) and
the decimal value in scientific notation ("%E"). Then apply for your program to the following four
representations (single precision only)
19 ten.
-7/6 ten-
0.3 ten-
63.50 ten-
Transcribed Image Text:Write a C/C++ program to extract the sign bit, exponent field, and the fraction field of a 32-bit hexadecimal number (in the IEEE 754 standard) and then compute the corresponding floating- point in decimal using the formula sign )x2(ехponent-27) (-1)"8" × (1+ fraction × 223 )×2(exponent–127) (You can ignore special cases including 0). Print each field as unsigned hexadecimal (%X) and the decimal value in scientific notation ("%E"). Then apply for your program to the following four representations (single precision only) 19 ten. -7/6 ten- 0.3 ten- 63.50 ten-
Expert Solution
steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning