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

  Develop a simulation program

Develop a simulation program

  Program that gets 10 numbers and stores then in an array

Write a program for a child's rectangle play yard is to be built next to the house. To make the three sides of the play-pen, twenty-four meters of fencing are available.

  The train will be unsafe if the normal acceleration is

a train track is designed with a radius of 20 meters. the train will be unsafe if the normal acceleration is greater

  Script that will graphically show the range of frequency

the script that will graphically show the range of frequencies for which the ouput amplitude is less than 70% of the input amplitude. The original problem statement

  Write a matlab script that solves ode

Write a matlab script that solves ODE: y' = 4/(1+x^2) using forward Euler's, improved Euler, classical Runge-Kutta, and Adams-Bashforth methods.

  Estimation of the rayleigh limit

Propose a method that would allow estimation of the Rayleigh limit experimentally - Rayleigh frequency resolution limit

  Estimate the area of the tea spill

The surface area of a tea spill is estimated by measuring the width (in cm) of the spill at equally spaced intervals of 1.5 cm (width data is found in TeaSpill.txt). Use numerical integration to estimate the area of the tea spill.

  Matlab command that will create a ten-element column vector

MatLab command that will create a ten-element column vector named

  Random processes

Theme: Random Processes, Compute and plot separate correlation functions of white noise data and of sinusoidal data. Do this using both the biased and unbiased autocorrelation functions. Are the results what you expected?

  Problem gauss-seidel method

Write all of the above sets of equations in the matrix format and identify the sets that you cannot solve by using an iterative method such as Jacobi and/or Gauss-Seidel method. Show the details of how you decide that the method will not converge ..

  Create a matrix of 5x6

Prepare a matrix of 5x6. with identical columns and rows ranging from 200 to 1000 in equal increments

  What are corresponding displacement field and strain field

Write a short Matlab (or whatever language you prefer) program to perform 2 point Gauss integration of a function f over a given interval (a, b). Inputs: a, b, and the functional values of f at the two Gauss points x1 and x2, f 1) and f (x2). (The..

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