Professional Documents
Culture Documents
• Unsigned numbers don’t have any sign, these can contain only magnitude of
the number
• Unsigned binary numbers are, by definition, positive numbers and thus do not
require an arithmetic sign
Signed Numbers
• Signed numbers contain sign flag, this representation distinguish positive and negative
numbers.
• This technique contains both sign bit and magnitude of a number.
• For example, in representation of negative decimal numbers, we need to put negative
symbol in front of given decimal number.
• There are two ways that we can represent a signed number
• Sign Magnitude form
• Complementary form
Sign Magnitude Form
• In this method there will be 2 parts in a binary number. That is Sign bit and actual binary
bits/magnitude bits.
0 111000
• In this representation if the sign bit is “0”, the number is positive. If the sign bit is “1”, then the
number is negative.
Sign Magnitude Form
• +7 & -7
• +24 & -24
• +85 & -85
Complementary Form : 1`s Complement
• Since, 2’s complement of a number is obtained by inverting each bit of given number plus 1 to
least significant bit (LSB).
• In other word to obtained 2`s compliment first we have to take `1`s complement of a number
and then add 1 to the LSB.
+ 7 -> 1`s complement
0 111 +7-> 0111
+7-> 2`s complement -> 0111
Sign Bit 2`s complement of actual binary Bit
-7-> 1`s complement
1 001 -7->1000
-7-> 1000 -> 2`s complement
Sign Bit 2`s complement of actual binary Bit + 1
1001
Complementary Form : Activity
• +3 & -3
• +41 & -41
• +12 & - 12
• Find the 2`s complement of below numbers
• We may do the same in binary and this forms the foundation of our floating point number.
• Here it is not a decimal point we are moving but a binary point and because it moves it is
referred to as floating.
• What we will look at below is what is referred to as the IEEE 754 Standard for representing
floating point numbers. The standard specifies the number of bits used for each section
(exponent, mantissa and sign) and the order in which they are represented.
• The standard specifies the following formats for floating point numbers:
• Single precision, which uses 32 bits
• Double precision, which uses 64 bits
Single precision (32 bit)
• 1 bit for the sign of the number. 0 means positive and 1 means negative.
• 8 bits for the exponent.
• 23 bits for the mantissa.
Decimal to Floating point Conversion
https://www.youtube.com/watch?v=8afbTaA-gOQ&t=20s
Decimal to Floating point Conversion
Floating point to Decimal Conversion
https://www.youtube.com/watch?v=LXF-wcoeT0o&t=75s
Activity
• Double precision, which uses 64 bits and has the following layout.
• 1 bit for the sign of the number. 0 means positive and 1 means negative.
• 11 bits for the exponent.
• 52 bits for the mantissa.