A 4-bit binary subtractor designed and implemented using logic gates in Logisim.
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
- Logisim 2.7.1
- Digital logic gates
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.
Difference:
D = A XOR B XOR Bin
Borrow output:
Bout = B1 OR B2
where:
- B1 = NOT(A) AND B
- B2 = NOT(D1) AND Bin
The borrow propagates as follows:
Bin0 → FS0 → FS1 → FS2 → FS3 → Bout
The initial borrow input is set to 0.
- A[3:0]
- B[3:0]
- Initial borrow input = 0
- D[3:0]
- Bout
For unsigned subtraction, a final borrow of 1 indicates that A is smaller than B.
| 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 |
4-Bit_Binary_Subtractor.circ— Editable Logisim circuitcircuit.png— Final circuit diagramtruth-tables.png— Half and Full Subtractor truth tablestesting-results.png— Testing documentationproject-report.pdf— Project report
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
Deep Das
B.Tech ECE Student at Delhi Technological University (DTU)