Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pytharm 3 Part II: Binary Fixed-point Format to Floating-point Format (20 points) Write a function fixed.point.to.floating-.point ) that takes only one argument, a string called

Pytharm 3

image text in transcribed

Part II: Binary Fixed-point Format to Floating-point Format (20 points) Write a function fixed.point.to.floating-.point ) that takes only one argument, a string called value that contains a binary fixed-point number with exactly 23 digits to the right of the radix point. The function con- verts the fixed-point binary number into its 32-bit floating-point representation and returns the new representation as a string of '0' and '1' characters. Remember that the exponent must have 8 digits and the mantissa 23 Therefore, if the computed exponent in binary form has fewer than 8 bits, prepend as many zeroes as needed to make the exponent 8 bits. Likewise, if the mantissa has fewer than 23 digits, append zeroes as needed to make the mantissa 23 bits You may assume that only a negative sign might appear at the start of a number, never a positive sign. You might find the following Python functions useful . index (): https://www.tutorialspoint.com/python/string_index.htm . replace ): https://www.tutorialspoint.com/python/string replace.htm Function Call fixed point.to.floating-point ('-1100.00100000000000000000000') Return Value 11000001010000100000000000000000 Function Call fixed point.to.floating-point ('-0.00011100001010001111010') Return Value 10111101111000010100011110100000 Function Call fixed-point-to-floating-point(,-0. 00000000000000000000000, ) Return Value 10000000000000000000000000000000 Function Call fixed point.to.floating-point ('1111011.01110100111010100100101') Return Value 01000010111101101110100111010100

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

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

More Books

Students also viewed these Databases questions

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

1. PricewaterhouseCoopers

Answered: 1 week ago

Question

3. SCC Soft Computer

Answered: 1 week ago