0% found this document useful (0 votes)
213 views15 pages

Floating Point Arithmetic

Floating point arithmetic involves representing numbers as a mantissa and exponent. Basic operations like addition and multiplication are performed by adding or subtracting exponents and multiplying or dividing mantissas. Challenges include dealing with overflow, underflow, normalization, and edge cases like zero operands. Floating point units perform these operations using separate mantissa and exponent units. Coprocessors can also be used to offload floating point arithmetic, allowing parallel execution but requiring communication with the CPU.

Uploaded by

prabhabathi devi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
213 views15 pages

Floating Point Arithmetic

Floating point arithmetic involves representing numbers as a mantissa and exponent. Basic operations like addition and multiplication are performed by adding or subtracting exponents and multiplying or dividing mantissas. Challenges include dealing with overflow, underflow, normalization, and edge cases like zero operands. Floating point units perform these operations using separate mantissa and exponent units. Coprocessors can also be used to offload floating point arithmetic, allowing parallel execution but requiring communication with the CPU.

Uploaded by

prabhabathi devi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 15

FLOATING POINT

ARITHMETIC

Intro:
Let (XM , XE ) be the floating point
representation of number, X. [X= XM * BXE]
B- base of X.
Assumptions:
XM is an binary fraction; nM is the length
of XM
XE is an binary integer in excess 2nE-1
code; nE is the length of XE

FLOATING POINT
ARITHMETIC

Basic Operations:
1. Multiplication & Division:
-. Add/subtract the exponents. (Mul/div)
-. Multiply/divide the mantissa part.
-. Fixed point operation.
2. Addition & Subtraction:
-. Compare the exponent(Subtract).
-. Shift the smaller exponent having
number right by the difference
between the exponents.

FLOATING POINT
ARITHMETIC

Cntd..
-Now the exponent of both the numbers
become the same.
-Add/ subtract the mantissa.(Fixed point
process)
-Normalize the final result by shifting the
mantissa left to eliminate the leading
zeroes & in parallel correct the exponent
for shifting.
XY = (XM 2XE-YE YM)* 2E
(XE YE )

FLOATING POINT
ARITHMETIC

DIFFICULTIES:
1. While doing multiplication operation, we
need to add exponents which produces doubly
biased result. (Eg: 128+128=256(Doubly
Biased)-127=129(Correct One))
2. If X=0 and it is multiplied with a non zero
number; the mantissa part equals zero, but
the exponent will not be in all-zero form.
(Eg: 0 X 1.1* 22 produces
exponent=0+129=129should be made zero)

FLOATING POINT
ARITHMETIC
DIFFICULTIES:
3. Overflow & Underflow:
-Mantissa overflow can be overcome by shifting the
mantissa & alter the exponent.
-Exponent overflow- indicated by error signal.
-The floating point result overflowed or underflowedmay be represented in denormalized form.
4. Guard bit attachment:
-To preserve accuracy by rounding off (adding 1 to
xo and truncating)
-If mantissa is right shifted; the bits shifted right can
be retained as guard bits.

FLOATING POINT
ARITHMETIC

FLOATING POINT UNITS:

FLOATING POINT
ARITHMETIC

-FPU is implemented by two loosely


connected fixed point data path circuits.
Mantissa Unit:
-perform all basic operation; structure of
basic sequential ALU can be used.
Exponent Unit:
-perform Addition, Subtraction.
-Exponents are put E1 & E2 which are
connected to adder/subtractor which is
connected to the counter.

FLOATING POINT
ARITHMETIC

Cntd..
-Exponent Comparison is done by E1-E2; Larger
exponent is determined from the sign of E.
-Shifting of mantissa is controlled by E; Each
decrement results in one shift.
-Exponent of final result is also placed in E.
-Thus the floating point unit can be constructed
from the fixed point unit; and thus both units
can be implemented in same IC.
-But in recent years, they construct separate
units to enable parallel execution.

FLOATING POINT
ARITHMETIC

Improvements in Design:
-Test should be performed for underflow
and overflow; if occurs ERROR flag should
set.
-Test for zero should be carried out; if the
inputs are equal while subtracting,
mantissa becomes zero but the exponent
will be non-zero and it must be set to zero.
-If one operand is zero while adding; then
make the non-zero operand as the result.

FLOATING POINT
ARITHMETIC

Improvements in Design:
-If both the operands are zero while
adding; then make any one of the
operand as the result.
-If the difference between exponents is
very large while addition (E>nm); then E
number shifts can be replaced by nm
number of shifts.

FLOATING POINT
ARITHMETIC

Coprocessors:

FLOATING POINT
ARITHMETIC

Coprocessors:
-Separate instruction set computer that is
closely coupled to CPU whose instructions
& registers are extensions of CPUs.
-Instruction of coprocessor- fetched by
CPU, decoded by CPU and coprocessor,
executed by coprocessor.
-Coprocessors- used as memory
management system & graphic
controlling devices.

FLOATING POINT
ARITHMETIC

Cntd..
- Coprocessors require separate control
logic; it is a slave unit to main processor.
- If coprocessor instructions are
encountered; communication between
processor and coprocessor starts.
- Even though if coprocessor is not present;
the coprocessor instructions take the
program to the memory location for software
routine where the desired coprocessor
instructions are stored.

FLOATING POINT
ARITHMETIC

Cntd..
- CPU generated interruption of normal
program flow is called as coprocessor trap.
-Thus the coprocessor approach gives h/w or
s/w support without altering the CPU
program.
-Coprocessor instructions- three fieldsopcode, address of coprocessor, type of
operation executed by coprocessor.
-CPU & coprocessor can do their operation
parallely.

FLOATING POINT
ARITHMETIC

Cntd..
- Drawback: coprocessor dont know the
contents of registers; (i.e) When the
coprocessor needs to load or store
operands, it will ask CPU for addressing &
data info.

You might also like