Sunteți pe pagina 1din 5

P.N. System=dn bn +... +d1b1+d0b0+d-1b-1+...

Bit Position=5 4 3 2 1 0 -1
Decimal (65) Bin. Sys= 32 16 8 4 2 1 ½
1000001 (47.5)D = 1 0 1 1 0 1 1
/base | *base
1

Group by 3 bit & Octal Value (L<-R|L->R)


-
Binary Octal (8) Hexadecimal (16)
1000001 101 41
3 Bit Binary of
Octal Digit
1 - 1
Group by 4 bit & Hex Value (L->R|L<-R)
- -
4 Bit Banary Value of Hex Digit

Scan from Right & keep unchanged till first ‘1’ & after that complement the
rest e.g 10010  01110

1->0 & 0->1


1’s 2’s=1’s + 1
0111110 0111111

1 : 65
BCD 1
Excess-3 : 6 +3=9 ASCII : Zone + Number Gray |Mirror
A=65 100 0001 code
-
0110 0101 -
110+11=1001
Negative numbers Sign Magnitude(1=-ve & 0=+ve) 1’s Representation 2’s Representation
+5=0101 & -5=1010
5=101 +5= 0 101 & -5=1 101 +5=0 101 & -5=1 010

Subtraction

Using 1’s Complement Subtraction Using 2’s Complement


1.Make Equal Bit 1. Make Equal Bit
2.R=A+B1’s 2. R=A+B2’s
3.if c=1 then R=Rt+1 3. if c=1 then R= Rt (Ignore Carry)
Else R=-(Rt)1’s Else R=-(Rt)2’s

N N A =3=011 A = 011 A= 4 =100=0100 A= 0100 N


Carry B =7=111 B1’s= 000 B= 10 = 1010 B2’s= 0110 Carr
Rt = 011 Rt=0 1010 y
R= - ( Rt)1’s R = - 100 R= - (Rt)2’s R= 0110
Y Y
A =7=111 A= 111 A=10=1010 A= 1010
B =3=11=011 B1’s= 100 B1’s=4=100=0100 B2’s= 1100
Y Rt= 1 011 Ignore Addl. Carry Rt=1 0110
R=Rt+add addl. carry 1 R= Rt R= 0110
R= 100

D:/db/
IEEE Standard 754 Floating Point Numbers
The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical
standard for floating-point computation which was established in 1985 by
the Institute of Electrical and Electronics Engineers (IEEE) . The
standard addressed many problems found in the diverse floating point
implementations that made them difficult to use reliably and reduced their
portability. IEEE Standard 754 floating point is the most common
representation today for real numbers on computers, including Intel-based
PC’s, Macs, and most Unix platforms.
There are several ways to represent floating point number but IEEE 754 is
the most efficient in most cases. IEEE 754 have 3 basic components:

1. The Sign of Mantisa –


This is as simple as the name. 0 represents a positive number while 1
represents a negative number.
2. The Biased exponent –
The exponent field needs to represent both positive and negative
exponents. A bias is added to the actual exponent in order to get the
stored exponent.
3. The Normalised Mantisa –
The mantisa is part of a number in scientific notation or a floating-
point number, consisting of its significant digits. Here we have only 2
digits, i.e. O and 1. So a normalised mantisa is one with only one 1 to
the left of the decimal.
IEEE 754 numbers are divided into two based on the above three components: single precision and
double precision.

TYPES SIGN BIASED EXPONENT NORMALISED MANTISA BIAS

Single precision 1(31st bit) 8(30-23) 23(22-0) 127

1(63rd bit)

Double precision 11(62-52) 52(52-0) 1023

Example –
85.125

D:/db/
85 = 1010101

0.125 = 001

85.125 = 1010101.001

=1.010101001 x 2^6

sign = 0

1. Single precision:

biased exponent 127+6=133

133 = 10000101

Normalised mantisa = 010101001

we will add 0's to complete the 23 bits

The IEEE 754 Single precision is:

= 0 10000101 01010100100000000000000

This can be written in hexadecimal form 42AA4000

2. Double precision:
biased exponent 1023+6=1029
1029 = 10000000101
Normalised mantisa = 010101001
we will add 0's to complete the 52 bits

The IEEE 754 Double precision is:


= 0 10000000101 0101010010000000000000000000000000000000000000000000
This can be written in hexadecimal form 4055480000000000

Special Values: IEEE has reserved some values that can ambiguity.
 Zero –
Zero is a special value denoted with an exponent and mantissa of 0.
-0 and +0 are distinct values, though they both are equal.
 Denormalised –
If the exponent is all zeros, but the mantissa is not then the value is a
denormalized number. This means this number does not have an
assumed leading one before the binary point.
 Infinity –
The values +infinity and -infinity are denoted with an exponent of all
ones and a mantissa of all zeros. The sign bit distinguishes between
negative infinity and positive infinity. Operations with infinite values
are well defined in IEEE.
 Not A Number (NAN) –
The value NAN is used to represent a value that is an error. This is represented when exponent
field is all ones with a zero sign bit or a mantissa that it not 1 followed by zeros. This is a
special value that might be used to denote a variable that doesn’t yet hold a value.
EXPONENT MANTISA VALUE

0 0 exact 0

D:/db/
EXPONENT MANTISA VALUE

255 0 Infinity

0 not 0 denormalised

255 not 0 Not a number (NAN)


Similar for Double precision (just replacing 255 by 2049), Ranges of Floating point numbers:

DENORMALIZED NORMALIZED APPROXIMATE DECIMAL

Single Precision ± 2-149 to (1 – 2-23)×2-126 ± 2-126 to (2 – 2-23)×2127 ± approximately 10-44.85 to approximately 1038.53

Double

Precision ± 2-1074 to (1 – 2-52)×2-1022 ± 2-1022 to (2 – 2-52)×21023 ± approximately 10-323.3 to approximately 10308.3


The range of positive floating point numbers can be split into normalized
numbers, and denormalized numbers which use only a portion of the
fractions’s precision. Since every floating-point number has a
corresponding, negated value, the ranges above are symmetric around
zero.

There are five distinct numerical ranges that single-precision floating-


point numbers are not able to represent with the scheme presented so far:

1. Negative numbers less than – (2 – 2-23) × 2127 (negative overflow)


2. Negative numbers greater than – 2-149 (negative underflow)
3. Zero
4. Positive numbers less than 2-149 (positive underflow)
5. Positive numbers greater than (2 – 2-23) × 2127 (positive overflow)
Overflow generally means that values have grown too large to be
represented. Underflow is a less serious problem because is just denotes
a loss of precision, which is guaranteed to be closely approximated by
zero.

Table of the total effective range of finite IEEE floating-point numbers is shown below:

BINARY DECIMAL

Single ± (2 – 2-23) × 2127 approximately ± 1038.53

Double ± (2 – 2-52 ) × 21023


approximately ± 10308.25

Special Operations –
OPERATION RESULT

n ÷ ±Infinity 0

±Infinity × ±Infinity ±Infinity

±nonZero ÷ ±0 ±Infinity

±finite × ±Infinity ±Infinity

Infinity + Infinity +Infinity

D:/db/
OPERATION RESULT

Infinity – -Infinity

-Infinity – Infinity

-Infinity + – Infinity NaN

±0 ÷ ±0 NaN

±Infinity ÷ ±Infinity NaN

±Infinity × 0 NaN

NaN == NaN False

D:/db/

S-ar putea să vă placă și