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: 15213 Introduction to Computer SystemsExam 1February 27, 2007Name:Andrew User ID:Recitation Section:•This is an openbook exam. Notes are permitted, but not computers.•Write your answer legibly in the space provided.•You have 80 minutes for this exam.IntegersFloating PointAssembly LanguageCalling ConventionsStructures and AlignmentOutofOrder ExecutionProblemMaxScore110215315410510615Total7511. Integers (10 points)For each of the following propositions, write inallcomparisons that make italwaystrueamong the four possibilities:<>==!=If none are guaranteed to hold, please indicate that explicitly by marking it with anX. Wehave filled in the first two for you as examples. Assume the variables are declared withint x,y;and initialized to some unknown values. You may assume thatint’s are 32 bits wide,char’s are 8 bits wide and that right shift is arithmetical on signed numbers and logicalon unsigned numbers.Ifx > ytheny<!=xIfx < 0thenx+1braceleftBiggXbracerightBiggIfx > 0thenx+1If(x >> 31) < 0thenxIf((x << 31) >> 31) < 0thenx & 1Ifx > ythen(unsigned)xyIf((unsigned char)x >> 1) < 64then(char)x22. Floating Point (15 points)1. (10 pts) Fill in the blank entries in the following table. We assume an IEEE representation of floating point numbers with1sign bit,k= 3bits for the exponent andn= 4bits for the fractional value. This means the bias is23...
View
Full
Document
This note was uploaded on 06/28/2008 for the course CS 15213 taught by Professor Fr during the Spring '07 term at Carnegie Mellon.
 Spring '07
 fr

Click to edit the document details