Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the function decimal2binary, can a computer tell the numbers 1.23456 and 1.2345 apart if bfloat16 numbers are used? function [m,p,r] = decimal2binary(x,N) %Input %x:

Using the function decimal2binary, can a computer tell the numbers 1.23456 and 1.2345 apart if bfloat16 numbers are used?

function [m,p,r] = decimal2binary(x,N)

%Input %x: decimal number to translate %N: number of mantissa bits to use. %output %m: vector of N mantissa bits %p: decimal exponent of the binary floating number %r: remainder

m = zeros(N,1); p = floor(log(x)/log(2)); n = p; x = x-2^n;

for i = 1:N n = p-i; if 2^n <= x m(i) = 1; x = x-2^n; end end

r = x;

end

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

More Books

Students also viewed these Databases questions

Question

What are the key elements of the strategic management process?

Answered: 1 week ago

Question

6 Transfer tasks gently challenge the risk-averse. Discuss.

Answered: 1 week ago

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago