20085eeM116C_1_Quiz1~solutions

20085eeM116C_1_Quiz1~solutions - EE116C Quiz 1 10/14/08 One...

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

View Full Document Right Arrow Icon
EE116C Quiz 1 10/14/08 One sheet of paper (double sided, handwritten) allowed. Calculators allowed. Also MIPS reference sheet (detachable from front of your book) is also allowed. Allotted time: 1 hour Total points: 50 Q1 . Can a C integer float? 10 points (a) Can all int in C (for the MIPS Instruction Set) be converted to a single precision floating point number and back to integer without changing the value of the integer? Why or why not? Answer: No. Since int in C has 32 bits, while a single precision floating point number just has 24 bits to store the significand. When the bit number of the significand of an int in C is less than or equal to 24, the value of the integer won’t be changed; otherwise, the extra bits will be rounded. (b) Can an int in C (for the MIPS Instruction Set) be converted to a double precision floating point number and back to integer without changing the value of the integer? Why or why not? Answer: Yes. Since a double precision floating point number has 53 bits to store the significand.
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.

This note was uploaded on 04/12/2010 for the course EE M116C taught by Professor Puneetgupta during the Fall '08 term at UCLA.

Page1 / 2

20085eeM116C_1_Quiz1~solutions - EE116C Quiz 1 10/14/08 One...

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