Interview Question · Waveform
Drawing a UART Frame
- Likely at Google
- Likely at Analog Devices
The Question
The interviewer asks
The line idles high and runs 8N1. Draw the frame for 0xA5 on the wire and tell me how many bit-times it takes. Then add even parity.
8N1, one slot per bit-time; fill in the data bits for A5h.
idle | start | d0 d1 d2 d3 d4 d5 d6 d7 | stop | idle
1 | 0 | ? ? ? ? ? ? ? ? | 1 | 1
Where would an even-parity bit go?You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Idle is 1. The frame starts with a 0 start bit. Then come the eight data bits, least significant bit first, and a 1 stop bit. For A5h that is 0, then 1 0 1 0 0 1 0 1, then 1: ten bit-times. Even parity adds one bit before the stop bit, chosen so the count of 1s is even. A5h already has four 1s, so the parity bit is 0 and the frame takes eleven bit-times.
Read phases and sample points (transmitter half bit)
- start: columns 2 through 3.
- data 0: columns 4 through 5.
- data 1: columns 6 through 7.
- data 2: columns 8 through 9.
- data 3: columns 10 through 11.
- data 4: columns 12 through 13.
- data 5: columns 14 through 15.
- data 6: columns 16 through 17.
- data 7: columns 18 through 19.
- stop: columns 20 through 21.
- rx sampled at 4.688, 4.813, 4.938, 6.688, 6.813, 6.938, 8.688, 8.813, 8.938, 10.688, 10.813, 10.938, 12.688, 12.813, 12.938, 14.688, 14.813, 14.938, 16.688, 16.813, 16.938, 18.688, 18.813, 18.938, 20.688, 20.813, 20.938.
Generated and decoded back. A start bit, eight data bits least significant first, and a stop bit: 10 bit-times. Dots mark where a receiver samples.
Read phases and sample points (transmitter half bit)
- start: columns 2 through 3.
- data 0: columns 4 through 5.
- data 1: columns 6 through 7.
- data 2: columns 8 through 9.
- data 3: columns 10 through 11.
- data 4: columns 12 through 13.
- data 5: columns 14 through 15.
- data 6: columns 16 through 17.
- data 7: columns 18 through 19.
- even parity: columns 20 through 21.
- stop: columns 22 through 23.
- rx sampled at 4.688, 4.813, 4.938, 6.688, 6.813, 6.938, 8.688, 8.813, 8.938, 10.688, 10.813, 10.938, 12.688, 12.813, 12.938, 14.688, 14.813, 14.938, 16.688, 16.813, 16.938, 18.688, 18.813, 18.938, 20.688, 20.813, 20.938, 22.688, 22.813, 22.938.
Generated and decoded back. Even parity: the parity bit after data 7 is 0.
| Bit-time | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Field | start | d0 | d1 | d2 | d3 | d4 | d5 | d6 | d7 | parity | stop |
| 8E1, A5h | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 |
A5h is 1010 0101; bit 0 goes first. Drop the parity column for 8N1: ten bit-times.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Fresher)
A good fresher answer draws the start bit low, the data least significant bit first, and the stop bit high. It gets ten bit-times for 8N1 and the right bit order for A5h.
What Interviewers Listen For (Junior)
A good junior answer computes the parity bit and says 8E1 takes eleven bit-times. It explains that the stop bit makes sure the next start begins with a falling edge.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfProve ItCompare
- Drawing a UART Frame
-
WhyWhy Start and Stop BitsL0 Fresher
Why does a UART need a start bit and a stop bit at all?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
There is no clock wire, so the receiver needs one moment it agrees on with the transmitter. That moment is the high-to-low edge of the start bit. The receiver times every bit from that edge. The stop bit returns the line high. So the next frame always begins with a fresh falling edge, even when the last data bit was 0.
One Frame, Left to Right on the WireThe arrows are time order on the line. Parity is optional; the stop time is 1, 1.5 or 2 bit-times. Read the diagram as text
- Idle: line at 1
- Start bit: one 0
- Data bits: 5 to 8, bit 0 first
- Parity bit: optional: even or odd
- Stop time: 1, 1.5 or 2 bits of 1
- Idle or next start: a falling edge again
- Idle → Start bit
- Start bit → Data bits
- Data bits → Parity bit
- Parity bit → Stop time
- Stop time → Idle or next start
A name like 8N1 or 8E1 gives the data bits, the parity and the stop time. N means none, E even and O odd.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Fresher)
A good fresher answer names the falling edge of the start bit as the timing reference. It says the stop bit makes sure the next frame has that edge.
-
CompareThe Cost of No Clock WireL0 FresherL1 Junior
Compare UART with SPI. What does UART give up by not sending a clock?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
SPI sends the clock, so the receiver samples on an edge it is given, and the rate can change freely. A UART receiver must rebuild bit timing from the start edge and its own clock. So both ends must agree closely on the baud rate. Frames also carry start and stop overhead: 8N1 moves 8 data bits in 10 bit-times. The gain is fewer wires and no shared clock across a cable.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Fresher)
A good fresher answer names the two costs: both ends must agree on the baud rate, and every frame carries extra bits.
What Interviewers Listen For (Junior)
A good junior answer gives 80 % efficiency for 8N1. It links the allowed rate mismatch to the choice of oscillator.
-
What IfWhat Parity MissesL1 Junior
Asked if they add parity
Parity is on. Which corruptions does it catch, and which pass silently?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
It catches any odd number of flipped bits in the data and parity bits. It passes any even number. So a burst that flips two adjacent bits passes. Parity also says nothing about a lost or extra frame. Systems that care add a checksum or CRC at the packet level, above the UART.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer says parity catches an odd number of flipped bits but misses an even number. It says a CRC is needed above the UART.
-
WhyWhy Parity Misses Two Flipped BitsL0 FresherL1 Junior
Why does parity miss exactly the corruptions that flip an even number of bits?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Parity stores one fact: whether the count of ones is even or odd. Flipping one bit changes that count by one, so the parity no longer matches. Flipping two bits changes the count by two or by zero, so it still matches. Any even number of flips cancels the same way.
Self-Check
Tick each key point you covered in your answer.
Half-Truth
"Parity detects any corrupted byte."
It detects only an odd number of flipped bits. Two flips in one frame pass.
Source Lesson P6.2 key points
-
Prove ItSolve P6.2.1: Encode a UART FrameSimulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
What People Get Wrong
Common wrong answers and why they fail.
Misconception
"The most significant bit goes first, like SPI."
A UART sends bit 0 first. If the transmitter and receiver disagree on order, every byte comes out reversed. The P6.2 bench sent 55h MSB first, and the receiver decoded AAh.
Source ASIC Point lesson P6.2 (measured): 55h sent MSB first decodes as AAh, 33h as CCh
Misconception
"With parity on, any corrupted byte is caught."
Parity detects only an odd number of flipped bits. Two flips leave the count of 1s unchanged. The P6.2 bench sent A5h, and a corrupted A6h still passed even parity.
Source ASIC Point lesson P6.2 (measured): A6h passes even parity when A5h was sent
Half-Truth
"The receiver checks both stop bits of an 8N2 frame."
The receiver checks only the first stop bit. The second is idle time that the transmitter promises. It helps only when frames run back to back.