SlideServe
Menu
Préférences
© SlideServe · v2026

Floating-Point Representation in Binary

gschaeffer avatar
21 diapositives · 411 Views · Dec 20, 2019

Learn how to store fractions in binary using floating-point representation, including translating to binary, bias notation, addition, multiplication, & advantages/disadvantages.

Floating-Point Representation in Binary - slide 1
01 / 21Floating-Point Representation in Binary
1 / 17

Télécharger la présentation

Floating-Point Representation in Binary
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Floating-Point Representation • We can store integers and characters easily in binary, but what about fractions? • ¼ = .25 = 2.5 * 10-1 • 9.1093897 * 10-31 – me-- mass of an electron • 1.6021733 * 10-19 – e – charge of an electron • 6.6260755 * 10-34 – h – plank’s constant • What are the components of the above #’s?

  2. Moving to Binary • 9.1093897 * 10-31 – me-- mass of an electron • What would the equivalent be in binary? • ___________

  3. Interpreting Floating-point • 9.471 = 9 + 4*.1 + 7*.01 + 1*.001 • The ith bit to the right of the decimal point of a decimal number represents______ • The ith bit to the right of the decimal point of a binary number represents _______

  4. Translating to Binary • Translate left of decimal normally • Translate the right of the decimal • bit-by-bit *or* • Express as fraction, x/ 2y, and place x in y bits, filling to the left with 0’s. • Multiply by 2y to move decimal to proper position.

  5. Example 1 – Translate the 7.75 = -1/4 = ¼ =

  6. following numbers into binary fp

  7. Bias Notation • Problem: Negative exponents have larger value than positive exponents • Solution: • Adjust exponent range • add ____ to all exponents

  8. 7.75 -1/4 1/4 No Bias 7.75 -1/4 1/4 Bias

  9. Floating-Point Addition • How do we do decimal floating-point? • Is it the same as integer addition? • 7.5 + 3/8

  10. Steps to floating-point addition • Right-shift _________ of smaller exponent until exponents match • Add the __________ • ______ to adjust decimal point • Round the result to fit into the significand

  11. Example 1: 7.5 + ¾1.111two * 22 + 1.1two * 2-1

  12. Example 2: 1.1two * 2-96 + 1.0two * 22

  13. Associative property • (a + b) + c < == > a + (b + c)

  14. a + (b + c) • 1.1two * 2-96 + 1.0two * 22 +-1.0two * 22

  15. (a + b) + c • (1.1two * 2-96 + 1.0two * 22 )+ -1.0two * 22

  16. Multiplication • 1.111two * 22 * 1.1two * 2-2

  17. Multiplication • ________ exponents • ________ significands • ________ decimal point • ________ answer • determine the _______

  18. What about bias notation? • 1.111two * 2129 * 1.1two * 2-125

  19. Thought question • Some computers have separate fp and integer register files • Most instructions access only int or fp, not both. • How is this different from doubling the size of the register file? • What are the advantages? Disadvantages?

  20. Thought question

  21. Summary • Floating-point greatly increases range of numbers stored in machine. • Floating-point representation has limited precision – can not store every number in range. • FP arithmetic sometimes rounds answers, violating algebraic properties. • FP arithmetic is much slower than integer arithmetic.