Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

"DESIGN& IMPLEMENTATION OFUNIVERSAL

ASYNCHRONOUS RECEIVER TRANSMITTER USING


VERILOG"____________________________________________________
_________

A
MINOR PROJECT REPORT
SUBMITTED IN PARTIAL FULFILMENT OF
THE REQUIREMENTS FOR THE AWARD OF THE DEGREE
OF
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
TO

MJP ROHILKHAND UNIVERSITY BAREILLY


BY
Naman Soni (212099020186)
Titiksha Sharma (212099020048)
Sonpal (212099020257)

UNDER
THE SUPERVISION OF
Dr.Manish Rai
Professor
Electronics And Communication Engineering

2023
UNDERTAKING

We hereby declare that We, Naman Soni(20EC37), Titiksha Sharma(20EC59),


Sonpal(20EC56), have completed the project work on the title “DESIGN &
IMPLEMENTATION OFUNIVERSALASYNCHRONOUS
RECEIVERTRANSMITTER USING VERILOG” under the supervision ofDr.
Manish Rai, for the degree of Bachelor of Technology, MJP Rohilkhand
University, Bareilly, Uttar Pradesh.
This is our own work & we have not copied it from anywhere.

Date:
Place: Bareilly

ii
CERTIFICATE FROM THE GUIDE

This is to certify that project work embodied in this report entitled “DESIGN &
IMPLEMENTATION OF UNIVERSAL ASYNCHRONOUS RECEIVER
TRANSMITTER USING VERILOG”submitted to MJP Rohilkhand University
Bareilly Uttar Pradesh, for the award of the degree of B.Tech (Electronics and
communication Engineering) has been carried out by Naman Soni, Titiksha
Sharma and Sonpal under my supervision.

Date :-

Dr. Manish Rai


Professor
Electronics And Communication Engineering

iii
ACKNOWLEDGEMENT

We would like to take this opportunity to express our deep sense of gratitude,
appreciation and indebtedness express Dr. Manish Rai for his perseverance,
excellence guidance, constant encouragement and cooperation which led to the
completion of this project. Without his constant appraisal and effort, this task
would never been successful. Dr.Manish Rai has always guided us with his
helping hands.He provided us with all necessary resources and guided us in
many of important concept used in this project .We would also like to thanks
our project coordinator Dr. Janak Kapoor sir and all respected Institute members
of Electronics & Communication Department. We wish to thank fellow
colleagues and family for their guidance and ideas which gave us
encouragement and hope whenever we had a problem in our project.

iv
CONTENTS

 Undertaking
 Certificate from guide
 Acknowledgement

CHAPTER 1: Introduction to UART

 Introduction
 Basics of serial communication
 Historical evolution of UART
 Synchronous and asynchronous transmission
 Applications

CHAPTER 2:UART Architecture

 UART Architecture
 Functionality of transmitter and receiver circuits
 Transmitter Circuit Functionality
 Receiver Circuit Functionality

CHAPTER 3: UART Communication Protocol

 Data Transmission
 Steps of UART Transmission

CHAPTER 4:BASICS OF VERILOG

 Introduction of VLSI
 Operators used in Verilog

CHAPTER 6:Conclusion & Future Work

 Conclusion
 Future Work

REFERENCES

v
CHAPTER 1: Introduction to UART

1.1Introduction

UART (Universal Asynchronous Receiver/Transmitter) is a crucial serial


communication protocol facilitating data exchange between electronic devices.
Comprising a transmitter and receiver, UART converts parallel data into serial
format for transmission and reverses the process at the receiving end. Defined
by baud rate, it operates asynchronously, not relying on a shared clock signal.
Start and stop bits frame data, ensuring synchronization. Commonly used in
microcontrollers, embedded systems, and diverse electronic applications,
UART's simplicity, reliability, and asynchronous nature make it a staple for
various devices, enabling seamless communication in industrial automation, PC
peripherals, and wireless modules.

