Quiz 7 will be on computer arithmetic. Be able to: -- Convert numbers from decimal (base 10) to binary (base 2), and convert numbers from binary to decimal. Examples: Convert 42.625 to binary. Convert 11.101001 (base 2) to decimal -- Represent a negative integer in 2's complement. Example: Give the 6-bit 2's complement representation for -13. -- Add two binary integers. Example: Convert 12 and -6 to 6-bit 2's complement representation and add them. -- Given a fixed point system, determine the integers that can be represented. Example: In a 6-bit 2's complement computer, what integers can be represented? -- Explain how the IA32 flags ZF, SF, OF, CF can be set based on the fixed point representation of the result of a computation. Example: What condition sets the ZF? How is overflow detected? (This changed from "two's-complement" to "sign-magnitude" 12/09/13 -- Give the (sign-magnitude) mantissa and the biased or unbiased exponent for a given number. (I will remind you of d, m, M, and the bias.) Example: What is the IEEE single precision representation for 12.0625? What is the IEEE single precision representation for -12.0625? -- Add two floating point numbers. Example: What is the result of adding the floating point numbers with mantissa +1.010, unbiased exponent 4 mantissa +1.011, unbiased exponent 2 -- Given a floating point system, determine the largest and smallest positive numbers that can be stored, and machine epsilon (which is not the same as the smallest). Example: If d=7, m = -30, M = 31, what are the largest and smallest positive numbers that have an exact representation, and what is machine epsilon? -- Explain what a guard digit is and why it is needed. -- Give the floating point representation for 0, Inf, -Inf, and NaN for a given floating point system. Example: If d=7, m = -30, M = 31, represent 0, Inf, -Inf, and NaN. -- Use your knowledge of floating point to predict computational results. Example: Consider this Matlab code. x = 1; delta = 1 / 2^(53); for j1=1:2^(20), x = x + delta; end What is the final value of x, knowing that Matlab uses double precision? --------------------------------------------------------------------- For more sample questions, see the quizzes numbered "Quiz 1" at http://www.cs.umd.edu/users/oleary/c660quizzes/index.html They contain questions on error analysis (which you can ignore) and machine arithmetic.