Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer in C++ please The purpose of this lab is to familiarize yourself with IEEE 754 floating point (FP for the rest of this lab)

Answer in C++ pleaseimage text in transcribed

The purpose of this lab is to familiarize yourself with IEEE 754 floating point (FP for the rest of this lab) operations as well as the internal representation of the information in the machine. By this point, you will be expected to all of your work in assembler. However, if you find yourself still having difficulty, you may implement the algorithm(s) you choose to address the items below in the high level language of your choice (e.g., ANSI C++ with the STL), examine the assembler listing for your program, and then manually write an assembler program based upon this output. To document that you have done the requisite work, you will need to use the script utility as well as taking screen shots (as JPEG files) of those utilities that are GUI only (such as the GUI portions of ddd or ebe). We will consider the following values as decimal numbers, where := is the assignment operator (the = symbol in C++). SA := 500.312 as single precision FP. DA: = 500.312 as double precision FP. SPI := the value of n as single precision FP. DPI := the value of it as double precision FP. SB := 1.456 x 10 as single precision FP. DB := 1.456 x 10 as double precision FP. 1, Write a routine that will display each of these numbers as hexadecimal digits using the internal representation of FP on the machine. 2. Write a routine that will compute the product of SA and SB and store the result in a new variable named SC, and then display SC as in item 1. 3. Write a routine that will extract just the internal FP representation of the exponent of SB and DB and then, first, display the result as a 2s complement integer in base binary (so that the number will be converted from excess to complement form), and second, display the same number as base decimal (question: do you get 5, 6, or 7 for the result -- why? The purpose of this lab is to familiarize yourself with IEEE 754 floating point (FP for the rest of this lab) operations as well as the internal representation of the information in the machine. By this point, you will be expected to all of your work in assembler. However, if you find yourself still having difficulty, you may implement the algorithm(s) you choose to address the items below in the high level language of your choice (e.g., ANSI C++ with the STL), examine the assembler listing for your program, and then manually write an assembler program based upon this output. To document that you have done the requisite work, you will need to use the script utility as well as taking screen shots (as JPEG files) of those utilities that are GUI only (such as the GUI portions of ddd or ebe). We will consider the following values as decimal numbers, where := is the assignment operator (the = symbol in C++). SA := 500.312 as single precision FP. DA: = 500.312 as double precision FP. SPI := the value of n as single precision FP. DPI := the value of it as double precision FP. SB := 1.456 x 10 as single precision FP. DB := 1.456 x 10 as double precision FP. 1, Write a routine that will display each of these numbers as hexadecimal digits using the internal representation of FP on the machine. 2. Write a routine that will compute the product of SA and SB and store the result in a new variable named SC, and then display SC as in item 1. 3. Write a routine that will extract just the internal FP representation of the exponent of SB and DB and then, first, display the result as a 2s complement integer in base binary (so that the number will be converted from excess to complement form), and second, display the same number as base decimal (question: do you get 5, 6, or 7 for the result -- why

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions