UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
Digital Circuit Design
Vasileios Evangelos Athanasiou
Student ID: 19390005
Supervisor: Athanasios Milidonis, Postdoctoral Researcher
Athens, May 2023
The project focuses on modeling, simulating, and verifying sequential logic circuits using VHDL.
Each circuit is implemented using a clear architectural style and is accompanied by a testbench to validate its behavior under different timing and control conditions.
| Section | Folder / File | Description |
|---|---|---|
| 1 | assign/ |
Laboratory assignment material |
| 1.1 | assign/Lab4a_UniWA-BSc-DSD_VHDL#2a.pdf |
Laboratory exercise description (English) |
| 1.2 | assign/Εργαστήριο4α_ΠΑΔΑ-ΣΨΣ_VHDL.pdf |
Laboratory exercise description (Greek) |
| 2 | docs/ |
Theoretical documentation on sequential circuits |
| 2.1 | docs/Sequential-Circuits.txt |
Sequential circuits theory and explanations (English) |
| 2.2 | docs/Ακολουθιακά-Κυκλώματα.txt |
Sequential circuits theory and explanations (Greek) |
| 3 | src/ |
VHDL source code and testbenches |
| 3.1 | src/latch.vhd |
Latch implementation |
| 3.2 | src/latch_tb.vhd |
Latch testbench |
| 3.3 | src/flipflop.vhd |
Flip-Flop implementation |
| 3.4 | src/flipflop_tb.vhd |
Flip-Flop testbench |
| 3.5 | src/myRegister.vhd |
Register implementation |
| 3.6 | src/myRegister_tb.vhd |
Register testbench |
| 3.7 | src/shift4.vhd |
4-bit Shift Register |
| 3.8 | src/shift4_tb.vhd |
4-bit Shift Register testbench |
| 3.9 | src/shiftn.vhd |
N-bit Shift Register |
| 3.10 | src/shiftn_tb.vhd |
N-bit Shift Register testbench |
| 3.11 | src/upcount.vhd |
Up Counter implementation |
| 3.12 | src/upcount_tb.vhd |
Up Counter testbench |
| 4 | README.md |
Repository overview and usage instructions |
A basic D-latch where the output Q follows the input D when the Enable (EN) signal is high ('1').
When EN is low ('0'), the output retains its previous value.
A standard D Flip-Flop that transfers the value of input D to output Q only on the rising edge (0 → 1 transition) of the clock signal (CLK).
A D Flip-Flop featuring an asynchronous active-low reset (Rstn).
When Rstn = '0', the output Q is immediately forced to '0', independent of the clock or data inputs.
A 4-bit register implemented using flip-flops with a clear (clr) input.
It supports:
- Parallel data loading
- Clearing of all bits on the rising edge of the clock
A small synchronous up-counter that increments its value from 0 to 3 on each rising clock edge.
A synchronous reset returns the counter to 0.
A 4-bit shift register with serial input (Sin).
When the Enable signal is active, bits are shifted serially through the register on each clock pulse.
A generic N-bit shift register (default: 8-bit) supporting:
- Serial shifting
- Parallel data loading
Parallel loading is activated when the Load signal is high, allowing all bits to be loaded simultaneously.
All circuits are verified using testbenches that stimulate:
- Clock behavior
- Reset and control signals
- Data transitions
Waveform analysis ensures correct sequential behavior and timing compliance.
This repository contains VHDL implementations of fundamental digital logic circuits along with testbenches for functional verification using ModelSim Altera Starter Edition.
The project is intended for digital circuit design education and laboratory exercises.
Supported platforms:
- Windows (recommended – best ModelSim support)
- Linux
- macOS (may require legacy or alternative simulators)
This project was developed and verified using:
- ModelSim Altera Starter Edition
- Provided by Intel FPGA (formerly Altera)
Capabilities used:
- VHDL-2008 compatible simulation
- Waveform visualization
- Testbench execution
Note: Newer systems may use ModelSim Intel FPGA Edition or Questa Intel FPGA Starter as replacements.
For editing and reviewing VHDL files:
- Visual Studio Code + VHDL extension
- Notepad++
- Vim / Emacs
- ModelSim built-in editor
To understand and modify the project, basic knowledge of:
- Digital logic design
- VHDL syntax and semantics
- Dataflow architecture
- Testbench-driven verification
- Combinational circuits (adders, multiplexers, decoders)
is recommended.
Using Git:
git clone https://github.com/Digital-Circuit-Design/Sequential-Circuits.git- Open the repository URL in your browser
- Click Code → Download ZIP
- Extract the ZIP file to a local directory
- Download ModelSim Altera Starter Edition (or Intel FPGA equivalent)
- Complete installation following vendor instructions
- Verify installation by launching ModelSim successfully
- Open ModelSim
- Select File → New → Project
- Set:
- Project Name (e.g.
VHDL_Lab) - Project Location (your cloned repository path)
- Project Name (e.g.
- Choose Create Project
- In the Add Items to Project window:
- Select Add Existing File
- Navigate to the
src/directory - Add:
- All
*.vhdfiles (designs and testbenches)
- All
- Finish project creation
- In the Project tab:
- Select Compile → Compile All
- Ensure:
- No syntax errors
- Successful compilation messages in the transcript
- In the simulation window:
- Add signals to the waveform
- Run simulation:
run -all- Verify:
- Correct logical behavior
- Expected outputs for each test case
- Navigate to the
docs/directory - Open the report corresponding to your preferred language:
- English:
Sequential-Circuits.txt - Greek:
Ακολουθιακά-Κυκλώματα.txt
- English:
