Adders and Subtractors

Adders and Subtractors

Introduction

Adders and Subtractors are fundamental combinational circuits used in digital electronics to perform arithmetic operations. They are integral components in arithmetic logic units (ALUs) and are used in processors, calculators, and various digital systems.

Types of Adders

  Half Adder

  • Performs the addition of two binary digits.
  • Inputs: Two bits A and B.
  • Outputs:
    • Sum (S): XOR of A and B, S=A⊕B.
    • Carry (C): AND of A and B,C=A⋅B.

Logic Diagram:

  • XOR gate for S.
  • AND gate for C.

   Full Adder

  • Performs addition of three binary digits (two input bits A, B, and a carry-in  ( Cin​).
  • Outputs:
    • Sum (S): S=A⊕B⊕Cin.
    • Carry (Cout​): Cout=(A⋅B)+(B⋅Cin)+(A⋅Cin)

Logic Diagram:

  • Two XOR gates for S.
  • AND and OR gates for Cout​.

Ripple Carry Adder

  • A combination of multiple full adders connected in series to add multi-bit binary numbers.
  • The carry-out of one full adder is the carry-in of the next.
  • Drawback: Slower due to the ripple effect of carry propagation.

Carry Look-Ahead Adder

  • Improves the speed of addition by calculating carries in advance using a generate (G=A⋅B) and propagate (P=A+B) mechanism.
  • Advantages: Faster than ripple carry adder.

Types of Subtractors

Half Subtractor

  • Performs subtraction of two binary digits.
  • Inputs: Two bits A and B.
  • Outputs:
    • Difference (D): D=A⊕B.
    • Borrow (Bout​): Bout= A‾⋅ B.

Logic Diagram:

  • XOR gate for D.
  • AND and NOT gates for Bout​.

Full Subtractor

  • Performs subtraction of three binary digits (two input bits A, B, and a borrow-in Bin​).
  • Outputs:
    • Difference (D): D=A⊕B⊕Bin​.
    • Borrow (Bout​): Bout=(A‾⋅B)+(B⋅Bin)+(A‾⋅Bin)

Logic Diagram:

  • Two XOR gates for D.
  • AND, OR, and NOT gates for Bout​.

 Combined Adder-Subtractor

  • A single circuit that performs both addition and subtraction by using a control signal.
  • Control Signal (M):
    • M=0: Performs addition.
    • M=1: Performs subtraction.
  • Operation:
    • Subtraction is achieved by taking the 2’s complement of B (invert B and add 1).

Circuit Components:

  • Full adders.
  • XOR gates for complementing B when M=1.