Quiz%2B2%2B-%2BAnswers - b) Multiply the binary numbers...

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

View Full Document Right Arrow Icon
PSC B57 Quiz 2 – Answers 1. Create a function M-file for the function: f(x) =9x 2 +3x-14 function y=f(x) y=9x^2+3x-14; f(18) >>2956 2. If A=[ 1 4 9 3 0], add up the values of the elements (using loops). Then, check  your answer. HINT: Use the ‘for loop.’ Total=0 For j=1:length(A) Total=total+A(j); end sum(A) 3. Save variables from the workspace in a binary MAT file named ‘Blueberry.’  Next, clear the workspace and load the file. save Blueberry.mat clear   load Blueberry.mat 4. a) What is the decimal representation for:   101110110 374
Background image of page 1

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

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

Unformatted text preview: b) Multiply the binary numbers 1100 and 1010 1111000 c) Add the binary numbers 111010 and 010100 1001110 5. What is floating point representation? Floating point representation is used for numbers that require decimal representation (real numbers) 6. For single precision, how many bits are used for: i) The sign? 1 bit ii) The exponent? 8 bits iii) The mantissa? 23 bits 7. For double precision, how many bits are used for: iv) The sign? 1 bit v) The exponent? 11 bits vi) The mantissa? 52 bits...
View Full Document

This note was uploaded on 03/26/2011 for the course PSC B57 taught by Professor Kis during the Spring '08 term at University of Toronto- Toronto.

Page1 / 2

Quiz%2B2%2B-%2BAnswers - b) Multiply the binary numbers...

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