exam1-f05-sol

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

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

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/28/2008 for the course CS 15-213 taught by Professor Fr during the Spring '07 term at Carnegie Mellon.

### Page1 / 3

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

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

View Full Document
Ask a homework question - tutors are online