Basics of serial communication:

Serial communication is a foundational method for transmitting data between


electronic devices. Unlike parallel communication, where multiple bits travel
simultaneously on separate lines, serial communication sends data sequentially
over a single channel. This sequential approach simplifies hardware
requirements and is well-suited for various applications.

There are two primary types of serial communication: asynchronous and


synchronous. Asynchronous communication, commonly associated with UART
(Universal Asynchronous Receiver/Transmitter) protocols, employs start and
stop bits to frame data. Devices operating at different speeds can communicate
effectively, as synchronization occurs through these start and stop bits rather
than a shared clock signal.

Synchronous communication, on the other hand, utilizes a shared clock signal to


synchronize data transmission between devices. Protocols like SPI (Serial
Peripheral Interface) and I2C (Inter-Integrated Circuit) fall under synchronous
communication. The synchronized timing ensures that both the transmitting and
receiving devices are in harmony, enhancing reliability in data transfer.

1
In both types of serial communication, the fundamental components include a
transmitter, which formats and sends data, and a receiver, which captures and
processes the data. The baud rate, expressed in bits per second (bps), determines
the speed of data transmission and must be consistent between communicating
devices.

Serial communication is ubiquitous in various applications. In microcontroller


systems, it enables communication between the microcontroller and peripheral
devices. Serial ports on computers use UART for connecting peripherals like
mice, keyboards, and printers. Additionally, it plays a crucial role in
communication between sensors, actuators, and controllers in industrial
automation. The simplicity, efficiency, and versatility of serial communication
make it a cornerstone in modern electronic systems.

1.2Historical evolution of UART:

The historical evolution of UART (Universal Asynchronous


Receiver/Transmitter) traces back to the early days of computer and
telecommunications development. In the mid-20th century, as computing
systems emerged, the need for efficient data transfer between devices became
apparent. Early communication interfaces often relied on parallel
communication, where multiple data bits moved simultaneously. However, the
complexity of parallel communication led to the exploration of simpler, serial
communication methods.

The concept of serial communication predates UART, finding roots in


telegraphy and early telecommunication systems. The advent of teletypes and
teleprinters introduced serial transmission using asynchronous communication,
where start and stop bits framed each character for synchronization. This
concept laid the groundwork for the asynchronous serial communication that
UART would later adopt.

The term "UART" itself became prominent as microcontrollers and integrated


circuits proliferated in the 1970s and 1980s. UARTs were designed to facilitate
serial communication in these systems, providing a standardized interface for
transmitting and receiving data. The flexibility of UART, particularly its
asynchronous nature, contributed to its widespread adoption.

2
As technology advanced, UART implementations evolved to support higher
data transfer rates and accommodate the increasing complexity of electronic
systems. The integration of UART into communication protocols, such as RS-
232, further expanded its utility, making it a standard for inter-device
communication.

Today, UART remains a critical component in embedded systems,


microcontrollers, and various electronic devices. While newer communication
protocols exist, the historical evolution of UART reflects its resilience and
adaptability, ensuring its continued relevance in modern electronic
communication.

1.3Synchronous and asynchronous transmission:

Synchronous and asynchronous transmissions are two fundamental methods of


data transfer in communication systems, each with its own characteristics,
advantages, and applications.

Synchronous Transmission:

In synchronous transmission, data is sent in a continuous stream with a shared


clock signal between the sender and receiver. The clock signal ensures that both
the transmitting and receiving devices are synchronized and operate at the same
speed. This synchronous timing allows for efficient and organized data transfer.
Protocols like SPI (Serial Peripheral Interface) and I2C (Inter-Integrated
Circuit) commonly use synchronous transmission.

One significant advantage of synchronous transmission is its high data transfer


rate. The shared clock signal eliminates the need for start and stop bits, reducing
overhead and maximizing the use of available bandwidth. However, the
downside is that both devices must be tightly synchronized, and any deviation
in the clock can result in data errors.

