Number Systems - Data Representation (Numbers)
Number Systems - Data Representation (Numbers)
NUMBERS
Introduction
7 8 9
0111 1000 1001
105 → 1000001012
7 8 9
11110111 11111000 11001001
-105 →
1 0 5
11110001 11110000 11010101
Numeric Representation
7 8 9 +(sign bit)
0111 1000 1001 1100
-105 →
1 0 5 - (sign bit)
0001 0000 0101 1101
Examples
1789 →
1 7 8 9 +(sign bit)
0000 0001 0111 1000 1001 1100
2) Fixed Point
3) Floating Point
Sign-magnitude Representation
Examples
Magnitude : 1011002 = 4410
01011002 = +4410
Magnitude : 1112 = 710
11112 = -710
The sign-magnitude binary format is the simplest
conceptual format. In this method of representing
signed numbers, the most significant digit (MSD) takes
on extra meaning.
A fixed point number just means that there are a fixed number of
digits after the decimal point. A floating point number allows for a
varying number of digits after the decimal point.
Floating point numbers are more general purpose because they can
represent very small or very large numbers in the same way, but
there is a small penalty in having to have extra storage for where
the decimal place goes.
https://stackoverflow.com/questions/7524838/fixed-point-vs-floating-point-number
Floating Point
Example:
1,500,000,000 - instead of writing 8 zeroes, this is written
as 15 X 108
In floating point, it would be written as
1.5 X 109 Exponent
Mantissa Radix
Steps in Decimal to Floating Point Conversion (IEEE)
(IEEE - Institute of Electrical and Electronics Engineering)
Sign bit
0-positive Only binary fraction, lower
1-negative than 1 can be represented
Radix is 2
Step 3 : Floating point representation
Exponent Portion
0 10000001
1.01 - 1 = .01
0 10000001 01000000000000000000000
Example # 2
0.09375 X 2 = 0.1875
0.1875 X 2 = 0.375
0.375 X 2 = 0.75
0.75 X 2 = 1.5
0.5 X 2 = 1.0
Example # 2
0 01111011 10000000000000000000000
0 10000100 000000010000000000000
References:
https://www.wikihow.com/Convert-a-Number-from-Decimal-to-IEEE-754-
Floating-Point-Representation