0% found this document useful (0 votes)
12 views2 pages

Converting Decimal to Floating Point

Uploaded by

Isabella
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Converting Decimal to Floating Point

Uploaded by

Isabella
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

The University of the West Indies

Department of Computing and Information Technology


COMP 1600 – Introduction to Computing Concepts
Tutorial 3: Floating Point Binary

In this tutorial, we explore both 3-bit biased notation and 4-bit biased notation. In both systems, exponents are stored using a bias,
which ensures that both positive and negative exponents can be represented with only positive binary values.

1) If an 8-bit floating point representation uses 4 bits for the exponent and 3 bits for the mantissa, what is the largest possible
exponent value?

__________________________________________

2) Convert -3.75 into an 8-bit floating point number (Use 3 bits for the exponent, 4 bits for the mantissa).

__________________________________________

3) Convert the decimal value 12.5 into a 9-bit floating point number (Use 4 bits for the exponent, 4 bits for the mantissa).

__________________________________________

4) Convert the 8-bit floating point number 11010110 into its decimal equivalent (Use 3 bits for the exponent, 4 bits for the
mantissa).

__________________________________________

5) Convert the 9-bit floating point number 010110100 into its decimal equivalent (Use 4 bits for the exponent, 4 bits for the
mantissa).

__________________________________________

6) Convert 8.125 into an 8-bit floating point number (Use 3 bits for the exponent, 4 bits for the mantissa).

__________________________________________

7) Convert the decimal value -12.375 into a 9-bit floating point number (Use 3 bits for the exponent, 5 bits for the mantissa).

__________________________________________

8) Convert the decimal value 9.625 into an 8-bit floating point number (Use 4 bits for the exponent, 3 bits for the mantissa).

__________________________________________

Common questions

Powered by AI

The largest possible exponent value is calculated by setting all bits of the 4-bit exponent to 1, which is 1111 in binary. This converts to 15 in decimal. When considering a bias of 8 (midpoint of the 4-bit range 0 to 15), the maximum actual exponent value is 7 (15-8).

A floating point system with only 3 bits for the mantissa severely limits precision, often leading to significant rounding errors and inaccurate representation of fractional values. With only 4 bits for the exponent, the range of representable numbers is limited, reducing the system's ability to accurately represent both very small and very large numbers. These limitations can lead to underflow or overflow in computational operations .

The number 11010110 consists of a sign bit (1 for negative), a 3-bit exponent (101), and a 4-bit mantissa (0110). With a bias of 4, the exponent 101 (5 in decimal) corresponds to an actual exponent of 1. The normalized binary mantissa 1.011 corresponds to 1.375 in decimal. Hence, the decimal value is -1.375 × 2^1, which equals -2.75 .

Increasing the number of bits for the exponent extends the range of representable values, allowing the system to express both larger and smaller numbers, enhancing its utility for extreme values. More bits for the mantissa improve precision, permitting more accurate representation of fractional components. However, increasing bits for one can necessitate reducing bits for the other when total bit length is fixed, impacting performance based on the application's needs .

Converting -12.375 involves several steps. First, convert -12.375 to binary: -1100.011. Normalize to -1.100011 x 2^3. With 3 bits for the exponent and a bias of 4, store the biased exponent as 7 (3+4). Then, round the 6-bit mantissa 100011 to the nearest 5-bit mantissa 10001. Challenges include dealing with sign representation, managing limited bits for the exponent and mantissa which can cause rounding errors, and ensuring normalization for consistent storage .

Normalization ensures that the floating point representation maintains a consistent format, typically with a leading 1 in the binary representation of the mantissa (for non-zero values). This maximizes the precision available from the bits allocated to the mantissa. Without normalization, multiple representations could exist for the same numerical value, complicating comparisons and arithmetic operations .

Using a bias in floating point representation involves adding a specific offset, known as the bias, to the actual exponent value. This process shifts the range of representable exponents so that all are non-negative. For instance, if the bias is 7, an actual exponent value of -3 would be stored as 4, allowing the use of unsigned binary to represent it .

To convert 12.5: 12.5 in binary is 1100.1. Normalizing gives 1.1001 x 2^3. With a bias of 8 (midpoint of 4-bit range 0-15), the stored exponent is 11 (3+8). The mantissa is rounded to four bits as 1001. Hence, the 9-bit floating point representation is 01111001 .

To convert 8.125: 8.125 in binary is 1000.001. Normalizing gives 1.000001 x 2^3. With a bias of 4 (because we use 3 bits for the exponent), the stored exponent is 7 (3+4). The mantissa is 0001 after normalization and rounding to 4 bits. Therefore, the floating point representation is 01010001 .

The mantissa, or significand, represents the precision of a floating point number. Its bit allocation directly impacts the precision because more bits allow for more significant digits to be stored. This leads to higher accuracy in representing the fractional part of numbers. Limited mantissa bits can result in rounding errors and less precise representation, especially for very small or large numbers .

You might also like