This preview shows pages 1–5. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Andrew login ID: Full Name: CS 15213, Spring 2003 Exam 1 February 27, 2003 Instructions: Make sure that your exam is not missing any sheets, then write your full name and Andrew login ID on the front. Write your answers in the space provided below the problem. If you make a mess, clearly indicate your final answer. The exam has a maximum score of 60 points. The problems are of varying difficulty. The point value of each problem is indicated. Pile up the easy points quickly and then come back to the harder problems. This exam is OPEN BOOK. You may use any books or notes you like. No electronic devices are allowed. Good luck! 1 (1): 2 (9): 3 (8): 4 (4): 5 (8): 6 (12): 7 (10): 8 (8): TOTAL (60): Page 1 of 11 Problem 1. (1 points): The correct answer to this problem is worth 1 point. An incorrect answer is worth 2 points. No answer will be scored as 0 points. Note: The answer to this question was given in lecture. The correct answer to this problem is: Page 2 of 11 Problem 2. (9 points): Assume we are running code on an 8bit machine using twos complement arithmetic for signed integers. Short integers are encoded using 4 bits. Sign extension is performed whenever a short is casted to an int. For this problem, assume that all shift operations are arithmetic. Fill in the empty boxes in the table below. int i = 11; unsigned ui = i; short s = 2; unsigned short us = s; Note: You need not fill in entries marked with . TMax denotes the largest positive twos complement number and TMin denotes the minimum negative twos complement number. Finally, you may use hexidec imal notation for your answers in the Binary Representation column. Expression Decimal Representation Binary Representation Zero  3 i i >> 4 ui (int) s (int)(s 7) (int) us TMax TMin Page 3 of 11 Problem 3. (8 points): Consider the following 7bit floating point representation based on the IEEE floating point format: There is a sign bit in the most significant bit....
View
Full
Document
 Fall '11
 N/A
 Economics

Click to edit the document details