23.08.2015 Views

EECS 370 – Introduction to Computer Organization – Exam 1 w

EECS 370 – Introduction to Computer Organization – Exam 1 w

EECS 370 – Introduction to Computer Organization – Exam 1 w

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6. Floating Point [12 pts]You are working for a company developing a high quality graphics processor. This processorwill distinguish itself from competi<strong>to</strong>rs by supporting accurate graphics over an extremely widecontrast range. This is done by using floating point numbers, rather than integers, <strong>to</strong> representthered/green/blue pixel intensity values. To allow a complete (R, G, B) triplet <strong>to</strong> fit in<strong>to</strong> a 64 bitword, 21 bits are used for each value. As 21 bits are not sufficient for standard IEEE singleprecision floating point, an unusual floating point representation is designed with smaller fields.Everything works exactly as in the standard IEEE floating point except:• The exponent uses only 7 bits, with bias 63• The mantissa (significand) uses only 13 bitsa) [6 points] How would a value of -0.265625 decimal be represented in this format? Show all21 bits in the boxes provided and clearly label which bits make up each of the sign,exponent, and mantissa. (Hint: 0.265625 is exactly equal <strong>to</strong> the fraction 17/64). Show yourwork <strong>to</strong> receive credit for your answer.Negative, so sign bit is one, 17/64 = (17/16) * 2 -2Exponent is -2, bias 63 makes exponent field 61 decimal, 0111101 binary17 decimal is 10001 binary, suppress leading one so mantissa field gets 0001Answer in binary:1 0 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0S E E E E E E E M M M M M M M M M M M M Mb) [6 points] The number from part (a) is added <strong>to</strong> the floating point value represented by thebits shown below. Show the final result of the addition in this floating point format in theboxes provided. Show your work <strong>to</strong> receive credit for your answer.001111001100000000000Working in binary, we have:1.11 * 2 -3 [shown above] -1.0001 * 2 -2 [from part a]Exponents differ by 1, so shift smaller operand right 1 bit: 1.11 * 2 -3 becomes 0.111 * 2 -2Add 0.111 * 2 -2 <strong>to</strong> -1.0001 * 2 -2 , sum is -0.0011 * 2 -2Too small, must shift 3 bits <strong>to</strong> renormalize, normalized sum is -1.1 * 2 -5Answer in binary:1 0 1 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0S E E E E E E E M M M M M M M M M M M M MPage 6 of 12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!