exam1-f05-sol - Exam 1 Solutions CS 213 Fall 2005 * Problem...

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

View Full Document Right Arrow Icon
Exam 1 Solutions CS 213 Fall 2005 ********* Problem 1 ********* Expression | Decimal | Binary -----------------------------------| -2 | 111 1110 -| 19 | 001 0011 x | -16 | 111 0000 uy | 112 | 111 0000 x - uy | 0 | 000 0000 C promotes signed x to unsigned TMax+1 | -64 | 100 0000 TMin-1 | 63 | 011 1111 -TMin | -64 | 100 0000 TMin+TMin | 0 | 000 0000 TMax+TMin | -1 | 111 1111 ----------------------------------********* Problem 2 ********* ------------------------------------------------------------------Format A Format B bits Value Bits Value Comment ------------------------------------------------------------------101 1110 15/2 1001 111 15/2 010 1001 25/32 0110 101 13/16 Round Up 110 1111 31/2 1011 000 16 Round Up 000 0001 1/64 0001 000 1/64 Denorm-->Norm ------------------------------------------------------------------********* Problem 3 ********* A 40-byte string results in the low order byte of the return address being overwritten with a '\0' byte, which changes the return address from 0x400f7c
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 / 3

exam1-f05-sol - Exam 1 Solutions CS 213 Fall 2005 * Problem...

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