Skip to content

Half Adder and Half Subtractor


1. Introduction

In Computer System Architecture (CSA), half adder and half subtractor are basic combinational logic circuits used to perform simple binary addition and binary subtraction of two single-bit inputs.

These are fundamental building blocks for designing complex arithmetic operations inside processors (ALU – Arithmetic Logic Units).


2. Half Adder

Definition

A Half Adder is a combinational circuit that performs the addition of two single-bit binary numbers.
It produces two outputs:

  • Sum (S): Represents the result of addition.
  • Carry (C): Represents overflow if the sum exceeds 1.

Inputs and Outputs

  • Inputs: A, B (two binary digits)
  • Outputs: Sum (S), Carry (C)

Truth Table

ABSum (S)Carry (C)
0000
0110
1010
1101

Boolean Expressions

  • Sum (S) = A ⊕ B (A XOR B)
  • Carry (C) = A · B (A AND B)

Logic Diagram

  A -----|⊕|---- Sum
|
|
B -----|

A -----|&|---- Carry
|
|
B -----|
  • XOR Gate for Sum
  • AND Gate for Carry

Working

  • If both inputs are 0 → Sum = 0, Carry = 0
  • If one input is 1 → Sum = 1, Carry = 0
  • If both inputs are 1 → Sum = 0, Carry = 1 (because 1 + 1 = 10 in binary)

3. Half Subtractor

Definition

A Half Subtractor is a combinational circuit that performs the subtraction of two single-bit binary numbers.
It produces two outputs:

  • Difference (D): Represents the result of subtraction.
  • Borrow (B): Represents if a ‘borrow’ is needed.

Inputs and Outputs

  • Inputs: A, B (minuend and subtrahend)
  • Outputs: Difference (D), Borrow (B)

Truth Table

ABDifference (D)Borrow (B)
0000
0111
1010
1100

Boolean Expressions

  • Difference (D) = A ⊕ B (A XOR B)
  • Borrow (B) = (¬A) · B

Here:

  • ¬A means NOT A.
  • Borrow occurs when A is 0 and B is 1.

Logic Diagram

  A -----|⊕|---- Difference
|
|
B -----|

A ---|¬|--+---|&|---- Borrow
|
B -----------|
  • XOR Gate for Difference
  • NOT gate and AND gate combination for Borrow

Working

  • If both inputs are 0 → Difference = 0, Borrow = 0
  • If A is 0 and B is 1 → Difference = 1, Borrow = 1 (because you need to borrow 1)
  • If A is 1 and B is 0 → Difference = 1, Borrow = 0
  • If both are 1 → Difference = 0, Borrow = 0

🌟 Summary Table

FeatureHalf AdderHalf Subtractor
PurposeAdds two bitsSubtracts two bits
InputsA, BA, B
OutputsSum, CarryDifference, Borrow
Sum/DiffA ⊕ BA ⊕ B
Carry/BorrowA · B(¬A) · B

🎯 Key Points to Remember

  • Half Adder: Adds two bits — useful in basic addition units.
  • Half Subtractor: Subtracts two bits — useful in arithmetic circuits.
  • XOR Gate is used in both circuits for Sum and Difference.
  • Half Adder cannot add three bits (for that, we use Full Adder).
  • Half Subtractor cannot handle borrow from previous stage (for that, we use Full Subtractor).