FAMUFSU College of Engineering EEL 3705 3705 L

  • Slides: 8
Download presentation
FAMU-FSU College of Engineering EEL 3705 / 3705 L Digital Logic Design Fall 2006

FAMU-FSU College of Engineering EEL 3705 / 3705 L Digital Logic Design Fall 2006 Instructor: Dr. Michael Frank Lecture Module #5: Radix Number Systems & Arithmetic 12/15/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 1

FAMU-FSU College of Engineering Binary Fractions Fixed-Point and Floating-Point Binary Fractional Numbers 12/15/2021 M.

FAMU-FSU College of Engineering Binary Fractions Fixed-Point and Floating-Point Binary Fractional Numbers 12/15/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 2

FAMU-FSU College of Engineering Radix Fractions o In decimal, we write digits after the

FAMU-FSU College of Engineering Radix Fractions o In decimal, we write digits after the decimal point to denote coefficients of negative powers of 10. n Example: 3. 14159 means: o o 3× 100 + 1× 10− 1 + 4× 10− 2 + 1× 10− 3 + 5× 10− 4 + 9× 10− 5 By the same token, in any base b, digits after the “radix point” denote coefficients of negative powers of b. n General form: dk− 1 dk− 2…d 2 d 1 d 0. d− 1 d− 2 d− 3…d−j+1 d−j k digits before the radix point 12/15/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 j digits after the radix point 3

FAMU-FSU College of Engineering Fixed-Point Binary Fractions o In a fixed-width, fixed-point binary representation

FAMU-FSU College of Engineering Fixed-Point Binary Fractions o In a fixed-width, fixed-point binary representation of a fractional number, the “binary point” is always implicitly at some predefined location (independent of the data) n E. g. , suppose it is defined to be in between the first 5 and last 3 bits of an 8 -bit word… o n 4 3 2 1 0 − 1 − 2 − 3 The value of the bit pattern shown is then: o 12/15/2021 Then k=5, j=3… 01011101 8 + 2 + 1 + ½ + 1/8 = 11. 62510 M. Frank, EEL 3705 Digital Logic, Fall 2006 4

FAMU-FSU College of Engineering Fixed-Point Binary Arithmetic o Analogous to arithmetic with ordinary decimal

FAMU-FSU College of Engineering Fixed-Point Binary Arithmetic o Analogous to arithmetic with ordinary decimal fractions. n Just like binary integer arithmetic, except that you must align the binary points, and ensure that the radix point of the result is positioned as expected, and round as needed. o 12/15/2021 Example: In k=2, j=2 fixed point, multiply 10. 112 × 1. 012. M. Frank, EEL 3705 Digital Logic, Fall 2006 1011 × 0101 1011 0000 1011 110111 round to: 11. 102 = 3. 510 Decimal equivalent: 2. 75 × 1. 25 3. 4375 round to nearest 0. 25 3. 5 5

FAMU-FSU College of Engineering Fixed-Point Two’s Complement o Can represent signed fractional numbers using

FAMU-FSU College of Engineering Fixed-Point Two’s Complement o Can represent signed fractional numbers using fixed-point two’s complement representation. n o Just as with integers, the bit in the most significant position (position k− 1) represents the coefficient of the highest power of two, 2 k− 1, except that its value is negative. Arithmetic procedures and overflow conditions are essentially the same as with integer two’s complement. 12/15/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 6

FAMU-FSU College of Engineering Floating-Point Numbers o Similar to scientific notation, but not based

FAMU-FSU College of Engineering Floating-Point Numbers o Similar to scientific notation, but not based on the radix 10… n o Advantages include: n o Precisely handles a wider range of numeric magnitudes. General mathematical form: ±N = ±M × r. E n n n o The radix that is standardly used in digital floating-point representations is 2 M, the mantissa, is a fixed-point number, usually normalized to [0, 1). r, the radix, is an implicitly agreed upon constant. E, the exponent, is a signed integer (usu. in biased representation). The fixed point number (dk− 1…d 0. d− 1…d−j)r gets represented in normalized FP as (. dk− 1…d 0 d− 1…d−j)×rk. n n 12/15/2021 Mantissa signs are usually represented in sign-magnitude form The leading 1 of normalized binary mantissas can be left implicit M. Frank, EEL 3705 Digital Logic, Fall 2006 7

FAMU-FSU College of Engineering Simple Floating-Point Example o Represent the number − 3. 2510

FAMU-FSU College of Engineering Simple Floating-Point Example o Represent the number − 3. 2510 as a 10 -bit floating-point binary number composed of a sign bit, a 4 -bit exponent with a bias of 8, and a 5 -bit mantissa with an implicit leading 1. n n − 3. 2510 = − 11. 012 = −. 1101× 22 Mantissa bits: 10100 (leading 1 is implicit) Biased exponent = 2+8 = 10102. Complete representation: 1101002 sign exp 12/15/2021 M. Frank, EEL 3705 Digital Logic, Fall 2006 mantissa 8