Handling Floating Point Operands - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Handling Floating Point Operands

Description:

If they happen to be the same then activate ADDER circuit else activate SUBTRACTOR section. ... Activate ADDER Section ( Signs are Equal ). Step 6. ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 9
Provided by: parthasa
Category:

less

Transcript and Presenter's Notes

Title: Handling Floating Point Operands


1
Handling Floating Point Operands
  • Type of Processing
  • Addition .
  • Subtraction.
  • Multiplication.
  • Division.
  • Associated Operations ( always required )
  • i) Compare Biased Exponents.
  • ii) Bias / Un bias Exponents.
  • iii) Adjust Significand / Mantissa by modifying
    Biased Exponent portion.
  • iv) Normalize a De Normalized Number extension
    of iii) .

2
Handling Floating Point Operands-2
  • The Operands In Base r
  • A ? As n digits ? r AX(AeBa)
  • AX Biased Exponent (m digits), Ae Actual
    Exponent , Ba Bias
  • B ? Bs k digits ? n ? r BX(BeBa)
  • BXBiased Exponent (L digits ? m )Be
    Actual Exponent , Ba Bias
  • The Basic Circuit
  • Signed Magnitude Arithmetic Circuit with
    separate ADDER , SUBTRACTOR , COMPARATOR
    SHIFTER section.

3
The Addition Subtraction - 1
  • Step 1. Check for either A or B ?? OR NaN .
  • Step 2. If any Operand happens to be invalid then
    Exit
  • with proper message else go to Step
    3.
  • Step 3. Check for either A or B 0 , if it is
    then
  • I) Generate Result Z Other
    Operand A / B.
  • ii) EXIT
  • Step 4. If the Operation is to perform A MINUS B
    then change
  • the sign of B.
  • Step 5. Compare the signs of the two Operands A
    B . If they happen to be the same then activate
    ADDER circuit else activate SUBTRACTOR section.

4
The Addition Subtraction - 2
  • Step 6. Compare the two exponents AX BX .
  • Step 7. If the two exponents are equal i.e. AX
    BX go to Step 9.
  • Step 8. AX ? BX . Adjust Exponents
  • Step 8A. Increment smaller
    Exponent.
  • Step 8B. Shift its Significant
    Right (may get De Normalized)
  • Step 8C. If Significant 0 then
    Result Other Operand
  • EXIT ELSE go to
    Step 6 .
  • Step 9. Exponents are Equal , ADD/ SUBTRACT
    Signed Significands
  • Step 10. If result Significand 0 treat as ZERO
    RESULT EXIT.

5
The Addition Subtraction - 3
  • Step 11. If the result significant produces Carry
    OR Borrow then
  • Step 11a. Shift Result Significant
    Right.
  • Step 11b. Increment Result
    Exponent.
  • Step 11c. If Exponent Overflows
    Report EXIT
  • Step 12. If the Result is De Normalized then
  • Step 12a. Shift Significant Left.
  • Step 12 b. Decrement Exponent.
  • Step 12 c. If Exponent Underflows ,
    Report EXIT.
  • Step 13. Round Off Result (if needed).
  • EXIT

6
Addition / Subtraction Example
  • A - 0.23967 e 95 , B 0.4543102 e 90
    Decimal
  • To Compute C A MINUS B
  • Step 1 , 2 3. Passed.
  • Step 4. Change sign of B i.e. B 9 0.4543102 e
    90
  • A
    9 0. 23967 e 95
  • Step 5. Activate ADDER Section ( Signs are Equal
    ).
  • Step 6. Exponents AX 95 gt BX 90 adjust
    Exponents.
  • Step 8. Step 8A. Increment Exponent BX ? 90 ..
    95
  • Step 8B. Right shifted B
    significant 90.000004543
  • Step 9. ADD Significant C 9 0.239674543 e 95
    Normalized.

7
Multiplication Algorithm
  • To compute Z A X B in Base r
  • Step 1A . Check for either A or B ?? OR NaN .
    In such case Report Outside Range Exit.
  • Step 1B. If A OR B 0 then Result Z 0 EXIT.
  • Step 2. Check Note the signs of the two
    Significands Asign Bsign.
  • Step 3a. Add the two Exponents Ax Bx to
    produce the result Exponent Zx. Ignore any
    overflow now.
  • Step 3b. Subtract Bias from Cx. This this will
    remove the effect of the Bias which has been
    added twice in the Result Exponent Zx.
  • Step 4. If Exponent Underflow / Overflow still
    persists in Zx, Report EXIT.
  • Step 5. Multiply Significands Zs As ? Bs using
    Shift ADD Meta Step.
  • Step 6. Normalize Result Significand Zs. Report
    Exponent Underflow/Overflow.
  • Step 7. Adjust sign of the result Zsign Round
    off Result (if necessary)..

8
Division Algorithm
  • To compute Q A / B in Base r
  • Step 1A. Check for either A or B ?? OR NaN .
    In such case Report Outside Range EXIT.
  • Step 1B. If A 0 then Result Q 0 EXIT.
  • Step 1C. If B 0 then Report Divisor too small
    EXIT.
  • Step 2. Check Note the signs of the two
    Significands Asign Bsign.
  • Step 3. Subtract the two Exponents Ax Bx this
    will cause Bias removed from the Result Exponent
    Qx.
  • Step 4. Restore Bias in result exponent by adding
    Bias to Zx.
  • Step 5. If Exponent Underflow / Overflow occurs
    in Zx, Report EXIT.
  • Step 6. Divide Significands Qs As / Bs using
    Shift SUBTRACT Meta Step to generate the
    Quotient .
  • Step 7. Set up Quotient Sign Qsign .
  • Step 8. Normalize Quotient Significand Qs.
    Report Exponent Underflow/Overflow.
  • Step 9. Round off Result (if necessary)..
Write a Comment
User Comments (0)
About PowerShow.com