Final project for Introductory Laboratory for Electrical and Electronic Engineering course
ModelSim to code and time simulation
Quartus II to debug and upload to the FPGA board
Desgin Specifications
Switch Interface
Takes 12 switch signal inputs and passes them to the State Machine block, PassWD block, and 7SegmentDriver block.
Converts to synchronous signals using a synchronizer (since the Switch input is Async).
Implementing an edge detector in the switchinterface block.
State Machine
The status of the digital door lock using the switch signal input and the information provided by the PassWD block to drive the machine.
The status of the digital door lock is categorized into "standby mode", "password input mode" and "password setting mode".
Determine the "locked" and "unlocked" status according to the lock status.
Password
Store a 6-digit password (initial password is "123456")
-(initial password is "123456")
In "Password Setting Mode", you can change the set password according to the switch input and save it.
-(The default password is "123456")
"Password input mode" compares the entered 6-digit password with the stored password and provides the state machine with a matching result.
7 Segment Driver
Display the 6-digit password that the user enters in "Password Setting Mode" or "Password Entry Mode".
Display the state (current mode) of the digital door lock according to the information provided by the state machine.
LED Driver
Eight LEDs indicate the lock's locked status.
When the status of the lock changes, the 8 LEDs turn ON or OFF sequentially, one by one, at 0.1 second intervals.
laboratory equipment and parts
Windows XP or higher PC
Model-Sim and QuartusII software
FPGA Lab Kit (HiveDigCom32)
FPGA download cable (USB Blaster or compatible)
Design result test items
a) Initial state
- 7 Segments are all OFF.
- All 8 LEDs are ON (door locked).
- The initial password stored internally is initialized to "123456".
b) SW'A' input
- Only the center segment (hyphen) is ON for all 7 segments, indicating "password input mode".
c) Enter initial password ("123456")
- As the initial password is entered, the number entered from the left 7 segment is displayed.
d) Enter SW'A'
- All 8 LEDs turn off sequentially in 0.1 second increments to indicate that the door is open.
- All 7 segments turn off and switch to "standby mode".
e) Enter SW'B'
- ON only the bottom segment (_) in all 7Segments to show that it is in "password setting mode"
f) Enter SW'0'~'9'
- Displays the number entered from the left 7Segment as you enter a combination of 6 out of 10 numbers.
g) Enter SW'B'
- The number '8' flashes twice at 0.5 second intervals in all 7Segments, then OFF.
- Change the password stored internally to the entered 6 numbers
h) Enter SW'A'
- All 8 LEDs will turn ON sequentially in 0.1 second increments and turn ON to change to the locked state.
State diagram
You can see details from my github!