Asynchronous Transmission:

Asynchronous transmission, on the other hand, does not rely on a shared clock
signal. Instead, it uses start and stop bits to frame each unit of data (usually a
byte). These bits help the receiver identify the beginning and end of each byte,

3
allowing for communication between devices with slightly different clock
speeds. UART (Universal Asynchronous Receiver/Transmitter) is a common
example of asynchronous transmission.

One major advantage of asynchronous transmission is its flexibility. Devices


with varying clock speeds can communicate successfully, making it suitable for
applications where precise synchronization is challenging. However, the
additional start and stop bits introduce overhead, reducing the effective data
transfer rate compared to synchronous transmission.

Applications:

Synchronous Transmission:

• Ideal for high-speed communication where devices can maintain tight


synchronization.

• Commonly used in applications like high-speed data transfer between


integrated circuits and components on a computer motherboard.

Asynchronous Transmission:

• Suitable for applications where devices may operate at different speeds.

• Widely used in UART communication for microcontrollers, serial ports


on computers, and various embedded systems.

4
CHAPTER 2: UART Architecture

2.1UART Architecture

The architecture of a UART (Universal Asynchronous Receiver/Transmitter)


involves both hardware and software components working together to facilitate
serial communication between devices. Here's an overview of the key elements
in the architecture of a UART:

Fig : 2.1 Block Diagram of UART

Transmitter:

The UART transmitter is responsible for formatting and sending data. It takes
parallel data from the data bus and converts it into a serial format. The
transmitter typically includes a shift register, which serializes the parallel data,
and a control logic block to manage the transmission process.

Receiver:

The UART receiver, located on the receiving device, performs the reverse
process. It takes the incoming serial data, converts it into parallel form, and
makes it available on the data bus. The receiver includes a shift register and
control logic to manage the reception process.

5
Baud Rate Generator:

The baud rate generator determines the speed of data transmission by generating
the clock pulses (baud rate) required for the serial communication. Both the
transmitter and receiver must be configured with the same baud rate for
successful communication.

Fig 2.2 Baud Rate Generator

FIFO Buffers (Optional):

First In, First Out (FIFO) buffers may be included in the UART architecture to
store incoming and outgoing data temporarily. This helps manage data flow
between the UART and the rest of the system, preventing data loss during
transmission or reception.

Control Logic:

The control logic oversees the overall operation of the UART. It manages the
flow of data, controls the start and stop bits, and coordinates the handshaking
process if flow control is employed. It ensures synchronization between the
transmitting and receiving devices.

Registers:

UARTs typically have a set of registers to store configuration settings, status


flags, and data. These registers can include a configuration register to set
parameters like data frame format, parity, and stop bits, as well as status
registers to indicate the current state of the transmitter and receiver.

6
Interrupts (Optional):

UARTs may support interrupts to notify the microcontroller or processor when


specific events occur, such as the completion of data transmission or the
reception of new data. Interrupts enhance the efficiency of the communication
process.

Understanding the architecture of a UART is essential for configuring and


interfacing with these modules in embedded systems, microcontrollers, and
other electronic devices. The components work together to ensure reliable and
efficient serial communication between devices.

Functionality of transmitter and receiver circuits.

The functionality of the transmitter and receiver circuits in a UART (Universal


Asynchronous Receiver/Transmitter) system is essential for the successful
exchange of serial data between electronic devices. Let's delve into the roles and
operations of both components:

2.2Transmitter Circuit Functionality:


Data Formatting:

The transmitter receives parallel data from the system's data bus. It is
responsible for formatting this parallel data into a serial format for transmission.
This includes converting the data into a bitstream and appending start and stop
bits.

Start and Stop Bits:

The transmitter adds start and stop bits to each data byte. The start bit signals
the beginning of a data byte, and the stop bit(s) indicate the end. These bits help
the receiver identify the boundaries of the transmitted data and synchronize with
the incoming bitstream.

