Completed P-05 Verilog I²C LCD UART

Interactive FPGA Adder

Digital Design Project PA-StarLite · Artix-7 XC7A200T AMD Vivado 2025.2 · Verilog HDL

An interactive, hardware-level 4-bit accumulator deployed on the Artix-7 FPGA. Built entirely in synthesizable Verilog HDL, the system incorporates physical button de-bouncing, a 3-state FSM orchestrating data entry and calculation, a custom dynamic I²C LCD driver for a 16×2 character display, and a UART telemetry transmitter that logs every keypress and bus transaction to a host console.

74.28
MHz Sys Clock (MMCM)
3
FSM Control States
115k
UART Baud Rate
+8.3 ns
Timing WNS
Target DevicePA-StarLite · Artix-7 XC7A200T (215 K LUTs · 740 DSPs)
ToolchainAMD Vivado 2025.2 (Verilog HDL)
Clock System200 MHz differential input → 74.28 MHz via MMCME2_BASE PLL
Display InterfaceCustom Verilog I²C master → 16×2 character LCD (dynamic frame driver)
Telemetry OutputUART TX at 115,200 baud with a formatted keypress and bus-event log
Reset ModesActive-low hardware reset pin + simultaneous dual-button soft-reset
Operand / Result Width4-bit inputs (0–15), 8-bit result (0–30)

Live Demonstration

Physical buttons drive a 3-state Verilog FSM. The 16×2 LCD updates in real time over I²C and every input event is logged as a formatted string through the UART port.

PA-StarLite · Artix-7 XC7A200T · 74.28 MHz system clock

Three-State Operation

The hardware FSM cycles through three states triggered entirely by physical button presses, requiring no software or CPU.

S0
Num 1 Entry Mode Button 1 increments the first operand (0–15). LCD row 1 shows "Num 1: X". Button 2 locks the value and advances state.
S1
Num 2 Entry Mode Button 1 increments the second operand. Button 2 computes the sum and transitions to the result state.
S2
Result Display Mode LCD shows "X + Y = Z" on row 1 and "Result: Z" on row 2. UART logs the equation. Button 2 resets all registers to zero.
RST
Dual-Button Soft Reset Holding both keys simultaneously triggers an instant register and display reset from any state, removing the need for a hardware reset pin.

System Architecture

The top-level module top_adder.v coordinates the full hardware pipeline. The 200 MHz board differential clock is routed through an IBUFDS buffer and synthesized to 74.28 MHz by the MMCME2_BASE PLL. This clock drives all downstream logic simultaneously: the debouncers, FSM, I²C driver, and UART transmitter all run as independent concurrent hardware blocks.

Hardware system architecture showing the module hierarchy from MMCM through debouncer, FSM, I²C driver, and UART transmitter
RTL system architecture where all modules share the 74.28 MHz MMCM output and operate concurrently.

Verilog State Machine

A single synchronous always @(posedge clk_pix) block drives all three states. ASCII conversions for the LCD character map are computed combinatorially as wire assignments, so the display buffer always reflects the current register values with zero latency.

FSM state transition flowchart for the 3-state FPGA adder
FSM state transition flowchart showing the three primary states with a soft-reset path reachable from any state by simultaneously pressing both buttons.
// ── Soft-reset: hold both buttons simultaneously ───────────
wire soft_reset = (key1 == 1'b0) && (key2 == 1'b0);
wire sys_rst    = !pll_locked || !sys_rst_n || soft_reset;

