+ All Categories
Home > Documents > 04.FloatingPointNumbers.ppt

04.FloatingPointNumbers.ppt

Date post: 06-Jul-2018
Category:
Upload: sangeetha-sangu-bc
View: 212 times
Download: 0 times
Share this document with a friend

of 21

Transcript
  • 8/17/2019 04.FloatingPointNumbers.ppt

    1/21

    ITEC 1011 Introduction to Information Technologies

    4. Floating Point Numbers

    Chapt. 5

  • 8/17/2019 04.FloatingPointNumbers.ppt

    2/21

    ITEC 1011 Introduction to Information Technologies

    Exponential Notation

    The representations differ

    in that the decimal place –

    the “point !! “floats to

    the left or right "#ith the

    appropriate ad$ustment in

    the exponent%.

     p. &''

    ( The follo#ing are e)ui*alentrepresentations of &+',4

    123,400.0 x 10-2

     12,340.0 x 10-1

      1,234.0 x 100

      123.4 x 101

      12.34 x 102

      1.234 x 103

      0.1234 x 104

  • 8/17/2019 04.FloatingPointNumbers.ppt

    3/21

    ITEC 1011 Introduction to Information Technologies

    Parts of a Floating Point Number 

    -0.9876 x 10-3

     p. &',

    -ign of 

    mantissa

    ocation of 

    decimal point/antissa

    Exponent

    -ign of 

    exponent

    0ase

  • 8/17/2019 04.FloatingPointNumbers.ppt

    4/21

    ITEC 1011 Introduction to Information Technologies

    1EEE 254 -tandard

    ( /ost common standard for representing floating point numbers

    ( -ingle precision3 ,' bits+ consisting of...( -ign bit "& bit%

    ( Exponent " bits%( /antissa "', bits%

    ( ouble precision3 64 bits+ consisting of7( -ign bit "& bit%

    ( Exponent "&& bits%( /antissa "5' bits%

     p. &,,

  • 8/17/2019 04.FloatingPointNumbers.ppt

    5/21

    ITEC 1011 Introduction to Information Technologies

    -ingle Precision Format

    ,' bits

    /antissa "', bits%

    Exponent " bits%

    -ign of mantissa "& bit%

  • 8/17/2019 04.FloatingPointNumbers.ppt

    6/21

    ITEC 1011 Introduction to Information Technologies

     Normali8ation

    ( The mantissa is normalized ( 9as an implied decimal place on left

    ( 9as an implied “& on left of the decimal

     place

    ( E.g.+

    ( /antissa→

    ( :epresents7

      10100000000000000000000

    1.1012 = 1.625

    10

  • 8/17/2019 04.FloatingPointNumbers.ppt

    7/21

    ITEC 1011 Introduction to Information Technologies

    Excess Notation

    ( To include ;*e and –*e exponents+ “excessnotation is used

    ( -ingle precision3 excess &'2

    ( ouble precision3 excess &

  • 8/17/2019 04.FloatingPointNumbers.ppt

    8/21

    ITEC 1011 Introduction to Information Technologies

    Example

    ( -ingle precision

    0 10000010 11000000000000000000000

    &.&&'

    &,< – &'2 = ,

    < = positi*e mantissa

    ;&.&&' x ', = &&&

  • 8/17/2019 04.FloatingPointNumbers.ppt

    9/21

    ITEC 1011 Introduction to Information Technologies

    9exadecimal

    ( 1t is con*enient and common to representthe original floating point number in

    hexadecimal

    ( The preceding example7

    0 10000010 11000000000000000000000

    4 1 6 0 0 0 0 0

  • 8/17/2019 04.FloatingPointNumbers.ppt

    10/21

    ITEC 1011 Introduction to Information Technologies

    Con*erting from Floating Point

    ( E.g.+ >hat decimal *alue is represented b?the follo#ing ,'!bit floating point number@

    C17B000016

  • 8/17/2019 04.FloatingPointNumbers.ppt

    11/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep &( Express in binar? and find -+ E+ and /

    C17B000016=

    1 10000010 111101100000000000000002

    - E /

    & = negati*e

    < = positi*e

  • 8/17/2019 04.FloatingPointNumbers.ppt

    12/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep '( Find “real exponent+ n

    (   n = E – &'2

    = &

  • 8/17/2019 04.FloatingPointNumbers.ppt

    13/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep ,( Put -+ /+ and n together to form binar? result

    ( "onAt forget the implied “&. on the left of the

    mantissa.%

    -1.11110112x 2n =

     

    -1.11110112x 23 = 

    -1111.10112

  • 8/17/2019 04.FloatingPointNumbers.ppt

    14/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep 4( Express result in decimal

    -1111.10112

    !&5 '!& =

  • 8/17/2019 04.FloatingPointNumbers.ppt

    15/21

    ITEC 1011 Introduction to Information Technologies

    Con*erting to Floating Point

    ( E.g.+ Express ,6.56'5&

  • 8/17/2019 04.FloatingPointNumbers.ppt

    16/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep &( Express original *alue in binar?

    36.562510 =

    100100.10012

  • 8/17/2019 04.FloatingPointNumbers.ppt

    17/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep '(  Normali8e

    100100.10012=

    1.0010010012 x 25

  • 8/17/2019 04.FloatingPointNumbers.ppt

    18/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep ,( etermine -+ E+ and /

    +1.0010010012 x 25

    - = < "because the *alue is positi*e%

    /-   n E = n ; &'2

    = 5 ; &'2

    = &,'

    = 100001002

  • 8/17/2019 04.FloatingPointNumbers.ppt

    19/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep 4( Put -+ E+ and / together to form ,'!bit binar?

    result

    0 10000100 001001001000000000000002

    - E /

  • 8/17/2019 04.FloatingPointNumbers.ppt

    20/21

    ITEC 1011 Introduction to Information Technologies

    ( -tep 5( Express in hexadecimal

    0 10000100 001001001000000000000002 =

    0100 0010 0001 0010 0100 0000 0000 00002 =

      4 2 1 2 4 0 0 016

    Bns#er3 4'&'4

  • 8/17/2019 04.FloatingPointNumbers.ppt

    21/21

    ITEC 1011 Introduction to Information Technologies

    Than ?ou


Recommended