2079 8

CSC213 ยท 2079 ยท 5 marks

Explain the binary adder-subtractor circuit with suitable diagram.

Explain the binary adder-subtractor circuit with suitable diagram. [5]

Computer ArchitectureChapter 2: Register Transfer and MicrooperationsArithmetic Microoperations

Quick answer

A binary adder-subtractor is a combinational circuit that can perform both addition and subtraction of binary numbers using a single circuit, controlled by a mode select input.

Binary Adder-Subtractor Circuit

Introduction


Working Principle

The circuit uses the concept of 2's complement subtraction:

A - B = A + (2's complement of B) = A + (1's complement of B) + 1

  • When Mode M = 0 โ†’ Circuit performs Addition: A + B
  • When Mode M = 1 โ†’ Circuit performs Subtraction: A - B (i.e., A + B' + 1)

The key component used is the XOR gate:

MBiXOR Output (M โŠ• Bi)
000 (passes B unchanged)
011 (passes B unchanged)
101 (complements B)
110 (complements B)

So when M = 1, each bit of B is complemented (1's complement), and M = 1 is also fed into the carry-in (C0) of the first Full Adder, which adds 1, completing the 2's complement.


Circuit Diagram (4-bit Adder-Subtractor)

        B3      A3    B2      A2    B1      A1    B0      A0
        |       |     |       |     |       |     |       |
       XOR      |    XOR      |    XOR      |    XOR      |
        |  M----+     |  M----+     |  M----+     |  M----+---> C0 (Carry In)
        |       |     |       |     |       |     |       |
       FA  <--C3     FA  <--C2     FA  <--C1     FA  <-- M
        |             |             |             |
        S3            S2            S1            S0

Diagram:

B3 A3    B2 A2    B1 A1    B0 A0
 |  |     |  |     |  |     |  |
 C3 FA   C2 FA   C1 FA   C0 FA  <-- C0 = M
  |        |        |        |
  S3       S2       S1       S0

Each stage consists of a Full Adder (FA) where:

  • One input is Ai
  • Other input is M โŠ• Bi (XOR of mode bit and Bi)
  • Carry ripples from stage to stage
  • Initial carry C0 = M

Operation Summary

Mode (M)OperationExpression
M = 0AdditionS = A + B, C0 = 0
M = 1SubtractionS = A + B' + 1 = A - B, C0 = 1

Overflow Condition

While adding two n-bit binary numbers, the result may be a number with (n+1) bits -- this situation is called overflow.

In the adder-subtractor, overflow can be detected by checking if the final carry out is inconsistent with the sign bits of the operands.


Conclusion

The binary adder-subtractor efficiently combines addition and subtraction in one circuit using XOR gates and Full Adders, with the mode input M controlling the operation. This reduces hardware complexity significantly compared to having separate adder and subtractor circuits.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.