This repository contains a Verilog implementation of a UART (Universal Asynchronous Receiver/Transmitter) module designed for serial communication. It supports 8-bit data transmission with a parity bit and a single stop bit. The default baud rate for transmission is set to 9600 bps.
- UART Receiver and Transmitter
- 8-bit data width
- Parity bit generation and checking
- Single start and stop bit handling
valid_outsignal indicates when received data is valid
clk: Clock signalrst: Asynchronous resetrx: Serial data inputtx_data[7:0]: Byte to be transmittedtx_enable: Enable signal for transmission
tx: Serial data outputrx_data[7:0]: Received data bytevalid_out: High when a valid byte has been received with correct paritydone: Transmission completion indicator (can be extended)
Both receiver and transmitter use a simple FSM (Finite State Machine) with the following states:
START: Start bit detection/transmissionDATA: 8-bit data reception/transmission more pair_bitSTOP: Stop bit reception/transmission
- The module calculates parity using XOR (
^) for even parity. - Reception begins on a falling edge (
rx == 0) indicating a start bit. - Transmission starts when
rx_enableis asserted.
- Add parameterization for baud rate to support multiple communication speeds.
- Include a parameter to enable or disable the parity bit.
- Add a parameter to select parity type (even or odd) when the parity bit is enabled.
- Introduce a parameter to configure the number of stop bits (1 or 2).
- Update the testbench to validate the new parameterized configurations.
- Verify synthesis compatibility for different parameter settings.
- Document the parameter usage and default values in the README.
This project is licensed under the MIT License.