Professional Documents
Culture Documents
Uart PDF
Uart PDF
Receiver/Transmitter
UART
Serial
Cable
Device
Serial
Cable
Phone
Line
Phone Modem
Serial Line
Cable
Modem
Phone
Line
Internet
Internet
Phone
Serial Line
Cable
Modem
Serial
Cables
Terminal Terminal
Terminal Terminal
• Outbound data
– Convert from parallel to serial
– Add start and stop delineators (bits)
– Add parity bit
• Inbound data
– Convert from serial to parallel
– Remove start and stop delineators (bits)
– Check and remove parity bit
mark
space
Time
1 bit time
Start Bit
7 Data Bits
Parity Bit
Stop Bit
Mark
1 1 1 0 1 0 1 0
Space
Line idling again
7 data bits – Least significant bit first
Mark
Space
Mark
Space
Mark
Space
• Baud Rate
– The “symbol rate” of the transmission system
– For a UART, same as the number of bits per
second (bps)
– Each bit is 1/(rate) seconds wide
• Example: Not the data
throughput rate!
– 9600 baud 9600 Hz
– 9600 bits per second (bps)
– Each bit is 1/(9600 Hz) ≈ 104.17 µs long
Specifications
• Parameters: 300 baud, 7 data bits, 1 stop bit, even or odd parity
• Inputs:
– Din[6:0]: 7-bit parallel data input
– Send: instructs transmitter to initiate a transmission
– ParitySelect: selects even parity (ParitySelect=0) or odd parity
(ParitySelect=1)
• Outputs:
– Dout: serial data output
– Busy: tells host busy sending a character
Send
Busy
UART Dout
ParitySelect Transmitter
Din To serial
7
cable
Send
Busy
Send
Count10
Transmitter Mod10
Increment
Busy State Counter
Machine ResetCounter
Shift
endmodule
This could also be written using behavior Verilog (an always block)
ParitySelect
Parity ParityBit
Din 7 Generator
• Combinational circuit
• Generates ParityBit according to value of
Din[6:0] and ParitySelect input
Din[0]
Odd/Even#
Din[1]
Din[2]
Din[3] ParityBit
Din[4]
Din[5]
Din[6] Will be ‘0’ if Din has
even number of 1’s,
Din[7] 0 if odd number.
Reduction XOR
operator
Shift Register
• When it resets:
– Have it load all 1’s so that its default output is a ‘1’ (line idle
value)
Idle Send
Load
Load Busy
Send’ Load ResetCounter
Shift
ResetTimer