Homework 3 Solution

Homework 3 Solution - Lecture 3 MEEN 357 Homework Solution...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 3 MEEN 357 Homework Solution 1 Lecture-03-Homework-Solution-2009.doc RMB 1. Convert the following 64 bit number to a real number: 1 10010001111 1100001101010000000010000000000000000000000000000000 S Exp M = = = Solution: There are a lot of different ways to do the arithmetic, including by hand. Below is script for an mfile that will make MATLAB do the calculation. %calculates number from 64 bit IEEE binary number. Not %fancy. ...Uses %notation in 357 notes. clc clear all format long S=1 %Calculation of E %You are given Exp=[1 0 0 1 0 0 0 1 1 1 1] %Next build the formula (3.41)for E K=10:-1:0; N=2.^(K); E=N*Exp' %Next build the formula (3.45) for f %Build a matrix for all of the given and leading zeros in M Q=zeros(1,31) %Concatenate Q with the other given entries in M M=[1,1,0,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,1,Q] K=1:52; L=1./(2.^(K)); f=M*L'; %calculation of v from the table on page 17 of the notes %for Lecture 3 format long e v=(-1)^S*(1+f)*2^(E-1023) %While not necessary, you can display your results as
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Homework 3 Solution - Lecture 3 MEEN 357 Homework Solution...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online