CSE 20CS11T U1 S4 Sy
CSE 20CS11T U1 S4 Sy
BINARY ARITHMETIC
Binary arithmetic is essential part of all the digital computers and many other digital
systems.
Binary Addition
There are four rules of binary addition.
Example:
Binary Subtraction
There are four rules of binary subtraction.
Example:
In the above example so much of borrowing is required. This is the additional problem
for computer with signed or negative numbers.
Arithmetic operations in computer can be handled in two ways
1. Sign-Magnitude method
2. Complementary method
Example1
Decimal Sign-Magnitude
+6 0110
-6 1110
-0 1000
+0 0000
Disadvantages
• There are two notations for 0(0000 and 1000), which is very inconvenient when
the computer wants to test for a 0 result.
• Complicates the design of the logic circuits that handle signed-numbers
arithmetic, because each of the sign and magnitude parts has to be processed
separately.
• Separate hardware circuits are required to do the addition and subtraction
operations.
2. COMPLEMENTARY METHOD
Complements are alternative way of representing negative binary number. This
alternative method also as the unique property that subtraction, multiplication and
division can be performed using addition hardware.
Example:
Advantages
• It is quite convenient for the computer to perform arithmetic.
• Easy way to represent negative numbers.
• Changing sign reduces to complementing all the bits.
Disadvantages
• Not very simple to understand because it is very much different from the
conventional way of representing signed numbers.
• There are two notations for 0 (0000 and 1111).
• Arithmetic operations are not easier because of addition of end-around-carry-bit.
• Positive and Negative numbers need to be processes separately.
Example:
Advantages
• Most popular choice for representing signed numbers.
• The algorithm for adding and subtracting is quite easy.
• The best representation for 0 (all 0 bits).
• It is easy extended to larger numbers of bits.
• End around carry bit addition does not occur in arithmetic operations. It is
ignored.
• Convenient for binary arithmetic.
Disadvantages
• It is not very simple to understand because it is very much different from the
conventional way of representing signed numbers.
• Overflow occurs if the result is out of range.
• Slightly more complex to obtain 2’s complement.
It has two zeros (+0 & -0) It has only single zero
It is obtained by taking 1’s complement
It can be easily obtained by using inverter
and adding one to it
Value range is less than 2’s complement Value range is unequal Value range is unequal
(-2n-1-1 to +2n-1-1) (-2n-1 to +2n-1-1)
It requires two separate operations Only one arithmetic operation required to
(Addition & subtraction) perform both.
It is often used in logical manipulations for
It is used only in arithmetic applications
inversion operations