Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(a) A computer uses 1 0 bits to store integers with 1 bit for a sign. It stores

ID: 3561686 • Letter: #

Question

(a) A computer uses 1 0 bits to store integers with 1 bit for a sign. It stores an approximation of real numbers in 10 bits . The first bit o f the first five is the sign of the mantissa and the other four bits are the mantissa. The first bit of the second five is the sign of the exponent and the other four the exponent. (Show your step - by - step work in calculating the ranges) What is the range of integers? What is the range of real numbers (float type)?

Need an answer and how you got it. Thanks

Explanation / Answer

Integer numbers are represented as either words or pairs of words, depending on your processor's word size. One 64-bit machine word is the most common integer representation.

Integer arithmetic is close to but not actually mathematical base-two. The low-order bit is 1, next 2, then 4 and so forth as in pure binary. But signed numbers are represented in twos-complement notation. The highest-order bit is a sign bit which makes the quantity negative, and every negative number can be obtained from the corresponding positive value by inverting all the bits and adding one. This is why integers on a 64-bit machine have the range -263 to 263 - 1. That 64th bit is being used for sign; 0 means a positive number or zero, 1 a negative number.

Some computer languages give you access to unsigned arithmetic which is straight base 2 with zero and positive numbers only.

Most processors and some languages can do operations in floating-point numbers (this capability is built into all recent processor chips). Floating-point numbers give you a much wider range of values than integers and let you express fractions. The ways in which this is done vary and are rather too complicated to discuss in detail here, but the general idea is much like so-called