completeRTL Logic & FSM Synthesis

VHDL Digital Systems & FPGA Logic Design

Modular digital logic and FPGA hardware description library in IEEE VHDL: multi-floor elevator FSM, request queue, arithmetic units, clock divider, and 7-segment decoder verified in Quartus and ModelSim.

  • VHDL
  • FPGA
  • Quartus
  • ModelSim
  • FSM
  • Digital Systems
VHDL Digital Systems & FPGA Logic Design

Project Overview

A modular digital logic and FPGA hardware description library written in IEEE VHDL, developed for the Digital Systems Design module at the University of Brighton (First Class 84% / A+).

The repository implements synchronous finite state machines (FSMs), floor request queueing, combinational arithmetic blocks (2-bit multiplier, 4-bit subtractor, 4-bit magnitude comparator, 1-bit full adder), clock dividers, and seven-segment display decoders synthesised in Quartus and verified through timing simulations in ModelSim.


Physical FPGA Hardware Testbed

The multi-floor elevator controller was synthesised onto an Intel DE0-Nano (Cyclone) FPGA and tested on a physical bench harness with floor call buttons, an emergency stop input, and LED indicators for floor position and door state.


ModelSim Timing Simulation & Verification

Before loading onto hardware, the digital architecture underwent functional and timing simulation in ModelSim to verify clock-edge behaviour, floor call handling, door sequencing, and emergency stop interlocks:

ModelSim Timing Waveform Verification Matrix Figure 1: ModelSim waveform trace illustrating clock alignment, floor call processing, door sequencing, and state register transitions.


Architecture Specifications: Multi-Floor Elevator Controller

Subsystem Module Entity File Description Key Signals
Main Lift Controller Lift.vhd Top-level lift FSM managing floor calls, travel direction, door LED states, and emergency stop interlock. clk_in, slow_clk, emergency, outside_lift_buttons, inside_lift_buttons, lift_leds, door_leds
Request Queue Queue.vhd Request latching and floor scheduling logic. Floor request inputs and target selection
Door Controller doors_but_better.vhd Timed door cycle logic with safety pause/retract behaviour. Door sensor, timer, and door state outputs
Clock Divider clock_div1.vhd Integer clock prescaler dividing the 50 MHz FPGA clock for visible state transitions. clk_in, divided clock output
Display Decoder bin2hex.vhd 4-bit binary to active-low 7-segment hex character decoder. 4-bit binary input, 7-segment output

IEEE VHDL Implementation Excerpt

Excerpt from elevator_fsm/Lift.vhd showing the top-level entity ports, 50 MHz clock divider process, and floor/emergency control logic:

entity Lift is
    generic (
        clock_divider : integer := 50000000
    );
    port (
        clk_in               : in    std_logic;
        slow_clk             : inout std_logic;
        emergency            : in    std_logic;
        door_leds            : inout std_logic_vector(2 downto 0);
        lift_leds            : inout std_logic_vector(3 downto 0);
        outside_lift_buttons : inout std_logic_vector(5 downto 0);
        inside_lift_buttons  : inout std_logic_vector(3 downto 0)
    );
end entity Lift;

-- Clock division process generating slow_clk from 50 MHz FPGA input
process (clk_in)
    variable count : integer range 0 to clock_divider;
begin
    if rising_edge(clk_in) then
        count := count + 1;
        if count < clock_divider / 2 then
            slow_clk <= '0';
        elsif count < clock_divider then
            slow_clk <= '1';
        else
            count := 0;
        end if;
    end if;
end process;

Arithmetic & Sequential Building Blocks

Alongside the elevator controller, the repository includes synthesisable digital logic building blocks:

1. Original RTL by Harry Rogers

  • bitMultip.vhd: Combinational 2-bit binary multiplier array.
  • Comp4.vhd: 4-bit unsigned magnitude comparator (A > B, A = B, A < B).
  • Sub4.vhd: 4-bit binary subtractor.
  • full_adder_vhdl_code.vhd: Structural 1-bit full adder with carry propagation.
  • bin2hex.vhd: 4-bit binary to 7-segment hex display decoder.
  • clock_div1.vhd: Synchronous integer clock frequency prescaler.

2. University Coursework Reference Modules (Designed by Chris Knight)

  • Adder_Sub.vhd: Selectable ripple-carry adder/subtractor provided as laboratory reference material.
  • Counter.vhd & CounterTB.vhd: Synchronous up/down counter reference implementation.
  • ShiftReg1.vhd: 4-bit shift register reference implementation.

Source Code & Academic Attribution

  • GitHub Repository: HarryRogers073/vhdl-digital-systems
  • Author: Harry Rogers (University of Brighton)
  • Coursework Context: Digital Systems Design (First Class 84%, A+)
  • Synthesis & Simulation: Intel Quartus II / Quartus Prime, ModelSim-Intel FPGA
  • Hardware Target: Intel DE0-Nano (Altera/Intel Cyclone FPGA)