Attribution Non-Commercial (BY-NC)

20 views

Attribution Non-Commercial (BY-NC)

- MAT 222 Real World Radical Formulas
- Chemistry Class 11 Chapter 1 Some Basic Concepts of Chemistry
- Autocad Subassembly Composer Expressions
- Hpgl_Manual
- Babar Academy: Notes of CH#1
- Chapter 02gvfg
- core_1-01
- Bickel_IEEE
- C.B
- A Novel Hardware-software Co-Design for Automatic White Balance
- cs1100Lec03
- Answers for the Floating Point Numbers
- 9789814321365
- Digital Electronics
- Data Types
- AN1215_PID68HC11
- sig-figs
- 0580_s14_qp_21
- 0580_s14_qp_21
- MM12-5 Introduction to Micromine (2011-07)

You are on page 1of 25

Dr. Gokay Saldamli

MIS 251

The Architecture of Computer Hardware

and Systems Software

2

Floating Point Numbers

Real numbers

Used in computer when the number

EIs outside the integer range of the computer

(too large or too small)

EContains a decimal fraction

3

Exponential Notation

Also called scientific notation

4 specifications required for a number

.Sign (+ in example)

Magnitude or mantissa (12345)

Sign of the exponent (+ in 10

5

)

_Magnitude of the exponent (5)

Plus

Base of the exponent (10)

:Location of decimal point (or other base) radix point

123450000 x 10

-4

0.12345 x 10

5

12345 x 10

0

12345

4

Summary of Rules

Exponent Base Mantissa Location

of decimal

point

-0.35790 x 10

-6

Sign of the exponent Sign of the mantissa

5

Format Specification

Predefined format, usually in 8 bits

EIncreased range of values (two digits of

exponent) traded for decreased precision

(two digits of mantissa)

Sign of the mantissa

5-digit Mantissa 2-digit Exponent

SEEMMMMM

6

Format

Mantissa: sign digit in sign-magnitude format

Assume decimal point located at beginning of

mantissa

Excess-N notation: Complementary notation

EPick middle value as offset where N is the

middle value

Increasing value +

49 0 -1 -50 Exponent being

represented

99 50 49 0 Representation

7

Overflow and Underflow

Possible for the number to be too large or too

small for representation

8

Conversion Examples

0.025000 = 0.25000 x 10

-1

= 04925000

55555 = 0.55555 x 10

5

= 5555555

0.0010000 = 0.10000 X 10

-2

= 54810000

246.57 = 0.24567 x 10

3

= 05324567

9

Normalization

Shift numbers left by increasing the exponent

until leading zeros eliminated

Converting decimal number into standard format

.Provide number with exponent (0 if not yet specified)

Increase/decrease exponent to shift decimal point to

proper position

Decrease exponent to eliminate leading zeros on

mantissa

_Correct precision by adding 0s or

discarding/rounding least significant digits

10

Example 1: 246.8035

05324680 5. Convert number

.24680 x 10

3

4. Cut to 5 digits

3. Already normalized

.2468035 x 10

3

2. Position decimal point

246.8035 x 10

0

1. Add exponent

Sign

Excess-50 exponent

Mantissa

11

Example 2: 1255 x 10

-3

05112550 5. Convert number

0.1255 x 10

+1

4. Add 0 for 5 digits

3. Already normalized

0.1255 x 10

+1

2. Position decimal point

1255x 10

-3

1. Already in exponential form

12

Example 3: - 0.00000075

154475000 5. Convert number

- 0.75000 x 10

-6

4. Add 0 for 5 digits

- 0.75 x 10

-6

3. Normalizing

2. Decimal point in position

- 0.00000075 x 10

0

1. Exponential notation

13

Floating Point Calculations

Addition and subtraction

EExponent and mantissa treated separately

EExponents of numbers must agree

Align decimal points

Least significant digits may be lost

EMantissa overflow requires exponent again

shifted right

14

Addition and Subtraction

Check results

= 0.1001985 x 10

2

In exponential form