7
Parallel-to-Serial Conversion:

The parallel data is then shifted out serially, typically using a shift register. The
shift register serializes the data, sending it bit by bit over the communication
line.

Baud Rate Generation:

The transmitter circuit generates clock pulses, determining the baud rate at
which the serial data is transmitted. Both the transmitter and receiver must
operate at the same baud rate for successful communication.

Control Logic:

The control logic oversees the entire transmission process, ensuring proper
timing, managing the start and stop bits, and coordinating with other
components like FIFO buffers if present.

2.3Receiver Circuit Functionality:


Serial-to-Parallel Conversion:

The receiver circuit receives the serial data and performs the reverse process of
the transmitter. It converts the incoming serial bitstream into parallel data.

Start and Stop Bit Detection:

The receiver identifies the start and stop bits to determine the boundaries of
each data byte. It synchronizes with the incoming data based on these framing
bits.

8
Parallel Data Output:

Once a complete byte is received, the parallel data is made available on the
system's data bus for further processing by the connected microcontroller or
other components.

Baud Rate Synchronization:

The receiver's baud rate generator ensures that it operates at the same baud rate
as the transmitter, maintaining synchronization during data reception.

Error Detection and Handling (Optional):

The receiver may incorporate error-detection mechanisms, such as parity


checking, to identify and handle transmission errors. If an error is detected,
appropriate actions are taken to address or report the issue.

Control Logic:

Similar to the transmitter, the receiver's control logic oversees the reception
process, managing the flow of incoming data, handling start and stop bits, and
coordinating with other components.

Understanding the distinct functionalities of the transmitter and receiver circuits


is crucial for configuring and utilizing UART communication effectively in
electronic systems. These circuits work in tandem to ensure accurate and
reliable serial data transfer between devices.

9
CHAPTER 3: UART Communication Protocol

The transmitting UART is connected to a controlling data bus that sends data in
a parallel form. From this, the data will now be transmitted on the transmission
line (wire) serially, bit by bit, to the receiving UART. This, in turn, will convert
the serial data into parallel for the receiving device.

The UART lines serve as the communication medium to transmit and receive
one data to another. Take note that a UART device has a transmit and receive
pin dedicated for either transmitting or receiving.

For UART and most serial communications, the baud rate needs to be set the
same on both the transmitting and receiving device. The baud rate is the rate at
which information is transferred to a communication channel. In the serial port
context, the set baud rate will serve as the maximum number of bits per second
to be transferred.

Data Transmission

In UART, the mode of transmission is in the form of a packet. The piece that
connects the transmitter and receiver includes the creation of serial packets and
controls those physical hardware lines. A packet consists of a start bit, data
frame, a parity bit, and stop bits.

Start Bit

The UART data transmission line is normally held at a high voltage level when
it’s not transmitting data. To start the transfer of data, the transmitting UART
pulls the transmission line from high to low for one (1) clock cycle. When the
receiving UART detects the high to low voltage transition, it begins reading the
bits in the data frame at the frequency of the baud rate.

Fig:1.3 Start Bit

10
Data Frame

The data frame contains the actual data being transferred. It can be five (5) bits
up to eight (8) bits long if a parity bit is used. If no parity bit is used, the data
frame can be nine (9) bits long. In most cases, the data is sent with the least
significant bit first

Fig:1.4 Data Frame

Parity

Parity describes the evenness or oddness of a number. The parity bit is a way for
the receiving UART to tell if any data has changed during transmission. Bits
can be changed by electromagnetic radiation, mismatched baud rates, or long-
distance data transfers.

After the receiving UART reads the data frame, it counts the number of bits
with a value of 1 and checks if the total is an even or odd number. If the parity
bit is a 0 (even parity), the 1 or logic-high bit in the data frame should total to an
even number. If the parity bit is a 1 (odd parity), the 1 bit or logic highs in the
data frame should total to an odd number.

