Half subtractor

Comprehensive study notes, diagrams, and exam preparation for Half subtractor.

Half Subtractor

Definition

A half subtractor is a combinational logic circuit that subtracts one binary digit from another and produces two outputs:

Difference (D)

  • : the result of subtraction

Borrow (B)

  • : indicates whether a borrow is needed from the next higher bit

For inputs A and B, the half subtractor computes:

Difference = A − B

Borrow = 1

  • when A < B

It is called a half subtractor because it can subtract only two single bits and does not accept a previous borrow input from a lower stage.


Main Content

1. Basic Concept of Half Subtractor

  • A half subtractor is used for single-bit subtraction in binary number systems.
  • It compares two input bits and gives the subtraction result in the form of difference and borrow.

The two input variables are usually:

A

  • = minuend bit

B

  • = subtrahend bit

The outputs are:

D

  • = Difference

Borrow

  • = Borrow output

The subtraction cases are:

A B A − B Difference Borrow
0 0 0 0 0
0 1 -1 1 1
1 0 1 1 0
1 1 0 0 0

In binary subtraction:

0 − 0 = 0

1 − 0 = 1

1 − 1 = 0

0 − 1 = 1 with borrow 1

This shows that the half subtractor is essential for handling the case where the minuend is smaller than the subtrahend.

2. Truth Table and Boolean Expressions

  • The truth table is the simplest way to represent the operation of a half subtractor.
  • From the truth table, we can derive the Boolean expressions for difference and borrow.

Truth Table

A B Difference (D) Borrow (Borrow)
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0

Boolean Expression for Difference

The difference output is 1 when the inputs are different, which is exactly the behavior of the XOR gate:

D = A ⊕ B

Boolean Expression for Borrow

The borrow output is 1 only when:

  • A = 0
  • B = 1

This can be written as:

Borrow = A'B

where:

A'

  • means NOT A

B

  • means B

So the two main equations are:

Difference = A ⊕ B

Borrow = A'B

These expressions are very important because they allow the half subtractor to be implemented using basic logic gates.

3. Logic Circuit Implementation

  • A half subtractor can be built using an XOR gate and an AND gate with one NOT gate.
  • The design is compact and efficient, making it useful in digital systems.

Gate-level realization

  1. The inputs A and B are applied to an XOR gate to generate the difference.
  2. The input A is passed through a NOT gate.
  3. The inverted A' and input B are applied to an AND gate to generate the borrow.

ASCII circuit view

A ─────┬───────────────┐
       │               │
       │            ┌───▼───┐
       │            │ XOR   │─── D (Difference)
       │            └───▲───┘
       │               │
B ─────┴───────────────┘


A ────► NOT ────┐
                │
B ─────────────►┼───► AND ──── Borrow
                │
                └────────────

This circuit shows that:

  • the XOR gate detects whether the bits are different,
  • the AND with NOT detects the case where borrowing is required.

A half subtractor is a combinational circuit, so its output depends only on the current inputs and not on any stored previous state.


Working / Process

1. Apply the two input bits

  • Feed the binary bits A and B into the half subtractor.
  • These represent the bit being subtracted from and the bit being subtracted.

2. Generate the difference

  • The XOR gate compares both inputs.
  • If the inputs are the same, the output difference is 0.
  • If the inputs are different, the output difference is 1.

3. Generate the borrow

  • The NOT gate inverts A.
  • The AND gate checks whether A is 0 and B is 1.
  • If yes, borrow becomes 1; otherwise, it remains 0.

Example 1: A = 1, B = 0

  • Difference = 1 ⊕ 0 = 1
  • Borrow = 1' · 0 = 0 · 0 = 0

So the output is:

D = 1

Borrow = 0

Example 2: A = 0, B = 1

  • Difference = 0 ⊕ 1 = 1
  • Borrow = 0' · 1 = 1 · 1 = 1

So the output is:

D = 1

Borrow = 1

This means the circuit has produced the correct subtraction result by indicating a borrow.

Example 3: A = 1, B = 1

  • Difference = 1 ⊕ 1 = 0
  • Borrow = 1' · 1 = 0 · 1 = 0

So the output is:

D = 0

Borrow = 0

This is because subtracting equal bits gives zero without borrow.


Advantages / Applications

Simple and compact design

  • Uses only a few basic logic gates, making it easy to implement in hardware.

Foundation for larger subtractors

  • It is used as a building block in the design of full subtractors and multi-bit subtraction circuits.

Useful in arithmetic logic units

  • Half subtractors are part of digital systems where binary subtraction is required, such as calculators, processors, and control units.

Helps in understanding binary arithmetic

  • It is an important educational circuit for learning how subtraction and borrowing work in binary logic.

Efficient in small digital circuits

  • Since it handles only one bit, it is ideal for simple operations and introductory digital designs.

Summary

  • A half subtractor subtracts one binary bit from another and produces difference and borrow outputs.
  • Its logic is based on XOR for difference and A'B for borrow.
  • It is a combinational circuit used as a basic building block in digital subtraction systems.
  • Important terms to remember: half subtractor, difference, borrow, XOR gate, combinational logic