floating point hardware and algorithms

9
CH.3 Floating Point Hardware and Algorithms 08/24/22 1

Upload: akiko

Post on 05-Jan-2016

35 views

Category:

Documents


1 download

DESCRIPTION

Floating Point Hardware and Algorithms. Ch.3. Review. 4-bit multiplier using 4-bit adder 32-bit multiplier using 32 bit adder + 32 multiplicand, 32-bit multiplier, 64-bit product, and a control unit  this is a sequential multiplier Improve performance. How? - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Floating Point Hardware and Algorithms

CH.3

Floating Point Hardware and Algorithms

04/20/23

1

Page 2: Floating Point Hardware and Algorithms

Review

4-bit multiplier using 4-bit adder32-bit multiplier using 32 bit adder + 32

multiplicand, 32-bit multiplier, 64-bit product, and a control unit this is a sequential multiplier

Improve performance. How? What is performance? Define performance. Speed, flops,

power consumption, etc. Improve performance through hardware optimization;

Example multiplier Improve performance through better algorithms

Example: multiplier Improve performance through better data representation.

04/20/23

2

Page 3: Floating Point Hardware and Algorithms

Floating point numbers

04/20/23

3

Why do we need them?To represent very large number and very small

number.To represent a larger range of number with a given

size in bits.Lets consider a 4 bit containerLets consider a 8 bit containerNow lets look at some data sizes,

An astronautical unit (Au)is the distance between the earth and the sun in meters.

150,000,000,000 meters Size of Helium atom: 1 angstrom: 10-10 meters

See more details on units of measurement here

Page 4: Floating Point Hardware and Algorithms

FP Representation

04/20/23

4

S Exponent Fraction

Value = (-1)S X F X 2 E

32 bit single precision64 bit double precisionOn to IEEE 754 format

Page 5: Floating Point Hardware and Algorithms

Nothing is simple (IEEE 754 not yet)

Consider the representation of real number.Eg.: -56.731 or -0.4539Lets see how we can go from this human

readable form to IEEE 754 Goals: you want to represent as large a range as

possible You want to include features that will optimize

processing

Exponent, fraction, sign of exponent, sign of fraction -56.731 or -0.4539 -0.56731 X 102 -0.4539 X 100

04/20/23

5

0 2 1 56731

Page 6: Floating Point Hardware and Algorithms

Binary Representation

Now lets look at binary representationEg. 0.00001010 X 23 -0.0000000 X 2-4 How will you add these numbers?How will you multiply these?When you answer these questions, you find that it

will help to have the numbers in (i) fractional form, (ii) normalized, and (iii) exponents mapped to a positive range by adding a bias.

Also it is possible to represent a larger range by implying the leading 1 in the normalized fraction and a single zero.

04/20/23

6

Page 7: Floating Point Hardware and Algorithms

IEE754 Format

A floating point number will be represented by a normalized fraction with implied leading 1, biased exponent mapped onto a positive range (no sign needed) and only sign bit is for the entire number.

In other words:Fp = (S, normalized fraction, biased E) is

equivalent(-1)S X (1 + fraction) X 2 (E-bias) Lets look at some examples.

04/20/23

7

Page 8: Floating Point Hardware and Algorithms

Floating Point Operation: Addition

Now lets look at floating point arithmetic unit. We will examine only addition.

04/20/23

8

Page 9: Floating Point Hardware and Algorithms

FP Addition and Multiplication

04/20/23

9

Components: operands, ALU, control, comparison, shifters, normalize, round

ControlALUs