When the parity bit matches the data, the UART knows that the transmission
was free of errors. But if the parity bit is a 0, and the total is odd, or the parity
bit is a 1, and the total is even, the UART knows that bits in the data frame have
changed.

Fig:1.4 Parity bits

11
Stop Bits

To signal the end of the data packet, the sending UART drives the data
transmission line from a low voltage to a high voltage for one (1) to two (2)
bit(s) duration.

Fig:1.5 Stop bits

3.1Steps of UART Transmission:

1. The transmitting UART receives data in parallel from the data bus:

Fig: 3.1 Data bus to Tx UART

2. The transmitting UART adds the start bit, parity bit, and the stop bit(s) to the

data frame.

Fig:3.2 Tx UART

12
3. The entire packet is sent serially from the transmitting UART to the receiving
UART. The receiving UART samples the data line at the pre-configured baud
rate:

Fig:3.3 data transmitted bit by bit

4. The receiving UART discards the start bit, parity bit, and stop bit from the
data frame:

Fig:3.4 Rx UART

5. The receiving UART converts the serial data back into parallel and transfers
it to the data bus on the receiving end:

Fig: Rx UART to data bus

13
SIMULATION WAVEFORM:
CHAPTER 4: BASICS OF VERILOG

4.1Introduction to VLSI

Very-large-scale integration (VLSI) is the process of creating an integrated


circuit (IC) by combining thousands of transistors into a single chip.The goal of
VLSI is to pack a large number of transistors and other electronic components
into a small area, enabling the creation of powerful and compact electronic
systems.

Here's an introduction to some key aspects of VLSI:

1. Integrated Circuits (ICs): VLSI is concerned with the development of


integrated circuits, which are chips that contain multiple electronic
components such as transistors, resistors, capacitors, and interconnections
on a single piece of semiconductor material. These components work
together to perform specific functions like computation, signal
processing, or memory storage.

14

2. Transistor Scaling: One of the driving forces behind VLSI is the


constant miniaturization of transistors. Transistors are the fundamental
building blocks of electronic circuits, and as technology advances, the
size of transistors decreases. This trend, often described by Moore's Law,
has led to an exponential increase in the number of transistors that can be
integrated onto a chip.

3. Design Processes: VLSI design involves several stages, including


specification, design entry, logic synthesis, and physical design. During
these stages, engineers use specialized tools to design the functionality of
the chip, optimize its performance, and lay out the physical arrangement
of components on the semiconductor substrate.

4. Fabrication Technology: VLSI fabrication involves the manufacturing


of integrated circuits. This process includes photolithography, etching,
deposition, and other techniques to create the various layers and
structures on the semiconductor material. The fabrication process is
highly sophisticated and requires cleanroom environments to prevent
contamination.

5. Application Areas: VLSI technology finds applications in a wide range


of electronic devices, from simple consumer electronics to complex
computing systems. It plays a crucial role in the development of
microprocessors, memory devices, digital signal processors, and other
components used in computers, smartphones, communication devices,
and many other electronic systems.

6. Challenges: As the scale of integration increases, new challenges arise,


including power consumption, heat dissipation, and signal integrity.
Addressing these challenges requires innovative design techniques,
materials, and manufacturing processes.

VLSI technology has been a driving force behind the rapid advancement of the
electronics industry, enabling the creation of more powerful and energy-
efficient devices. The field continues to evolve as researchers and engineers
explore new ways to push the limits of semiconductor technology.\

15

4.2Operators used in Verilog:

1. Arithmetic Operators:
Arithmetic operators are used to perform basic math calculations. They
perform a specific operation on two numeric values and return a single
numeric value.

Expression Operator used Operation performed

a+b + Add

a–b – Subtract

a*b * Multiply

a/b / Divide

Modulus(the remainder is given as


a%b %
result)
a ** b ** Power(exponent)

2. Logical Operators:
Logical operators perform a logical operation on the logical value of the
operands and tell you whether it is true or false, i.e., it returns a boolean
value.

