Skip to content

Repository files navigation

4-Bit Binary Subtractor Using Logic Gates

A 4-bit binary subtractor designed and implemented using logic gates in Logisim.

Overview

This project implements a 4-bit binary subtractor using four cascaded Full Subtractors in a ripple-borrow configuration.

The circuit takes two 4-bit binary inputs and produces:

  • A 4-bit difference
  • A final borrow output

Tools Used

  • Logisim 2.7.1
  • Digital logic gates

Circuit Architecture

Each Full Subtractor is constructed using:

  • Two Half Subtractors
  • One OR gate

Four Full Subtractors are then cascaded. The borrow output from each stage is connected to the borrow input of the next higher-order stage.

Full Subtractor Equations

Difference:

D = A XOR B XOR Bin

Borrow output:

Bout = B1 OR B2

where:

  • B1 = NOT(A) AND B
  • B2 = NOT(D1) AND Bin

4-Bit Borrow Propagation

The borrow propagates as follows:

Bin0 → FS0 → FS1 → FS2 → FS3 → Bout

The initial borrow input is set to 0.

Inputs and Outputs

Inputs

  • A[3:0]
  • B[3:0]
  • Initial borrow input = 0

Outputs

  • D[3:0]
  • Bout

For unsigned subtraction, a final borrow of 1 indicates that A is smaller than B.

Testing

A B Expected Difference Expected Bout
0101 0011 0010 0
0101 0101 0000 0
0111 0010 0101 0
0011 0101 1110 1
0000 0001 1111 1
0000 0000 0000 0

Files

  • 4-Bit_Binary_Subtractor.circ — Editable Logisim circuit
  • circuit.png — Final circuit diagram
  • truth-tables.png — Half and Full Subtractor truth tables
  • testing-results.png — Testing documentation
  • project-report.pdf — Project report

Learning Outcomes

Through this project, I strengthened my understanding of:

  • Logic gates
  • Boolean expressions
  • Half and Full Subtractors
  • Binary arithmetic
  • Ripple-borrow propagation
  • Digital circuit simulation
  • Circuit testing and debugging

Author

Deep Das
B.Tech ECE Student at Delhi Technological University (DTU)

LinkedIn Profile

About

A 4-bit binary subtractor designed and implemented using logic gates in Logisim.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors