4.1.7
Floating Points in Binary
Floating Point Representation
Floating Point Representation
Floating point is a method of representing numbers in binary, which makes use of a binary point placed after the ‘most significant bit’ (MSB).
![Illustrative background for Floating point](https://image-v2.cdn.app.senecalearning.com/2018-07/31c77d00-497e-4e13-9319-bd43c2c1c731/Computer-Binary-1-0-Byte-,h_400,q_80,w_640.jpg)
![Illustrative background for Floating point ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-07/31c77d00-497e-4e13-9319-bd43c2c1c731/Computer-Binary-1-0-Byte-,h_400,q_80,w_640.jpg)
Floating point
Floating point
- A floating point binary number is made up of two parts:
- The mantissa is the main number, containing a binary point after the MSB.
- The exponent determines where the binary point is positioned before the number is read.
- If the exponent is negative (i.e. it begins with a ‘1’), the binary point is moved left instead of right.
![Illustrative background for Converting to denary](https://image-v2.cdn.app.senecalearning.com/2019-06/2852a728-a8f9-4d18-8531-8ade4688f9ba/2-step-2,h_400,q_80,w_640.jpg)
![Illustrative background for Converting to denary ?? "content](https://image-v2.cdn.app.senecalearning.com/2019-06/2852a728-a8f9-4d18-8531-8ade4688f9ba/2-step-2,h_400,q_80,w_640.jpg)
Converting to denary
Converting to denary
- After the binary point has been moved, we can read the value of the mantissa.
- The denary value of the binary digit to the right of the binary point corresponds to:
- .
- Each subsequent binary digit corresponds to .. and so on.
![Illustrative background for Example](https://image-v2.cdn.app.senecalearning.com/2020-08/3fcb991d-1743-428e-836f-cdeb8809e31c/Screenshot%202020-08-24%20at%2017.20.47-min,h_400,q_80,w_640.png)
![Illustrative background for Example ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/3fcb991d-1743-428e-836f-cdeb8809e31c/Screenshot%202020-08-24%20at%2017.20.47-min,h_400,q_80,w_640.png)
Example
Example
- The example below is a 12-bit floating point number, with an 8-bit mantissa and a 4-bit exponent:
- 0 . 1 0 1 1 0 0 0 0 0 1 1
- The exponent 0011 (which is equal to 3) identifies where the binary point should move in order to read the number.
![Illustrative background for Example cont.](https://image-v2.cdn.app.senecalearning.com/2020-08/a4ffb7c9-b0b0-4614-b375-217aec1b85fc/Screenshot%202020-08-24%20at%2017.29.10-min,h_400,q_80,w_640.png)
![Illustrative background for Example cont. ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/a4ffb7c9-b0b0-4614-b375-217aec1b85fc/Screenshot%202020-08-24%20at%2017.29.10-min,h_400,q_80,w_640.png)
Example cont.
Example cont.
- In this example, the binary point is moved 3 places to the right, which in turn subtracts 3 from the exponent:
- 0 1 0 1 . 1 0 0 0 0 0 0 0
- This represents the decimal number 5.5.
Normalisation of Floating Points
Normalisation of Floating Points
Floating point binary numbers should be normalised to ensure they are as precise as possible.
![Illustrative background for Normalisation](https://image-v2.cdn.app.senecalearning.com/courseImages/chemistry/10.1.2 Alternative methods of extracting metals/light-bulbs-1125016_640-min,h_400,q_80,w_640.jpg)
![Illustrative background for Normalisation ?? "content](https://image-v2.cdn.app.senecalearning.com/courseImages/chemistry/10.1.2 Alternative methods of extracting metals/light-bulbs-1125016_640-min,h_400,q_80,w_640.jpg)
Normalisation
Normalisation
- The same decimal number can be represented in a number of different ways using floating point, depending on the number of bits available.
- To ensure the mantissa is as precise as possible (normalised), the binary point and exponent should be adjusted so that:
- A positive number has a ‘0’ before the binary point and a ‘1’ after it.
- A negative number has a ‘1’ before the binary point and a ‘0’ after it.
![Illustrative background for Example](https://image-v2.cdn.app.senecalearning.com/2020-08/9f02c388-f6f4-4f5e-a088-a435f23278dc/Screenshot%202020-08-25%20at%2009.35.24-min,h_400,q_80,w_640.png)
![Illustrative background for Example ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/9f02c388-f6f4-4f5e-a088-a435f23278dc/Screenshot%202020-08-25%20at%2009.35.24-min,h_400,q_80,w_640.png)
Example
Example
- The example shown is an un-normalised 12-bit floating point number, with an 8-bit mantissa and a 4-bit exponent:
- 0 . 0 0 1 0 1 1 0 0 1 0 1
- It is un-normalised because the bits either side of the binary point are the same.
- The binary point needs to move two places to the right, ensuring it remains a positive number (the MSB is still a ‘0’), but the bit after the point is a ‘1’.
![Illustrative background for Example cont.](https://image-v2.cdn.app.senecalearning.com/2020-08/17b8e262-f642-4c74-bc14-56b4c7b13cd8/Screenshot%202020-08-25%20at%2009.35.26-min,h_400,q_80,w_640.png)
![Illustrative background for Example cont. ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/17b8e262-f642-4c74-bc14-56b4c7b13cd8/Screenshot%202020-08-25%20at%2009.35.26-min,h_400,q_80,w_640.png)
Example cont.
Example cont.
- Moving the point two places to the right reduces the value of the exponent by two, resulting in:
- 0 . 1 0 1 1 0 0 0 0 0 1 1
- Notice the two excess bits to the left of the MSB in the mantissa have been moved to the end of the mantissa, ensuring it remains 8 bits in size.
![Illustrative background for Negative floating point](https://image-v2.cdn.app.senecalearning.com/2020-08/7dcf8148-cf9f-46d2-ae3e-e5e1b79dfc1e/Screenshot%202020-08-25%20at%2009.44.04-min,h_400,q_80,w_640.png)
![Illustrative background for Negative floating point ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/7dcf8148-cf9f-46d2-ae3e-e5e1b79dfc1e/Screenshot%202020-08-25%20at%2009.44.04-min,h_400,q_80,w_640.png)
Negative floating point
Negative floating point
- Normalising negative floating point binary numbers follows the same procedure, except the point is moved until the MSB is a ‘1’ and the bit following the point is a ‘0’.
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
Jump to other topics
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
![Go student ad image](/en-GB/revision-notes/_next/image?url=%2Fen-GB%2Frevision-notes%2Fimages%2Fgo-student-uk-ad.jpg&w=640&q=100)
Unlock your full potential with GoStudent tutoring
Affordable 1:1 tutoring from the comfort of your home
Tutors are matched to your specific learning needs
30+ school subjects covered