Skip to content

AMRYB/4221-to-Seven-Segment-Decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

4221-to-Seven-Segment Decoder

📘 Project Overview

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


🎯 Objective

  • 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.

⚙️ Components 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)

🔢 Input Encoding (Custom 4-bit Code)

⚠️ 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

🔌 Circuit Diagram

  • 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.

Circuit Diagram


🧑‍💻 Authors & Contributors

Team Leader:

  • Amr Yasser

Team Members:

  • Youssef Mahmoud
  • Youssef El-Sayed
  • Mohamed Harith
  • Mohamed Zaky
  • Mohamed Ali

About

4221-to-Seven-Segment Decoder for Logic Design course — A combinational circuit converting custom 4-bit binary inputs into signals to drive a common-cathode 7-segment display, using basic logic gates (NOT, AND, OR).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors