Presentation is loading. Please wait.

Presentation is loading. Please wait.

Storing Integers and Fractions

Similar presentations


Presentation on theme: "Storing Integers and Fractions"— Presentation transcript:

1 Storing Integers and Fractions

2 1 Storing Integers Two’s complement notation
The most popular means of representing integer values

3 Figure 1.21 Two’s complement notation systems

4 Figure 1.23 Addition problems converted to two’s complement notation

5 2 Storing Fractions Floating-point notation
In contrast to the storage of integers, the storage of a value with a fractional part requires that we store not only the pattern of 0s and 1s representing its binary representation but also the position of the radix point. A popular way of doing this is based on scientific notation and is called floating-point notation.

6 2 Storing Fractions Scientific notation:
Floating-point notation consists two fields: the exponent field (阶码)and the mantissa field (尾数) Single precision floating point: 32bits, a precision of 7 decimal digits; Double precision floating point: 64bits, a precision of 15 decimal digits

7 Figure: The storage of Single precision floating point
exponent field (1byte) mantissa field (3bytes) sign of exponent (阶符) exponent (阶码) sign of mantissa (数符) mantissa (尾数) 1bit 7bit 23bit 26.5= = ×2+5 N=数符×尾数×2 阶符×阶码

8 3 Hexadecimal Notation Hexadecimal notation
A shorthand notation for long bit patterns Divides a pattern into groups of four bits each Represents each group by a single symbol Example: ( )B becomes (A3)H Example: ( )B becomes (0.D6)H

9 Figure 1.6 The hexadecimal coding system

10 4 Octal Notation Octal notation Example: (10100011)B becomes (243)O
Divides a pattern into groups of three bits each Represents each group by a single symbol Example: ( )B becomes (243)O Example: ( )B becomes (0.654)O

11 Figure: Relationship among four kinds of coding system
decimal binary octal hexadecimal A B C D E F

12 4 Octal Notation Summary Two’s complement notation
Floating-point notation Hexadecimal notation Octal notation


Download ppt "Storing Integers and Fractions"

Similar presentations


Ads by Google