This project implements a combinational logic circuit that converts a custom 4-bit binary code (based on a 4221-like scheme) into signals that drive a 7-segment display to represent decimal digits from 0 to 9.
The decoder generates the correct segment signals (a–g) to visually display the number on a common cathode 7-segment display, based on DIP switch input.
You can view and simulate the full circuit on Tinkercad here:
🔗 Tinkercad Project Link
- Convert a 4-bit custom binary code input to drive the appropriate segments of a 7-segment display.
- Display numbers from 0 to 9.
- Use only basic logic gates (NOT, AND, OR).
- No microcontrollers or programmable components were used.
| Component | Quantity | Notes |
|---|---|---|
| DIP Switch SPST x 4 | 1 | Manual input for 4-bit binary |
| Hex Inverter (7404) | 1 | Used for logic inversion |
| Quad AND Gate (7408) | 2 | Used in output logic |
| Quad OR Gate (7432) | 4 | Used to generate segment control signals |
| 7-Segment Display (Cathode) | 1 | Displays numbers from 0 to 9 |
| 1 kΩ Resistors | 7 | Current limiting for each segment (a–g) |
| 9V Battery | 1 | Power source in real circuit |
| Coin Cell (3V) | 1 | Used in Tinkercad simulation (not in real) |
⚠️ Note:
The truth table used in this project is a custom design that differs from the standard 4221 code.
It was revised multiple times and finalized with the approval of TA Abdullah to suit our circuit design logic.
Check truth_table.md for the final encoding used.
| Decimal Digit | Binary Code |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 1000 |
| 5 | 0111 |
| 6 | 0100 |
| 7 | 0101 |
| 8 | 0110 |
| 9 | 1111 |
- Inputs are given through a 4-bit DIP switch.
- Outputs a–g are activated based on simplified logic expressions using basic gates.
- Remaining 4-bit binary combinations are considered Don't Care in logic minimization.
Team Leader:
- Amr Yasser
Team Members:
- Youssef Mahmoud
- Youssef El-Sayed
- Mohamed Harith
- Mohamed Zaky
- Mohamed Ali