= 10.01985

= 0.06785 04967850 = 0.67850 x 10

1

= 9.9520 05199520 = 0.99520 x 10

1

05210020 Round

05210019(850) Carry requires right shift

(1)0019850 Add mantissas; (1) indicates a carry

05199520

0510067850

Align exponents

05199520

+ 04967850

Add 2 floating point numbers

15

Multiplication and Division

Mantissas: multiplied or divided

Exponents: added or subtracted

ENormalization necessary to

Restore location of decimal point

Maintain precision of the result

EAdjust excess value since added twice

Example: 2 numbers with exponent = 3

represented in excess-50 notation

53 + 53 =106

Since 50 added twice, subtract: 106 50 =56

16

Multiplication and Division

Maintaining precision:

E Normalizing and rounding multiplication

0.20000 x 10

2

05220000 =

E Check results

0.25000 x 10

-2

E Normalizing and rounding

=

0.0250000000 x 10

-1

=

0.125 x 10

-3

04712500 =

05210020 E Round

04825000 E Normalize the results

0.20000 x 0.12500 = 0.025000000 E Multiply mantissas

52 + 47 50 = 49 E Add exponents, subtract offset

05220000

x 04712500

E Multiply 2 numbers

17

Floating Point in the Computer

Typical floating point format

E 32 bits provide range ~10

-38

to 10

+38

E 8-bit exponent = 256 levels

Excess-128 notation

E 23/24 bits of mantissa: approximately 7 decimal digits of

precision

18

Floating Point in the Computer

1010 1010 1010 1010 10101 101 0111 1110 1

-0.0010 1010 1010 1010 1010 1

1000 0111 1000 0000 0000 000 1000 0100 1

-1000.0111 1000 0000 0000 000

Excess-128 exponent

Mantissa Sign of mantissa

1100 1100 0000 0000 0000 000 = 1000 0001 0

+1.1001 1000 0000 0000 00

19

IEEE 754 Standard

52 23 Mantissa

Double

(64 bit)

Single

(32 bit)

Precision

1 bit 1 bit Sign

11 bits 8 bits Exponent

10

-300

to 10

300

10

-45

to 10

38

Value range

15 7 Decimal digits

2

-1022

to 2

1023

2

-126

to 2

127

Range

2 2 Implied base

Excess-1023 Excess-127 Notation

20

IEEE 754 Standard

32-bit Floating Point Value Definition

special condition not 0 255

0 255

2

-127

x1.M Any 1

-254

2

-126

x0.M Not 0 0

0 0 0

Value Mantissa Exponent

21

Conversion: Base 10 and Base 2

Two steps

EWhole and fractional parts of numbers with an

embedded decimal or binary point must be

converted separately

ENumbers in exponential form must be reduced

to a pure decimal or binary mixed number or

fraction before the conversion can be

performed

22

Conversion: Base 10 and Base 2

Convert 253.75

10

to binary floating point form

Divide by binary floating point equivalent of 100

10

to

restore original decimal value

0 10001101 10001100011111 IEEE Representation

110 0011 0001 1111 or 1.1000

1100 0111 11 x 2

14

Convert to binary

equivalent

25375 Multiply number by 100

Excess-127

Exponent = 127 + 14

Mantissa

Sign

23

Packed Decimal Format

Real numbers representing dollars and cents

Support by business-oriented languages like COBOL

IBM System 370/390 and Compaq Alpha

24

Programming Considerations

Integer advantages

EEasier for computer to perform

EPotential for higher precision

EFaster to execute

EFewer storage locations to save time and

space

Most high-level languages provide 2 or

more formats

EShort integer (16 bits)

ELong integer (64 bits)

25

Programming Considerations

Real numbers

EVariable or constant has fractional part

ENumbers take on very large or very

small values outside integer range

EProgram should use least precision

sufficient for the task

EPacked decimal attractive alternative

for business applications

- MAT 222 Real World Radical FormulasUploaded byKimberly Thomas
- Chemistry Class 11 Chapter 1 Some Basic Concepts of ChemistryUploaded byYogesh Goyal
- Autocad Subassembly Composer ExpressionsUploaded byMervin Bocatcat
- Hpgl_ManualUploaded bySasaS
- Babar Academy: Notes of CH#1Uploaded byMalik Babar Iqbal Awan
- Chapter 02gvfgUploaded byKwanele Msizi Gumede
- core_1-01Uploaded byjyoprasad
- Bickel_IEEEUploaded byschultzgms
- C.BUploaded byRahul C Sivadas
- A Novel Hardware-software Co-Design for Automatic White BalanceUploaded byppark10
- cs1100Lec03Uploaded byShellZero
- Answers for the Floating Point NumbersUploaded byMinoshini Fonseka
- 9789814321365Uploaded byeibsource
- Digital ElectronicsUploaded byTrần Tuy
- Data TypesUploaded byEr Ashish Baheti
- AN1215_PID68HC11Uploaded byrwong1231
- sig-figsUploaded byapi-258749062
- 0580_s14_qp_21Uploaded byshahul
- 0580_s14_qp_21Uploaded byHaider Ali
- MM12-5 Introduction to Micromine (2011-07)Uploaded bykstone74
- instructional planning gridUploaded byapi-283232953
- Module-1 (1)Uploaded bySoni
- computer arithmetic v9.pdfUploaded byYasser Alghrafy
- c++ opt (7).txtUploaded byAlin M Niță
- computer system architectureUploaded bysushil@ird
- ncves1308-1Uploaded byVikas Pakhretia
- ACCURACY-PRECISION-SIGNIFICANT-DIGITS.pdfUploaded byQedew Er
- Science Lab ReportUploaded byCaira Mae Sembrano
- 01 Lecture 1-Course IntroductionUploaded byAhmed Ismail
- Lab RubricUploaded byAngelo Calderon

- Team Problems 2002 NewUploaded byFrancisco De León-Sotelo Esteban
- Fractions, Decimals, And PercentsUploaded bycanfield8math
- alg1-bookUploaded byr2d2sd
- (in)Formats (in)Decently ExposedUploaded byakhiaddicted
- GQbysubject_pdfversionUploaded bygeeorgi23
- Fixed PointUploaded bysvasanth007
- The Use of Euclids Division Lemma to Prove Mathematical RelationshipsUploaded bysubhro66
- Input and Output Statements in Foxpro _ Live to Learn!Uploaded byGanapatibo Ganapati
- Frac BaseUploaded byFernandoDiaz
- G4-SHS Content List.xlsxUploaded byCaxandra Villamin Buenviaje
- math 4 3 study guideUploaded byapi-297727492
- 13 MathForManufacturing v143 Dec2013 ICCBUploaded byTom
- m15 Rational and Irrational NumbersUploaded byMichael Mcneil
- UnitsUploaded byMundu Mustafa
- Rpt & Plan-j Math Year 5Uploaded byyp87
- Conversion TablesUploaded byDancescu Alexandru
- TRAC, A Procedure-Describing Language for the Reactive TypewriterUploaded byTRAC_fan
- kira rubric rationalnumberUploaded byapi-317502596
- NEW CAPS Everything Maths Grade 10Uploaded byEduBoard
- Floating Point NumbersUploaded byLeo Lee
- TS-1-Number systems.pdfUploaded byUdai Kumar
- math-g5-m1-topic-a-overviewUploaded byapi-281330130
- Digital CircuitsUploaded byNitz Fajilan Paulasa
- Math for Sucess in ElectronicsUploaded byfranciscocampoverde8224
- Computer Basics and Q basic ProgrammingUploaded byAhmedWarshan
- A Computer Called LeoUploaded byBen Stoner
- Lec4-5Uploaded byvipulugale
- grade 5 - math standards examplesUploaded byapi-253140086
- GMAT-1000 DS QuestionsUploaded byHitesh Singla
- GR-6 mathUploaded byGolden Sunrise

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.