// ── 3-State accumulator FSM ─────────────────────────────────
always @(posedge clk_pix) begin
  if (sys_rst) begin
    current_state <= 0;
    num1 <= 0;  num2 <= 0;  result <= 0;
    trigger_update <= 0;
  end else begin
    trigger_update <= 0;
    trigger_log    <= 0;

    case (current_state)
      // State 0: Enter Num 1
      0: begin
        if (key1_pressed) begin
          num1           <= num1 + 1;
          trigger_update <= 1;
          trigger_log    <= 1;    // UART: "Num 1: X\r\n"
        end
        if (key2_pressed) begin
          current_state  <= 1;
          num2           <= 0;
          trigger_update <= 1;
        end
      end

      // State 1: Enter Num 2
      1: begin
        if (key1_pressed) begin
          num2           <= num2 + 1;
          trigger_update <= 1;
          trigger_log    <= 1;    // UART: "Num 2: Y\r\n"
        end
        if (key2_pressed) begin
          current_state  <= 2;
          result         <= num1 + num2;
          trigger_update <= 1;
        end
      end

      // State 2: Show result, wait for reset
      2: begin
        if (key2_pressed) begin
          current_state  <= 0;
          num1 <= 0;  num2 <= 0;  result <= 0;
          trigger_update <= 1;
        end
      end
    endcase
  end
end

Hardware & Results

The design maps cleanly to the Artix-7 fabric. Vivado's timing analyzer confirms complete timing closure with WNS = +8.365 ns against the 74.28 MHz system clock, providing a comfortable margin. The UART telemetry FSM runs a parallel 29-state sequencer that formats register values, I²C debug data, and acknowledgment bits into human-readable strings logged over the serial console.

PA-StarLite FPGA board connected to the I2C LCD module via jumper wires
Physical setup: PA-StarLite (Artix-7 XC7A200T) driving a 16×2 character LCD via a custom Verilog I²C master.
FPGA board connection diagram for I2C LCD
Board connection diagram showing the PA-StarLite header pin mapping to the I²C LCD module (SCL, SDA, VCC, GND).

Synthesis Results

Post-synthesis outputs from AMD Vivado 2025.2 show the RTL schematic, on-chip power breakdown, and FPGA floor plan layout for the top-level top_adder design on the Artix-7 XC7A200T.

RTL Schematic

The Vivado-generated post-synthesis schematic shows the full netlist, including LUT primitives, carry chains, flip-flops, and I/O buffers mapped from the Verilog source hierarchy.

Post-synthesis RTL schematic from AMD Vivado
Post-synthesis RTL schematic showing the LUT4/6 primitives and carry-chain routing mapped by Vivado.

On-Chip Power Consumption

Total estimated on-chip power is 0.291 W. The MMCM dominates dynamic power at 95% (0.144 W), which is expected since the PLL is always active. Logic, signals, and clocks combined consume under 5 mW, confirming the design is extremely resource-efficient.

On-chip power consumption breakdown from Vivado Power Analysis
On-chip power: 0.152 W dynamic (52%) + 0.139 W device static (48%). MMCM accounts for 95% of dynamic power.

FPGA Floor Plan Layout

The Vivado device floor plan shows the physical placement of synthesized logic across the Artix-7 fabric. The design occupies a compact cluster in the upper-left CLB columns, highlighting how few resources the accumulator actually consumes relative to the 215K LUT capacity of the XC7A200T.

FPGA floor plan layout showing physical placement on Artix-7 fabric
Physical floor plan, where placed logic clusters (cyan/green) occupy a small region of the Artix-7 device.

Implementation Summary

MetricValue
System Clock74.28 MHz (synthesized via MMCME2_BASE, timing closure achieved)
Worst Negative SlackWNS = +8.365 ns (no violations)
Display ProtocolCustom Verilog I²C master, dynamic 32-character frame writes
UART Sequencer29-state parallel FSM that formats and transmits human-readable log strings
Reset ArchitectureHardware reset pin + simultaneous dual-key soft-reset from any state
Bitstreamtop_adder.bit generated by Vivado 2025.2 and loaded via a TCL script

Resource Utilization

ResourceUsedAvailable (XC7A200T)Utilization
LUT525134,6000.39 %
Flip-Flop (FF)324269,2000.12 %
BRAM03650 %
URAM00—
DSP07400 %
← Domain FPGA & Reconfigurable Computing Related → CNN Digit Detector