How jayjain2365/uart-transceiver-verilog works
This repository is a small RTL hardware design for a UART transceiver in Verilog. The architecture is centered on one datapath boundary: parallel byte data goes into a UART transmitter, is serialized onto a single wire, then a UART receiver reconstructs the byte back into parallel form.
The design is split into three RTL modules under rtl/:
• uart_tx.v: serializes outgoing 8-bit data into an 8N1 UART frame.
• uart_rx.v: detects and samples incoming serial data, then reconstructs the byte.
• uart_top.v: top-level integration wrapper that connects TX and RX for system-level use or loopback-style operation.
The transmitter subsystem is state-machine driven. Its internal flow is: wait for a start request, emit one start bit, shift out 8 data bits least-significant-bit first, emit one stop bit, then return to idle. This module is the source of the serial line and defines the outgoing framing boundary.
The receiver subsystem is also FSM-based. It watches the serial input for a start bit, samples the incoming bits in sequence, stores them in a shift register or equivalent internal staging, validates the stop bit, and raises a done/valid indication when a full byte has been received. This module is the sink of the serial line and defines the incoming framing boundary.
uart_top.v likely serves as the integration layer that wires the transmit and receive blocks together and exposes a clean interface for external use. In an architecture diagram, this is the module that separates “core UART behavior” from any board-level or system-level connectivity.
The protocol assumptions are fixed and important to the architecture: 8 data bits, no parity, 1 start bit, 1 stop bit. Data is transmitted LSB-first. The README also notes configurable baud rate and clock frequency, so timing is parameterized rather than hard-coded in the conceptual design.
Timing is driven by a system clock, with the UART bit period derived from the baud rate. At a 50 MHz clock and 9600 bps, the design depends on internal clock counting rather than an external baud clock. That makes the clock-to-bit-timing relationship a key architectural dependency.
The testbench in tb/uart_tb.v is the verification boundary. It performs loopback-style simulation to prove that bytes sent by the transmitter are recovered correctly by the receiver. In the diagram, this is the non-synthesizable verification layer around the RTL core, not part of the deployed hardware datapath.
The test cases in the README show the intended functional coverage: a mixed pattern, all zeros, and all ones. These validate bit ordering, framing, and the absence of stuck-at or polarity errors across the serialization/deserialization path.
There are no software runtimes, drivers, or external services involved. The project is entirely self-contained RTL plus simulation artifacts, with Xilinx Vivado used as the verification toolchain.
The screenshots/ directory contains waveform output from simulation. It is documentation of behavior rather than an active subsystem, but it confirms the verification-centric workflow of the repository.
A clean architecture diagram for this repo should show four layers: parallel input/control into TX, a serial UART wire between TX and RX, parallel output/control from RX, and a separate simulation/testbench harness wrapping the whole design for verification.
Main entry points: uart_tx.v TX · uart_rx.v RX · uart_tb.v UART testbench · uart_top.v UART top
Components 6
RTL core
Synthesis-oriented UART transmitter, receiver, and integration wrapper.
- UART top · Top-level RTL wrapper that connects the transmitter and receiver for system use or loopback-style operation.
rtl/uart_top.v - TX · FSM-based UART transmitter that frames and serializes 8-bit data as 8N1 LSB-first output.
rtl/uart_tx.v - RX · FSM-based UART receiver that detects the start bit, samples serial data, validates the stop bit, and reconstructs a byte.
rtl/uart_rx.v
Verification
Simulation testbench and supporting non-synthesizable checks.
- UART testbench · Loopback-style verification harness that stimulates the design and checks transmitted bytes are recovered correctly.
tb/uart_tb.v
Other components
- Serial line · Single-wire UART datapath boundary carrying framed serial data between TX and RX.
- Bit timing · Clock-counted timing relationship that derives UART bit periods from system clock and baud rate parameters.
Connections 9
- UART top → TX: instantiates · Top-level wrapper includes the transmit block.
- UART top → RX: instantiates · Top-level wrapper includes the receive block.
- TX → Serial line: serial out · Transmitter drives the external UART wire.
- Serial line → RX: serial in · Receiver consumes the framed serial stream.
- Bit timing → TX: ticks · Transmitter bit boundaries are derived from clock and baud parameters.
- Bit timing → RX: samples · Receiver sampling cadence depends on the same timing relationship.
- UART testbench → UART top: stimulates · Testbench wraps the integrated RTL for simulation.
- UART testbench → TX: checks tx · Verification observes transmitter behavior and framing.
- UART testbench → RX: checks rx · Verification confirms received bytes match the transmitted data.