This project implements a high-reliability UART Transceiver System in Verilog HDL, designed for FPGA target architectures. To overcome common serial communication failure modes in noisy hardware environments, the design incorporates:
- 16× Oversampling Noise Filter & Clock Recovery Engine: Eliminates clock skew and filters out high-frequency noise spikes on the RX line by sampling each bit period 16 times and taking center-majority decisions.
- Hamming (7,4) Single Error Correction (SEC) & Parity Engine: Automatically detects and corrects single-bit corruption errors in real-time without requiring retransmission.
Important
📥 Official Technical Project Report & Presentation Documentation:
- 📄 Complete Project Report (DOCX):
uart-hamming/reports/mini_project.docx(Comprehensive project document detailing RTL design, testbenches, mathematical error-correction theory, and Vivado synthesis results)
| Section # | Document Topic | Technical Content Highlighted |
|---|---|---|
| 01 | Introduction & Problem Statement | Overview of UART asynchronous transmission vulnerabilities in noisy industrial channels. |
| 02 | 16x Oversampling Architecture | Mathematical principle of mid-cycle sampling (ticks 7, 8, 9) for clock recovery and noise rejection. |
| 03 | Hamming (7,4) SEC Theory | Parity matrix generation, generator polynomials, and syndrome bit calculation ( |
| 04 | Verilog RTL Modules | Functional breakdown of baud_gen, oversample_gen_16x, hamming_encoder, uart_tx_hamming, uart_rx_hamming, and hamming_decoder. |
| 05 | Simulation Waveforms | Testbench setup, timing diagrams, and fault injection verification (ModelSim & Xilinx Vivado). |
| 06 | Hardware Synthesis & FPGA Results | Resource utilization (LUTs, Flip-Flops), maximum clock frequency ( |
graph LR
subgraph Transmitter Subsystem
DATA_IN[8-Bit Parallel Input] --> ENC[Hamming Encoder]
ENC -->|12-Bit Codeword| TX_FSM[UART TX FSM]
CLK[System Clock] --> BAUD[Baud Rate Generator]
BAUD -->|Baud Tick| TX_FSM
TX_FSM -->|Serial Line| TX_PIN[TX Pin]
end
subgraph Physical Channel
TX_PIN -->|Serial Channel / Noise| RX_PIN[RX Pin]
end
subgraph Receiver Subsystem
RX_PIN --> RX_FSM[UART RX FSM]
CLK --> OS[16x Oversampling Gen]
OS -->|Sample Tick| RX_FSM
RX_FSM -->|Received Codeword| DEC[Hamming Decoder]
DEC --> DATA_OUT[8-Bit Data Out]
DEC --> ERR_DET[Error Detected Flag]
DEC --> ERR_CORR[Error Corrected Flag]
end
| Module File | Description & Functionality |
|---|---|
uart_hamming_top.v |
Top-level integration module connecting Baud Generator, Oversampling Generator, Hamming Encoder/Decoder, and UART Transceiver modules. |
baud_gen.v |
Configurable frequency divider generating exact baud rate ticks (e.g. 9600 / 115200 bps from 50MHz/100MHz clock). |
oversample_gen_16x.v |
Generates a 16× frequency tick per bit period for precise mid-bit sampling. |
hamming_encoder.v |
Encodes 8-bit input data into two 4-bit nibbles, appending 3 parity bits ( |
uart_tx_hamming.v |
Finite State Machine (FSM) managing START bit, 12-bit Hamming payload transmission, and STOP bit. |
uart_rx_16x.v / uart_rx_hamming.v |
Finite State Machine (FSM) sampling RX line 16 times per bit cycle. Majority voting logic selects mid-cycle sample values (ticks 7, 8, 9) for high noise immunity. |
hamming_decoder.v |
Computes syndrome vector error_detected and error_corrected output signals. |
The Hamming (7,4) code encodes 4 data bits (
Upon reception, the decoder computes the syndrome bits:
- If
$S = [0, 0, 0]$ : No error detected. - If
$S \neq [0, 0, 0]$ : Syndrome value directly points to the corrupted bit index, which is inverted to restore exact data integrity.
UART_COM/
└── uart-hamming/
├── reports/
│ └── mini_project.docx # Official Project Technical Report & Documentation
├── src/
│ ├── uart_hamming_top.v # Top-Level Integration
│ ├── baud_gen.v # Baud Rate Generator
│ ├── oversample_gen_16x.v # 16x Oversampling Clock Generator
│ ├── hamming_encoder.v # (7,4) Hamming Encoder
│ ├── hamming_decoder.v # Hamming Decoder & SEC Error Corrector
│ ├── uart_tx_hamming.v # UART Transmitter FSM
│ ├── uart_rx_hamming.v # UART Receiver FSM
│ ├── uart_tx.v # Standard UART Transmitter
│ └── uart_rx_16x.v # 16x Oversample UART Receiver
├── simulation/ # Testbenches & Simulation Waveform Configs
└── images/ # RTL Schematics & Waveform Screenshots
- Open Vivado or ModelSim and create a new RTL project.
- Add all Verilog source files from
uart-hamming/src/. - Set
uart_hamming_top.vas the top module (or load testbench fromsimulation/). - Run Behavioral Simulation for
10 ms. - Observe waveforms:
- Verify
tx_pinserial data stream with 16x sampling ticks. - Force a 1-bit noise inversion on
tx_pinline. - Confirm
error_detectedanderror_correctedsignals toggle high, anddata_outmatches originaldata_in.
- Verify
Distributed under the MIT License.