# jayjain2365/uart-transceiver-verilog architecture

> Architecture diagram of the GitHub repository jayjain2365/uart-transceiver-verilog, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jayjain2365/uart-transceiver-verilog
- Repository: https://github.com/jayjain2365/uart-transceiver-verilog

## Overview

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: [`rtl/uart_tx.v`](https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_tx.v) (TX), [`rtl/uart_rx.v`](https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_rx.v) (RX), [`tb/uart_tb.v`](https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/tb/uart_tb.v) (UART testbench), [`rtl/uart_top.v`](https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_top.v) (UART top)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rtl["RTL core"]
  node_uart_top["UART top<br/>integration wrapper<br/>[uart_top.v]"]
  node_uart_tx["TX<br/>uart transmitter<br/>[uart_tx.v]"]
  node_uart_rx["RX<br/>uart receiver<br/>[uart_rx.v]"]
end

subgraph group_verification["Verification"]
  node_uart_tb["UART testbench<br/>simulation harness<br/>[uart_tb.v]"]
end

node_serial_wire(("Serial line<br/>uart link"))
node_baud_timing{{"Bit timing<br/>clock-derived timing"}}

node_uart_top -->|"instantiates"| node_uart_tx
node_uart_top -->|"instantiates"| node_uart_rx
node_uart_tx -->|"serial out"| node_serial_wire
node_serial_wire -->|"serial in"| node_uart_rx
node_baud_timing -->|"ticks"| node_uart_tx
node_baud_timing -->|"samples"| node_uart_rx
node_uart_tb -->|"stimulates"| node_uart_top
node_uart_tb -.->|"checks tx"| node_uart_tx
node_uart_tb -.->|"checks rx"| node_uart_rx

click node_uart_top "https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_top.v"
click node_uart_tx "https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_tx.v"
click node_uart_rx "https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_rx.v"
click node_uart_tb "https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/tb/uart_tb.v"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_uart_top,node_uart_tx,node_uart_rx toneBlue
class node_uart_tb toneAmber
class node_serial_wire,node_baud_timing toneNeutral
```

## Components

### RTL core

Synthesis-oriented UART transmitter, receiver, and integration wrapper.

- [UART top](https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_top.v): integration wrapper · Top-level RTL wrapper that connects the transmitter and receiver for system use or loopback-style operation. · `rtl/uart_top.v`
- [TX](https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_tx.v): uart transmitter · FSM-based UART transmitter that frames and serializes 8-bit data as 8N1 LSB-first output. · `rtl/uart_tx.v`
- [RX](https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/rtl/uart_rx.v): uart receiver · 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](https://github.com/jayjain2365/uart-transceiver-verilog/blob/main/tb/uart_tb.v): simulation harness · Loopback-style verification harness that stimulates the design and checks transmitted bytes are recovered correctly. · `tb/uart_tb.v`

### Other components

- **Serial line**: uart link · Single-wire UART datapath boundary carrying framed serial data between TX and RX.
- **Bit timing**: clock-derived timing · Clock-counted timing relationship that derives UART bit periods from system clock and baud rate parameters.

## Connections

- 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.
