Write a code that will convert from ieee-754 floating-point

Assignment Help MATLAB Programming
Reference no: EM131105845

For this project, write three separate codes:

1. Convert from decimal to binary.

2. Convert from binary to decimal.

3. Convert from decimal to IEEE-754 format.

Be sure to take into consideration whole numbers, floating-point numbers, and repeating patterns.

Write a code that will convert from IEEE-754 floating-point representation to decimal.

Hint: the built-in commands str2num and num2str may prove useful for certain parts of your code.

Copy your code, command lines, and answers for each case into a Word document.

function [Ibase2]= Convert10to2(Ibase10,n)

% Convert the integral part by successive divisions by 2
Ibase2=[];

if (Ibase10~=0)

while (Ibase10>0)

q=fix(Ibase10/2);
r=Ibase10-2*q;
Ibase2=[r Ibase2];
Ibase10=q;
end

else
Ibase2=0;
end

o = length(Ibase2);
% append redundant zeros
Ibase2 = [zeros(1,n-o) Ibase2]; 

Reference no: EM131105845

Questions Cloud

Find the work done in stretching the spring : A spring of natural length 12 in. requires a force of 6.0 lb to stretch it 2.0 in. See Fig. 26.64. Find the work done in stretching it 6.0 in. From Hooke's law, we find the constant for the spring, and therefore f(x)  as
What are the price elasticity of demand : Define elasticity. What are the price elasticity of demand, price elasticity of supply, income elasticity of demand and cross elasticity of demand?
Compute contribution margin ratio and margin of safety ratio : Prepare a CVP income statement for 2014 based on management's estimates. Compute the break-even point in (1) units and (2) dollars. Compute the contribution margin ratio and the margin of safety ratio.
Top edge at the surface of the water : Determine each of the following as being either true or false. For a vertical rectangular floodgate, 4 m wide and 2 m high, with its top edge at the surface of the water, the force on the floodgate is
Write a code that will convert from ieee-754 floating-point : Convert from decimal to binary. Convert from binary to decimal. Convert from decimal to IEEE-754 format. Write a code that will convert from IEEE-754 floating-point representation to decimal.
What about these data is limiting, and why : What strategies might be employed to overcome these threats to validity and limitations?
Form of uncompetitive markets : Market failure exists in the form of uncompetitive markets and those which negatively or positively affect people who are not participants as buyers or sellers. Provide an example of such a market and indicate how government policy might correct t..
Calculate the balances in the general ledger accounts : Calculate the balances in the general ledger accounts. Use an Excel spreadsheet or a printing calculator to run the numbers several times. Don't use a hand-held calculator, as it's far too easy to make a mistake using it.
Describe a famous attack that leveraged it : For this conference, explain what a specific vulnerability is, describe a famous attack that leveraged it (For example, the Morris worm leveraged the buffer overflow vulnerability), and how it can be prevented/minimized.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd