Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • How to Read the Diagrams
  • Part 0: What Is a Protocol?10
  • Part 1: Timing and Clocking11
  • Part 2: Encoding and Framing12
  • Part 3: Handshakes13
  • Part 4: Flow Control17
  • Part 5: Transactions19
  • Part 6: Concurrency and Performance17
  • Part 7: Ordering13
  • Part 8: Sharing and Arbitration12
  • Part 9: Deadlock and Liveness13
  • Part 10: Reliability and Recovery20
  • Part 11: Bring-Up and Link Management10
  • Part 12: Power8
  • Part 13: Shared State and Coherence9
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
    • How to Dissect a Protocol
    • UART
    • SPI
    • I2C
    • APB
    • AHB
    • AXI4
    • AXI-Stream
    • PCI Express
    • DDR
    • CHI
    • Ethernet
    • USB
    • UCIe
    • CXL
    • Protocols Compared: Protocols Dissected
    • Drills: Protocols Dissected
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 16: Protocols Dissected
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 16: Protocols Dissected
  4. UART

Part 16 · Protocols Dissected · Foundation (F)

UART

UART dissected through the twenty questions: no clock, no handshake and no flow control in the frame, a start bit to find the timing and a stop bit to find the end. Why something so minimal still works, and what it leaves to the system.

On this page

    Note

    Level: Foundation (F) · Answers: How do real protocols answer the fifteen questions?

    Before this: How to Dissect a Protocol, Asynchronous Serial and Oversampling

    A debug console on a development board prints boot messages over two wires. No clock travels between the chips, no acknowledgement comes back, and nobody negotiated anything. Both ends were simply set to the same speed and format, and that is enough to carry text for decades. UART is what a protocol looks like when almost every question is answered with "nothing, by agreement in advance".

    How does UART answer each question, and why does so little suffice?

    Constraints first: what UART had to work with

    Constraint

    UART

    C1 Distance and medium

    Short: a board or a short cable

    C2 Bandwidth and latency

    Low: typically kilobits to a few megabits per second

    C3 Wires

    Two signals (transmit and receive) plus ground

    C4 Topology

    Point-to-point, full duplex (one line each way)

    C5 Who builds each side

    Anyone; there is no single standard, only common conventions (fact S12)

    The falling edge of the start bit is the only timing reference: the receiver samples every later bit relative to it, so the two clocks only need to agree for one frame.

    UART's answers to the fifteen questions

    Each answer links to the lesson that explains the idea behind it.

    #

    Question

    Answer

    1

    When is the data valid?

    No clock is sent; both ends use the same agreed baud rate, and the receiver oversamples and re-aligns on each start bit, so clock error only has to stay small over one frame (1.2)

    2

    Where does a message start and end?

    A start bit (0) begins each character and a stop bit (1) ends it; the line idles at 1 between frames (2.2)

    3

    Is the receiver ready?

    None: the transmitter sends whenever it likes, a valid-only stream (3.1)

    4

    How much may I send before I hear back?

    None in the frame; systems add RTS/CTS lines or XON/XOFF characters, both on/off flow control (fact S21) (4.2)

    5

    What exactly is being asked?

    None: a UART moves bytes, and their meaning belongs to a higher layer (0.8)

    6

    How many requests can be in flight?

    One character at a time in each direction; the receiver typically buffers a few in a FIFO (6.1)

    7

    In what order do results become visible?

    Characters arrive in the order sent on a single wire, with nothing to reorder them (7.1)

    8

    Who gets the wire?

    Nothing to share: each line has one transmitter (point-to-point) (8.1)

    9

    Why can it hang?

    Nothing waits for anything, so nothing can deadlock; the price is that a receiver too slow to keep up loses characters (overrun) (9.2)

    10

    What if bits go wrong?

    Optional parity detects a single flipped bit; a low stop bit is a framing error; there is no correction or retry (10.2)

    11

    How do the two sides agree at start-up?

    No negotiation: both ends must be configured with the same baud rate, data bits, parity and stop bits beforehand (11.5)

    12

    How do we save power without losing data?

    Not addressed by the protocol; the line simply idles high

    13

    What if there are several copies of one value?

    Not applicable: there is no shared memory

    14

    Who is allowed to ask?

    Not addressed: anyone with physical access can listen or send

    15

    How do we know it is correct?

    No compliance programme; tests check frame formats, receiver tolerance to baud-rate mismatch, and overrun and framing-error handling (15.6)

    The choices that define UART

    • Timing from the data: the start bit's edge resynchronises the receiver every character, so cheap, independent clocks are enough (lesson 1.2).

    • Everything else by prior agreement: speed, format and even flow control are configuration, not protocol.

    • Errors detected at best: parity and framing errors are reported to software; nothing is resent.

    What breaks

    A board (illustrative) ran its UART at 115,200 baud from a clock that was 4% off after a cheap oscillator was substituted. Short messages worked; longer bursts showed corrupted characters whenever the receiver's sampling point drifted past the middle of the last data bits. With the oscillator back within about 2%, the drift over one frame stayed inside the bit and the errors disappeared. UART tolerates clock error only because each frame is short.

    Why this matters

    Senior lens. UART shows how much a protocol can leave to configuration when both ends are set up by the same people and the data rate is low. The moment either assumption fails (unknown partners, high rates, lossless delivery), each "nothing" in the table turns into a mechanism, which is what the rest of this part shows.

    Interview

    Asked: "How does a UART receiver know when to sample each bit without a clock?"

    Weak answer: It uses the transmitter's clock.

    Strong answer: Both sides agree on the baud rate in advance. The receiver watches for the falling edge of the start bit, then samples each following bit near its middle, using a local clock usually running at 16 times the baud rate to place the sample. Because it re-aligns on every start bit, the two clocks only need to agree closely enough over one frame of about ten bits, typically within a couple of percent. Parity can flag a single-bit error and a low stop bit flags a framing error, but nothing is retried.

    Follow-ups: (1) Why does UART tolerate clock error at all? (2) What happens if the receiver cannot keep up?

    Check yourself Why does a UART need a start bit if the line already idles high?

    The start bit's falling edge is the timing reference for the whole frame; without it the receiver cannot tell when a character begins.

    Check yourself Name two things UART leaves to the system.

    Any two of: flow control, error recovery, configuration agreement, the meaning of the bytes.

    Key takeaways

    • UART needs no clock: each start bit re-aligns the receiver, so clocks only need to agree over one frame.

    • Handshake, flow control, negotiation and retry are all left to configuration or the system.

    • It works because rates are low, partners are configured together and lost characters are tolerable.

    Keep going

    Next: Lesson 16.3, SPI. A clock from the master, no acknowledgement, and four modes to agree on.

    Related topics

    • Part 16 overview: Protocols Dissected

    Previous

    208 / 234

    Next: SPI

    Up next

    Up nextSPI

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • I2C
    • APB
    • AHB