DEV Community

MENUA
MENUA

Posted on

Half and Full adder. Half and Full subtractor

What are Half and Full Adders?

Full and half adders are the basic elements of digital logic used to perform addition operations in a binary system.

What is Half Adder?

Half Adder is a combinational logic circuit that is designed by connecting one XOR gate and one AND gate. The half-adder circuit has two inputs: A and B, which add two input digits and generate a carry and a sum.

Image description

Now, let's build a truth table for half adder.

Image description

What is Full Adder?

A Full Adder is an extension of the half adder that adds two single-bit binary numbers along with an additional Carry-in (Cin) from a previous stage. It produces:

  1. Sum (S): The sum of the inputs and the carry-in.
  2. Carry-out (Cout): The carry-out from the addition.

Image description

In simple terms, the Full Adder consists with 2 Half Adders and one logic gate OR.

Now, let's build the truth table for Full Adder values.

Image description

Conclusion:

  1. Half Adder adds two bits.
  2. Full Adder adds two bits and a carry-in, handling the carry distribution between bits in multi-bit addition.

Now, let's move on to Half and Full subtractor.

What is Half Subtractor?

A Half Subtractor is a digital circuit used to subtract two single-bit binary numbers. Like a half adder, it operates on two inputs, but instead of adding, it subtracts. The two outputs are:

  1. Difference (D): Represents the difference between the two bits.
  2. Borrow (B): Represents whether a "borrow" is required for the subtraction.

Image description

And again, build the truth table.

Image description

A half subtractor cannot handle the borrow from a previous stage, making it unsuitable for multi-bit subtraction.

What is Full Subtractor?

A Full Subtractor is an extension of the half subtractor. It subtracts two single-bit binary numbers along with an additional Borrow-in (Bin) from a previous stage. It produces:

  1. Difference (D): The difference between the inputs and the borrow-in.
  2. Borrow-out (Bout): The borrow generated if needed for further subtraction. The circuit diagram for a full subtractor usually consists of two half-subtractors and an additional OR gate to calculate the borrow-out bit.

Image description

And the truth table

Image description

Conclusion:

  1. Half Subtractor: Subtracts two bits, gives the difference and a borrow.
  2. Full Subtractor: Subtracts two bits with a borrow-in, handling multi-bit subtraction by distributing the borrow across stages.

Top comments (0)