Endianness
- Endianness pertains to the manner in which we store a sequence of bytes in digital data in memory .
- A Big Endian system stores the most significant byte at the smallest address. The memory layout ends up storing the number backwards
- A Little Endian system stores the least significant byte at the smallest memory address. The memory layout ends up storing the number in reading order.
Number Representations
NaN
- A Not a Number results denotes an entity which cannot be particular format (i.e., because of indeterminate forms)
- A signaling NaN is a special form of NaN which should raise an invalid operation exception when consumed by most operations.
- A quiet NaN is a NaN which does not raise any additional exceptions as it propagates through must operations.
Extensions
-
Extension pertains to the process of representing a number that was in
bits to another number in bits, where . We have two possible definitions of extensions
- Signed Extension involves repeatedly adding leading
’s if the number is positive and leading ’s if the number is negative. - Zero extension involves adding leading
s.
- Signed Extension involves repeatedly adding leading
Coded Decimals
-
Unpacked Binary Coded Decimal encodes the number by representing the digit with its equivalent
-bit number in binary. -
Packed BCD removes the first four MSb.
Each digit’s representation is shown in the table below
digit UBCD Packed BCD 0 0000 0000 0000 1 0000 0001 0001 2 0000 0010 0010 3 0000 0011 0011 4 0000 0100 0100 5 0000 0101 0101 6 0000 0110 0110 7 0000 0111 0111 8 0000 1000 1000 9 0000 1001 1001
Floating Point Standard
-
Defines the standard for representing floating point numbers.
-
Let
be the sign bit be the stored exponent be the mantissa. be the number of bits to be used - the number of bits for the exponent the number of bits for the mantissa. -
The format is given as
1 | b_e | b_m
sign | exponent | mantissa
-
The real number is to be represented as
must be normalized to ensure canonical representation. Thus, we have an implied -
The sign bit represents the sign of
. is positive, is negative -
The stored exponent is calculated as
-
The mantissa represents the remaining
bits and store the significand .
Special Values
- Note that
and denote numbers arbitrarily close to but not .
Infinity
-
-
(all one’s) -
-
Infinity denotes the largest magnitude number representable within the format
Subnormal Numbers
These numbers are of the form
Not a Number
is any value. (all one’s) begins with for Signaling NaN begins with for Quiet NaN