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

  Print out the number of elements

Solve the problem using MATLAB Make a variable ts that has 30 elements and goes from 0 to 2 pi

  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.

  Elementary numerical methods and programming

Project involes determining the dynamics of the double pendulum with a sliding base. Each link is assumed to be of square cross section - MECH 3010: Elementary Numerical Methods and Programming

  Matlab – discrete time simulation

MATLAB – Discrete time simulation, solve  Discrete time syetm problem,  DT kalman filter problem,  Steady state DT kalman filter problem

  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.

  Prepare the matlab script code

Prepare the MatLab Script Code written for - create a row array with m elements consisting of all the integers from 1 to m. Use disp to display the resulting array. For m, use 15.

  Plot the angular velocity of the pendulum

Plot the angle of the pendulum as calculated from all three ODE solver methods on a single plot, ensuring that the plot is titled, all axes are labelled, units are indicated, and the legend for each solver displayed in Best configuration.

  Recall the velocity of the falling parachutist

Question: Recall the velocity of the falling parachutist can be computed by  V(t) = gm(1-e -c/mx )/c,  Use first order error analysis to estimate the error of v at t=6. If g=9.8 and m=50 but c=12.5 +_ 1.5

  It''s a mechanical engineering project proposal

It's a mechanical engineering project proposal. the program that we using is called "Mat lab". Here are the rules for the project proposal.

  Let''s combine everything together

Let's combine everything together! In this question, you will be asked to combine scaling and translations. Write a function named "problem5" that accepts a single input and scales the image by 0.5 and shifts it up by 7 units. The input variable h..

  Compute the power spectral density vector

Compute the power spectral density vector. Plot the spectrogram using the same parameters as in lecture.

  Develop matlab function for the fixed-point method

Develop your own Matlab function for the Fixed-point method. Use the estimated relative error as your stopping criterion. The first line of your function should be function

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