Expression Operator Operation Description

Logical – The result will be 1 (true ) if A and


A && B &&
and B are true

The result will be true if either A or


A || B || Logical – or
B is true

Logical Will convert to zero if A is non-


!A !
negation zero or 1 A is zero or false value

16

3. Reduction Operators:
This operand is useful for converting a multi-bit vector into a single bit
scalar value. It performs bit by bit logical operation on the vector operand
and returns a boolean value.

For example,

&(1011) = 1 & 0 & 1 & 1 = 0 // reduction and of 1011

Expression Operator Description

Performs bitwise AND


&A &
operation on A

Performs bitwise OR
|A |
operation on A
Performs bitwise XOR
^A ^
operation on A

4. Relational operators:

If we want to check the relation between the given operands, then we use
relational operators. Relational operators test the relation between operands and
return a 1 or 0.

Expression Operator Description

a>b < (greater than) Returns 1 if a is greater than b

a<b < (less than) Returns 1 if a is less than b

<= (less than or equal Returns 1 if a is either less than or


a<=b
to) equal to b

a>=b >= (greater than or Returns 1 if a is either >=b


17
CHAPTER5:Conclusion &Future Work

5.1Conclusion:

In this project, UART is designed with configurable baud rates.


The language used in this reliable serial data communication is
Verilog .The Transmitter and Receiver module of the UART are
designed using finite state machine concept and successfully
synthesized using EDA playground . The UART with different baud
rates is successfully simulated and has being verified on XilinxViva do
. The design is compatible for high speed due different baud rates.Each
& every component is simulated individually. All the components and
UART shows good results. Waveforms are shown in the report, which
shows correct results.

5.2Future Scope of UART:

Some general trends and potential future directions for UART technology:

1. Higher Data Rates: There is a continuous demand for higher data


transfer rates in communication systems. Future developments may focus
on enhancing UART to support even higher baud rates, enabling faster
data exchange between devices.

2. Integration with Emerging Technologies: As new technologies like 5G,


Internet of Things (IoT), and Industry 4.0 continue to evolve, UART may
find integration with these systems to facilitate communication between
devices in smart environments.

3. Low-Power Implementations: With a growing emphasis on energy


efficiency and battery life in electronic devices, future UART
implementations might focus on minimizing power consumption. Low-
power UART variants may become more prevalent, especially in
applications where energy efficiency is critical.

18
4. Advanced Error Handling and Correction: Future UART
implementations may include more sophisticated error detection and
correction mechanisms. This could improve the reliability of data
transfer, especially in environments with high noise or interference.

5. Security Enhancements: As security becomes an increasingly important


consideration in electronic communication, future UART
implementations may incorporate features or protocols to enhance the
security of data transmitted over serial links.

6. Compatibility with New Protocols: The integration of UART with new


communication protocols or standards may occur. This could be driven
by industry-specific requirements or the need to interface with evolving
technologies.

7. Software-Defined UART: Advances in software-defined technologies


may lead to more flexible and configurable UART implementations. This
could allow for dynamic reconfiguration of UART parameters without
requiring hardware changes.

8. Enhanced Integration with Microcontrollers and SoCs: Future


developments in microcontroller and System-on-Chip (SoC) technologies
may influence how UART is integrated into these systems. Increased
integration and support for advanced features may be a focus.

19
REFERENCES:

[1] https://www.watelectronics.com/basics-of-uart-communication

[2] Basics of UART Communication.” Electronics Hub, July 2017.

[3] Campbell, Scott. “Basics of UART Communication.” Circuit Basics.


Keim, Robert.

[4] “Back to Basics: The Universal Asynchronous Receiver/ Transmitter.”

[5] “What Is UART Protocol? UART Communication Explained.” Arrow.

[6] https://www.researchgate.net/publication/308988751_Universal_Asynchr
onous_Receiver_and_Transmitter_UART

20

You might also like