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
    • Common-Clock Interfaces
    • Asynchronous Serial and Oversampling
    • Source-Synchronous Clocks and Strobes
    • Embedded Clocks and Clock Recovery
    • Skew and Deskew
    • Clock Relationships
    • Elastic Buffers and Clock Compensation
    • Self-Timed Handshakes
    • Crossing at the Interface
    • Protocols Compared: Timing and Clocking
    • Drills: Timing and Clocking
  • 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
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 1: Timing and Clocking
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 1: Timing and Clocking
  4. Common-Clock Interfaces

Part 1 · Timing and Clocking · Foundation (F)

Common-Clock Interfaces

The simplest answer to "when is the data valid?": both sides use one clock. Why it works on chip and stops scaling across a board.

On this page

    Note

    Level: Foundation (F) · Answers: When is the data valid?

    Before this: Part 1 overview, Reading Timing Diagrams

    A board carries a processor and a memory-mapped peripheral chip, both clocked from one 200 MHz oscillator. It works. The next revision moves the peripheral to the far side of the board to make room for a connector, about 200 mm away. Nothing else changes, yet reads from the peripheral now fail at room temperature on some boards and at high temperature on all of them.

    Both chips see the same clock. Why does moving one of them break the interface?

    The obvious answer, and why it breaks

    The obvious answer is that a shared clock settles the question of when data is valid: both sides tick together, the sender changes data on one edge and the receiver samples on the next. That is true only if the data gets there within one period. A signal on a board travels at a finite speed, and the sender also needs time to drive it and the receiver needs it to be stable for a while before the edge. Move the chips apart and the trip gets longer, while the clock period stays the same.

    The idea: one clock, one period, one budget

    In a common-clock (or system-synchronous) interface, the sender launches data on a clock edge and the receiver captures it on the next edge of the same clock. Everything between launch and capture must fit into one clock period:

    Tclk​≥tco​+tflight​+tsetup​+tskew​+tmargin​
    • t_co, clock-to-output: how long after its clock edge the sender's output changes.

    • t_flight: travel time along the wire, proportional to its length.

    • t_setup: how long before the capturing edge the data must be stable at the receiver.

    • t_skew: how much later (or earlier) the clock edge arrives at the receiver than at the sender, since the clock also travels on wires.

    • t_margin: what you keep for jitter, temperature and process variation.

    There is also a hold condition: data must stay stable for a short time after the edge, so a path that is too fast can fail too. Skew hurts both: the clock reaching the receiver late eats into hold, early eats into setup.

    The common-clock arrangement. The clock and the data both travel on wires, and both trips must fit inside one clock period.

    Build it: the budget, by distance

    The model computes the shortest safe period, and so the fastest clock, for five trace lengths, with illustrative numbers for the fixed terms and for propagation along a board trace.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    """Common-clock timing budget: how fast can two chips on one clock talk?
    
    One clock period must cover the sender's clock-to-output delay, the flight time
    along the board, the receiver's setup time, the clock skew between the two chips,
    and a margin. Flight time grows with distance, so the clock must slow down.
    All numbers are illustrative.
    """
    T_CO, T_SETUP, T_SKEW, T_MARGIN = 1.0, 0.5, 0.3, 0.2   # ns
    PS_PER_MM = 6.7                                         # board trace, illustrative
    
    print("distance  flight   period   max clock")
    rows = []
    for mm in (25, 50, 100, 200, 400):
        flight = mm * PS_PER_MM / 1000                      # ns
        period = T_CO + flight + T_SETUP + T_SKEW + T_MARGIN
        rows.append((mm, period))
        print(f"{mm:5d} mm {flight:5.2f} ns {period:6.2f} ns {1000 / period:7.0f} MHz")
    
    periods = [p for _, p in rows]
    assert all(a < b for a, b in zip(periods, periods[1:]))  # longer wire, longer period
    print("PASS: every extra millimetre lengthens the period; the fixed terms cap the clock even at zero distance")

    It prints:

    Diagram
    distance  flight   period   max clock
       25 mm  0.17 ns   2.17 ns     461 MHz
       50 mm  0.34 ns   2.33 ns     428 MHz
      100 mm  0.67 ns   2.67 ns     375 MHz
      200 mm  1.34 ns   3.34 ns     299 MHz
      400 mm  2.68 ns   4.68 ns     214 MHz
    PASS: every extra millimetre lengthens the period; the fixed terms cap the clock even at zero distance

    Two things stand out. First, distance alone lowers the ceiling for a one-way transfer from about 375 MHz at 100 mm to about 300 MHz at 200 mm, and the next section shows that reads are worse. Second, even at zero distance the fixed terms (2 ns here) cap the clock at about 500 MHz. Making wires shorter helps less and less; the scheme itself has a ceiling.

    Worked numbers: the read is worse than the write

    For a read, the data must make a round trip: the clock (or the request) goes out to the peripheral, and the data comes back. With the model's numbers at 200 mm, a write uses one flight time (1.34 ns), while a read uses the clock's trip out plus the data's trip back, 2.68 ns, the same as the 400 mm row: a 4.68 ns budget. The opening design runs at 200 MHz, a 5 ns period, so its reads keep only about 0.3 ns beyond the stated margin, and a hot board or slower silicon uses that up. That is why the opening failure hit reads first. Any common-clock or master-clocked interface where data flows against the clock pays this round trip.

    The design space

    Clocking scheme

    What it costs

    When it wins

    Common clock (this lesson)

    Period must cover flight time and skew; reads pay a round trip

    On chip, and short, slow board links

    Source-synchronous: send a clock or strobe with the data (lesson 1.3)

    An extra wire per group; capture logic at the receiver

    Wide, fast, short links such as memory interfaces

    Embedded clock: recover the clock from the data (lesson 1.4)

    Encoding and clock-recovery circuits

    Fast serial links over longer distances

    No clock at all: asynchronous framing (lesson 1.2)

    Low rate; both sides need accurate local clocks

    Slow, cheap serial links such as UARTs

    How real protocols chose

    Protocol

    Clocking

    APB and AXI

    Common clock on chip: both sides of an interface share one clock, and the wires are short enough for the budget to close at high rates. Interfaces between clock domains use explicit crossings (lesson 1.9).

    SPI

    The master drives the clock alongside its outgoing data, so data from master to slave travels with the clock; data coming back from the slave pays the clock's trip out and the data's trip back.

    DDR memory

    Does not rely on a common clock for data: each data group travels with its own strobe (lesson 1.3), because a common-clock budget cannot close at memory data rates.

    What breaks

    The opening failure, told as debug steps (illustrative numbers):

    • Symptom: reads from the moved peripheral fail intermittently, worse when hot; writes are fine.

    • Evidence: on a scope, read data reaches the processor's pins close to, and sometimes after, the capturing clock edge.

    • Root cause: the read path pays a round trip of about 2.7 ns of flight time on top of the fixed terms; together with skew and margin the period is exceeded at temperature.

    • Fix: slow the bus clock for that peripheral, or add a turnaround cycle so read data is captured one edge later. The lasting fix is to move the interface to a scheme whose budget does not include the round trip, such as source-synchronous capture.

    Why this matters

    Senior lens. Every clocking scheme is a choice about what travels with the data. A common clock sends nothing with it, so every wire delay lands in the timing budget. The schemes in the next lessons send more and more timing information alongside the data, a strobe, then transitions in the data itself, so that wire delay drops out of the budget and only the mismatch between wires remains. When you review an off-chip interface, ask which delays appear in its budget and which have been designed out.

    Interview

    Asked: "Why can't a common-clock bus run at 2 GHz across a board?"

    Weak answer: Because boards are slow.

    Strong answer: Because one clock period has to cover clock-to-output, flight time, setup, clock skew and margin. At 2 GHz that's 500 ps, and the fixed terms alone often exceed it before any trace length is added; flight time on a board is several picoseconds per millimetre, and reads pay a round trip. Fast board links instead send timing with the data, a strobe or an embedded clock, so the flight time drops out of the budget.

    Follow-ups: (1) Why are reads harder than writes on such a bus? (2) What does skew do to the hold check?

    Check yourself Using the model's numbers, how much of the 400 mm period is flight time?

    2.68 ns of 4.68 ns, a little over half. The other 2 ns are the fixed terms, which do not shrink with distance.

    Check yourself A common-clock link fails hold, not setup. Which term in the budget is most likely the cause?

    Clock skew, with the clock reaching the receiver later than the sender: new data from the sender can arrive before the receiver's late edge has finished capturing the old data. Very short data paths make it worse.

    Check yourself Why does the common-clock scheme work so well inside a chip?

    Wires between neighbouring blocks are short, so flight time is small, and the clock tree is designed to keep skew low. The budget is dominated by logic delay, which synthesis and timing analysis control.

    Key takeaways

    • In a common-clock interface, one period must cover clock-to-output, flight time, setup, skew and margin.

    • Flight time grows with distance and reads pay a round trip, so common-clock links slow down as chips move apart.

    • Faster schemes send timing information with the data so that wire delay drops out of the budget.

    Keep going

    Next: Lesson 1.2, Asynchronous Serial and Oversampling. The opposite extreme: no clock wire at all. How a UART finds the middle of every bit.

    Related topics

    • Part 1 overview: Timing and Clocking

    • RTL course: Source-Synchronous Interfaces

    Previous

    15 / 234

    Next: Asynchronous Serial and Oversampling

    Up next

    Up nextAsynchronous Serial and Oversampling

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Source-Synchronous Clocks and Strobes
    • Embedded Clocks and Clock Recovery
    • Skew and Deskew