A Verilog-based UART (Universal Asynchronous Receiver/Transmitter) design integrated with FIFO buffers to enable efficient and reliable serial communication between devices.
UART (Universal Asynchronous Receiver/Transmitter) is a hardware protocol for serial communication, transmitting and receiving data one bit at a time.
It is asynchronous, meaning the transmitter and receiver do not share a clock, but agree on a baud rate to interpret data correctly.
β Key Points:
- π Converts parallel data to serial and vice versa.
- π’ Uses start and stop bits for synchronization.
βοΈ Supports full-duplex communication.- π» Commonly used in microcontrollers, FPGAs, PCs, and peripherals.
- Why: β‘ Simple, cost-effective, and reliable for short distances.
- Where: π Communication between microcontrollers, FPGA boards, PCs, sensors, GPS modules, Bluetooth devices, ADCs, etc.
- π Receiver samples the incoming data 16 times per bit period.
- π― Detects the middle of each bit, reducing timing errors.
- π Example: For 9600 bps, the sampling clock runs at
9600 Γ 16 = 153600 Hz. - Process: Start bit detection β sample data bits at 16Γ rate β stop bit verification.
- π‘ Asynchronous serial communication.
βοΈ Full-duplex support.- βοΈ Configurable data frame of 5β8 data bits, parity, 1β2 stop bits (Here, 8 data bits, no parity, 1 stop bit)
- π Simple hardware implementation.
- β Reliable for short distances.
- π Configurable baud rate.
β οΈ Supports error detection.- π Widely supported in embedded systems.
- π₯ First-In-First-Out data handling.
- β³ Temporary data storage between producer and consumer.
- π Smooth operation in full-duplex systems.
- π Configurable depth and width.
- π¦ Status signals: full, almost full, empty, almost empty.
- π‘ Reduces data loss during bursts.
- β‘ Hardware-friendly design for FPGA/ASIC systems.
The serial transmission starts with a 'start bit' (0), followed by data bits (1 byte), and ends with a 'stop bit'.
π Transmission of a single byte:
Since the transfer is asynchronous, the receiver and transmitter must agree on baud rate, stop bits, and parity bit.
π Using 16Γ oversampling, the middle of the data bit is estimated for accuracy:
| Parameter | Value |
|---|---|
| Data Bits | 8 |
| Stop Bits | 1 |
| Parity | None |
| Oversampling | 16Γ |
| Baud Rate | 9600 |
βββ uart.v # Top-level UART module
βββ uart_tx.v # UART transmitter
βββ uart_rx.v # UART receiver
βββ fifo.v # FIFO buffer module
βββ uart_tb.v # UART testbench
βββ fifo_tb.v # FIFO testbench
βββ README.md # Project documentation
- uart.v β Integrates UART transmitter, receiver, and FIFO.
- uart_tx.v β Handles serial data transmission.
- uart_rx.v β Handles serial data reception.
- fifo.v β Manages data buffering between TX and RX.
- uart_tb.v & fifo_tb.v β Testbenches for simulation and verification.
- Simulator: ModelSim, Vivado Simulator, or any Verilog-compatible tool.
- FPGA Tool: Quartus, Vivado, or any synthesis tool for FPGA deployment.
- Compile all Verilog modules and testbenches.
- Load testbenches into the simulator.
- Run simulation and verify waveforms for correct data transfer.
π This project is licensed under the MIT License.
Contributions are welcome! π
If youβd like to improve this project (bug fixes, feature enhancements, documentation, etc.), follow these steps:
- π΄ Fork the repository.
- π± Create a new branch:
git checkout -b feature-name git commit -m "Add new feature or fix bug" git push origin feature-name












