This project implements a Digital Safe‑Lock System using SystemVerilog, designed to authenticate a 4‑bit security code using a combination of:
- AXI‑style Parallel‑to‑Serial (P2S) data conversion
- Finite State Machines (FSMs) — both Mealy and Moore versions
- Bit‑by‑bit verification logic
- Unlock/Incorrect signaling
The system ensures secure access by serializing the 4‑bit passcode and validating each bit through a state machine.
Only when the full sequence matches the predefined code (1011) does the safe unlock.
This project demonstrates strong digital design skills, including RTL design, FSM modeling, modular architecture, and simulation‑based verification.
The safe‑lock system consists of three main components:
- Accepts a 4‑bit parallel input
- Converts it into a serial bitstream using a shift‑register mechanism
- Follows an AXI‑style handshake (
par_valid,par_ready,ser_valid,ser_ready) - Outputs one bit per clock cycle
Two versions are implemented:
-
Output depends only on the current state
-
Moves through states as each serial bit arrives
-
Generates:
output_validoutput(correct/incorrect)
-
Output depends on state + input
-
Responds faster to incorrect bits
-
Immediately flags incorrect sequences
Both FSMs:
- Validate the 4‑bit sequence
1011 - Stop checking further bits once an incorrect bit is detected
- Produce:
- Unlock signal (correct code)
- Incorrect signal (wrong code)
The top module connects:
- P2S converter
- FSM (Mealy or Moore)
It performs:
- Parallel input → serialized bitstream
- Bit‑by‑bit verification
- Unlock decision
Each module includes a dedicated testbench:
- Tested with 10 different 4‑bit inputs
- Verified correct serialization order
- Tested with valid and invalid sequences
- Verified state transitions and output behavior
- Full system simulation
- Validates correct unlock behavior
- Ensures incorrect sequences are rejected immediately
/Digital-Safe-Lock
│
├── p2s_converter.sv
├── p2s_converter_tb.sv
│
├── mealy_fsm.sv
├── moore_fsm.sv
├── fsm_tb.sv
│
├── top_module.sv
├── top_module_tb.sv
- SystemVerilog
- EDA Playground (simulation)
- Visual Studio Code (development)


