This repository contains a Verilog implementation of a Combination Lock system using Finite State Machines (FSMs). The design includes modules for user input handling, state management, lock verification, and 7-segment display output.
- Implements a combination lock system.
- Uses FSM-based logic for controlling lock states.
- Seven-segment display interface for lock status.
- Supports reset and change functionality.
- Includes separate modules for modular design.
- Top-level module integrating all submodules.
- Connects user inputs (
b1,b2,x) with FSMs and displays.
- Implements a Moore finite state machine (FSM).
- Handles input processing for
enterandchangestates.
- Compares user-entered combination with the stored code.
- Outputs
matchsignal indicating success or failure.
- Manages the lock/unlock logic.
- Controls
open,alarm, andnewwstates based on user input.
- Drives a 7-segment display based on the lock status.
- Indicates whether the lock is open, incorrect, or ready for a new code.
This diagram represents a rough sketch of the finite state machine for input conditioning. The input w determines the state transitions, and the output z reflects the current state behavior.
- State A: Initial state,
z = 0. - State B: Transitioned when
w = 1,z = 1. - State C: Transitioned when
w = 0again.
This diagram illustrates the detailed state transitions of the combination lock system. Inputs include Enter, Change, and Match, while outputs include Open, New, and Alarm.
- State A: Default state where the lock is closed.
- State B: State for reset operations.
- State C: State where the lock is open.
- State D: Alarm state triggered by incorrect attempts.
- State E: New code entry state.
The following block diagram shows the high-level architecture of the combination lock system. Each module interacts to implement the required functionality:
- Moore FSMs: Handle input conditioning (
EnterandChange). - Comparison Module: Compares the entered code with the stored code.
- Lock Module: Manages lock states and outputs (
Open,Alarm,New). - Hex7seg Module: Drives the 7-segment display based on lock states.
Waleed Malik (waleedmalik027@gmail.com) Aadil Rehan (aadilrehan02@gmail.com)


