R.D.SIVAKUMAR, M.Sc., M.Phil., M.Tech.,
Assistant Professor of Computer Science &
Assistant Professor and Head, Department of M.Com.(CA),
Ayya Nadar Janaki Ammal College,
Sivakasi – 626 124.
Mobile: 099440-42243
e-mail : sivamsccsit@gmail.com
website: www.rdsivakumar.blogspot.in
BINARYARITHMETIC
Let's add 1101 to 1101 (assume both are 4-bit UB numbers).
Let the rightmost column be column 0, and the leftmost column be column 3.
First, add the right most column (column 0). Summing 1 + 1 results in 0, with a carry of 1 to
column 1.
Then, add the two bits in column 1, plus the carry bit. Summing 0 + 0, plus the carry 1, results
in 1, with a carry of 0 to column 2.
Then, add the two bits in column 2, plus the carry bit. Summing 1 + 1, plus the carry 0, results
in 0, with a carry of 1 to column 3.
Finally, add the two bits in column 3, plus the carry bit. Summing 1 + 1, plus the carry 1, results
in 1, with a carry of 1 to column 4. We've had to "create" a column 4 to place the fifth bit of the
sum.
An Example
ADDITION – UNSIGNED NUMBERS
BINARY ARITHMETIC –ADDITION – SIGNED NUMBERS
An Example
Adding signed numbers is not significantly different from adding unsigned numbers.
Recall that signed 4 bit numbers (2's complement) can represent numbers between -8
and 7. To see how this addition works, consider two examples.
Decimal Signed Binary
1110 (carry)
-2 1110
+3 0011
1 0001
Decimal Signed Binary
001 (carry)
-5 1011
+3 0011
-2 1110
BINARY ARITHMETIC – SUBTRACTION
An Example
Append leading zeros if necessary to represent both numbers with the same
number of digits. For example, convert 101-11 to 101-011 so that both have three
digits.
Apply two's complement to the second term : For each digit in the number,
change every 1 to 0 and every 0 to 1.
Add 1 to the number.
Add the complemented number to the first term. Now the original 101 -
11 has become 101 + 101 = 1010.
The sum in the previous step should have one more digit than you
started with. Remove the most significant digit from the sum to get 101 -
11 = 010. If you don't have an extra digit, you tried to subtract a larger
number from a smaller one.
Binary Arithmetic - R.D.Sivakumar

Binary Arithmetic - R.D.Sivakumar

  • 1.
    R.D.SIVAKUMAR, M.Sc., M.Phil.,M.Tech., Assistant Professor of Computer Science & Assistant Professor and Head, Department of M.Com.(CA), Ayya Nadar Janaki Ammal College, Sivakasi – 626 124. Mobile: 099440-42243 e-mail : sivamsccsit@gmail.com website: www.rdsivakumar.blogspot.in BINARYARITHMETIC
  • 2.
    Let's add 1101to 1101 (assume both are 4-bit UB numbers). Let the rightmost column be column 0, and the leftmost column be column 3. First, add the right most column (column 0). Summing 1 + 1 results in 0, with a carry of 1 to column 1. Then, add the two bits in column 1, plus the carry bit. Summing 0 + 0, plus the carry 1, results in 1, with a carry of 0 to column 2. Then, add the two bits in column 2, plus the carry bit. Summing 1 + 1, plus the carry 0, results in 0, with a carry of 1 to column 3. Finally, add the two bits in column 3, plus the carry bit. Summing 1 + 1, plus the carry 1, results in 1, with a carry of 1 to column 4. We've had to "create" a column 4 to place the fifth bit of the sum. An Example ADDITION – UNSIGNED NUMBERS
  • 3.
    BINARY ARITHMETIC –ADDITION– SIGNED NUMBERS An Example Adding signed numbers is not significantly different from adding unsigned numbers. Recall that signed 4 bit numbers (2's complement) can represent numbers between -8 and 7. To see how this addition works, consider two examples. Decimal Signed Binary 1110 (carry) -2 1110 +3 0011 1 0001 Decimal Signed Binary 001 (carry) -5 1011 +3 0011 -2 1110
  • 4.
    BINARY ARITHMETIC –SUBTRACTION An Example Append leading zeros if necessary to represent both numbers with the same number of digits. For example, convert 101-11 to 101-011 so that both have three digits. Apply two's complement to the second term : For each digit in the number, change every 1 to 0 and every 0 to 1. Add 1 to the number. Add the complemented number to the first term. Now the original 101 - 11 has become 101 + 101 = 1010. The sum in the previous step should have one more digit than you started with. Remove the most significant digit from the sum to get 101 - 11 = 010. If you don't have an extra digit, you tried to subtract a larger number from a smaller one.