The exponent and significant/ mantissa are stored as bits. but not so much when the magnitude is large, we could use floating point.Ĭonsider the number 7241.0381 again. If we care about the precision when the magnitude is small. This is a fundamental disadvantage of fixed-point numbers. Note that we are losing precision when we performed the shift. Then we need to fix the output back to the fixed radix by shifting the bits right by 2. Since the two multiplicand have two decimal places, we need to put 4 bits for the output of the fractional part: 10101.0010. But we need to shift the radix point and shift accordingly. To multiply, we treat bits as integers and perform multiplication. Subtraction is the same thing except negative. Reg position, velocity position <= position + velocity With a length long enough for the integer and fractional parts: We can have more precision by moving the radix point to give more bits to the decimals, but the trade off is we lose the maximum range.
The fixed point representation has a predetermined location for the decimal, it is known as the radix point.įor a 8 bit register where the radix point is placed in the center, the precision is 0.0625 and the number can range between 0 and 15.9375. The fractional is a sum of the fractional part (with negative exponents).ġ001.0110 is 1B3 + 0B2 + 0B1 + 1B0 + 0B-1 + 1B-1 + 1B-2 + 0B-3, where BN denotes \(\times 2^N\). The whole section represents the integer part of the number before the decimal number. The bits are divided into two sections: whole and fractional. In Lab 3, we will be dealing with non integer values. There are two ways to represent fractional numbers, fixed-point and floating-point representations.