Docsity

Digital Logic and Floating-Point Representation, Slides of Introduction to Database Management Systems

Partial preview of the text

Download Digital Logic and Floating-Point Representation and more Slides Introduction to Database Management Systems in PDF only on Docsity!

1

NxN Crossbar design for Barrel Shifter

Tri- state buffer

Decoder selects the shift amount …

Decoder

x

x

x

y0 y1 y

Shift

count

X-input Y-output

…

2

Logarithmic Barrel Shifter

Shift Count

Input

Word

Output Word

Bypass/Shift 1 bit right Bypass/Shift 2 bit right Bypass/Shift 4 bit right Bypass/Shift 8 bit right Bypass/Shift 16 bit right

A shift/bypass cell

Number of gates: O(NlogN) Delay: O(logN)

4

Floating-point representation

Floating-point numbers have two parts

  • The Significand
  • The Exponent

e.g. consider the number

-5.7x10 -

Sign is negative

The Significand or Mantissa

Base is 10; fixed for a given representation

The Exponent

5

Floating-Point Representation

A common layout for floating-point number is

s e^ f

sign exponent fraction

M bits

m (^) e m^ f

The Bias or excess representation

  • Value(s,e,f) = (-1) s^ x f x 2 e

7

IEEE 32 bit single precision format

s (^) e ^^ f 1 f 2 …f 23

sign exponent^ fraction

Fraction bits of significand including the hidden bit

Positive values between 0 to 255 with bias=

The IEEE standard floating point numbers can be either

nomalized or denormalized. The denormalized number

does not have a hidden bit Docsity.com

8

Types and values represented by

IEEE Single-precision format

E^ e VALUE TYPE

255 none (^) none NaN

s (^) x(1.f 1 .f 2 …)x

127

Normalized

s (^) x(1.f 1 .f 2 …)x

Normalized

s (^) x(1.f 1 .f 2 …)x

Normalized

s (^) x(1.f 1 .f 2 …)x

Denormalized

10

Floating point Addition and Subtraction

The steps taken in floating point

addition or subtraction are

1. Unpacking of sign, exponent and

fraction fields

2. Alignment of significant

3. Addition or subtraction operation

4. Adjusting for carry

5. Rounding off the result

6. Overflow checking and packing

11

Floating Point Addition

Binary :

0.5 10 = 1/2 10 = 0.1 2 = 1.000 x 2 -

-0.4375 10 = -7/16 10 = -7/2 4 = -0.0111 2 = - 1.110 x 2 -

Align: -1.110 x 2 -2^ → -0.111 x 2 -

Addition: 1.000 x 2-1 + (^ -0.111 x 2 -1) =^ 0.001 x 2 -

Normalization of Sum:

0.001 2 X 2 -1^ = 0.010 2 x 2 -

= 1.000 2 x 2 -

13

Floating Point

Multiplication and Division

The floating point multiply procedure is as follows

Unpack sign, exponent and significands

Apply xor operation to signs, add exponents, Multiply significands

Normalize, round And shift

Adjust for overflow

Pack the result and report exceptions

14

Floating Point

Multiplication and Division

The floating point divide procedure is as follows

Unpack sign, exponent and significands

Apply xor operation to signs, subtract exponents, divide significands

Normalize, round And shift

Adjust for overflow

Pack the result and report exceptions