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
    • Reads and Writes Are Not Symmetric
    • The Request/Response Model
    • Address Maps and Decoding
    • Register Semantics
    • Combined and Split Transactions
    • Independent Channels
    • Posted and Non-Posted Writes
    • Bursts
    • Alignment, Strobes and Narrow Transfers
    • Boundary Rules
    • Width and Endianness Conversion
    • Transaction Attributes
    • Atomics
    • Sideband or In-Band
    • Interrupts and Notification
    • Descriptors, Rings and Doorbells
    • Bridges and Protocol Conversion
    • Protocols Compared: Transactions
    • Drills: Transactions
  • 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 5: Transactions
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 5: Transactions
  4. Alignment, Strobes and Narrow Transfers

Part 5 · Transactions · Working (W)

Alignment, Strobes and Narrow Transfers

A wide data bus is a row of byte lanes. How byte strobes let a write change only some bytes, how unaligned and narrow transfers use the lanes, and what a design without strobes must do instead.

On this page

    Note

    Level: Working (W) · Answers: What exactly is being asked?

    Before this: Bursts

    A 64-bit bus moves 8 bytes per beat. Software wants to write 3 bytes at address 0x05, perhaps one field of a packed structure. The memory word at 0x00 holds 8 bytes, and 5 of them belong to other fields that must not change. The bus has to carry "write these 3 bytes, leave the other 5 alone" in a single beat.

    How does a wide bus write fewer bytes than its width, or bytes that do not start at the beginning of a word?

    The obvious answer, and why it breaks

    The obvious way is read-modify-write: read the whole 8-byte word, replace 3 bytes, write all 8 back. It works, but it costs a full read round trip for every partial write, and it is not safe: if anything else writes the other 5 bytes between the read and the write-back, those changes are overwritten. A partial write needs to say, in the write itself, which bytes to change.

    The idea: byte lanes and strobes

    Treat a W-byte data bus as W byte lanes. Lane n carries the byte whose address, within the aligned W-byte word, is n. Each write beat carries one strobe bit per lane (also called a byte enable): 1 means "write this lane's byte", 0 means "leave that byte in memory unchanged". The target writes only the strobed bytes, so no read is needed and the other bytes are never touched.

    Byte lanes of one 8-byte beat. Strobes say which lanes to write; unstrobed bytes in memory are not changed.

    Build it: a strobe generator

    The generator turns a write of any length at any address into beats and strobes on an 8-byte bus, and does the same for a narrow burst, whose beats are smaller than the bus.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    """Byte strobes for writes on a 64-bit (8-byte) data bus.
    
    Each beat carries one aligned 8-byte word; strobe bit n says byte lane n holds a
    byte to write (lane n = address offset n within the word). A write of `length`
    bytes starting at `addr` becomes one beat per word it touches.
    """
    LANES = 8
    
    
    def write_beats(addr, length):
        out, a, end = [], addr, addr + length
        while a < end:
            word = a - a % LANES
            last = min(end, word + LANES)
            strobe = sum(1 << (b - word) for b in range(a, last))
            out.append((word, strobe))
            a = last
        return out
    
    
    def narrow_beats(addr, size, n):
        """An INCR burst of n beats, each `size` bytes, on the 8-byte bus."""
        out = []
        for i in range(n):
            a = addr + i * size
            word = a - a % LANES
            out.append((word, sum(1 << (b - word) for b in range(a, a + size))))
        return out
    
    
    def show(title, rows):
        print(title + ": " + ", ".join(f"word 0x{w:02X} strobe {s:08b}" for w, s in rows))
        return rows
    
    
    r1 = show("3 bytes at 0x05", write_beats(0x05, 3))
    r2 = show("6 bytes at 0x05", write_beats(0x05, 6))
    r3 = show("2-byte INCR4 at 0x02", narrow_beats(0x02, 2, 4))
    
    assert r1 == [(0x00, 0b11100000)]
    assert sum(bin(s).count("1") for _, s in r2) == 6 and len(r2) == 2
    assert [s for _, s in r3] == [0b00001100, 0b00110000, 0b11000000, 0b00000011]
    print("PASS: strobes mark exactly the bytes written; an unaligned write spills into a second beat")

    It prints:

    Diagram
    3 bytes at 0x05: word 0x00 strobe 11100000
    6 bytes at 0x05: word 0x00 strobe 11100000, word 0x08 strobe 00000111
    2-byte INCR4 at 0x02: word 0x00 strobe 00001100, word 0x00 strobe 00110000, word 0x00 strobe 11000000, word 0x08 strobe 00000011
    PASS: strobes mark exactly the bytes written; an unaligned write spills into a second beat
    • 3 bytes at 0x05 fit in one beat: the word at 0x00, lanes 5 to 7.

    • 6 bytes at 0x05 are unaligned and cross a word boundary, so they spill into a second beat: lanes 5 to 7 of word 0x00, then lanes 0 to 2 of word 0x08.

    • A narrow burst of 2-byte beats on the 8-byte bus uses a different pair of lanes each beat (lanes 2–3, 4–5, 6–7), then moves to the next word. The data travels in the lanes its address selects, not always in the low lanes.

    The design space

    Approach

    Cost

    When

    Strobes on every write beat

    One wire per byte lane

    Memory-like targets that hold data for many owners

    Read-modify-write in the target

    A read per partial write; must be atomic inside the target

    Memories with error-correcting codes over the whole word, which must recompute the code anyway

    Whole words only, no strobes

    Software may not do partial writes

    Simple links and register blocks where every access is a full word

    Error-correcting memories are the interesting case: a code computed over 8 bytes cannot be updated from 3 of them, so the memory controller must read, merge and rewrite internally even though the bus carried strobes.

    How real protocols chose

    Protocol

    Partial writes

    AXI

    WSTRB: one bit per byte lane, per beat; strobes may differ from beat to beat; a narrow transfer uses only the lanes its size and address select.

    APB

    PSTRB from APB4; earlier APB versions wrote whole words.

    DCLink

    Whole 32-bit flits only, no strobes. A design that needed byte writes would add four strobe bits per data flit.

    What breaks

    A bridge (illustrative) converted narrow writes by always placing the data in the low byte lanes, ignoring the address. A 2-byte write to 0x02 arrived at the memory in lanes 0–1 with strobes for lanes 0–1, and overwrote the bytes at 0x00 instead. Software saw corrupted neighbouring fields, intermittently, depending on alignment. The rule is: a byte's lane is fixed by its address, and the strobe marks that lane.

    Why this matters

    Senior lens. Check three things wherever data crosses a width or protocol boundary: data sits in the lanes its address selects, strobes mark exactly the bytes written, and any target that needs whole words (error-correcting memory, some peripherals) does an atomic internal read-modify-write. Verify with every size at every offset, including writes that cross a word boundary.

    Interview

    Asked: "How is a 3-byte write at address 0x5 carried on a 64-bit bus?"

    Weak answer: As a 64-bit write of the three bytes.

    Strong answer: As one beat to the aligned word at 0x0, with the data in byte lanes 5, 6 and 7 and the strobes set for those lanes only: 11100000. The target writes only strobed bytes, so the other five are untouched with no read needed. If it were 6 bytes it would cross into the next word and need a second beat with lanes 0 to 2 strobed. An error-correcting memory would still read-modify-write internally, because its code covers the whole word.

    Follow-ups: (1) What is a narrow transfer? (2) Why can't an ECC memory just write the strobed bytes?

    Check yourself Give the strobes for a 4-byte write at 0x06 on an 8-byte bus.

    Two beats: word 0x00, lanes 6–7 (11000000); word 0x08, lanes 0–1 (00000011).

    Check yourself Why is read-modify-write over the bus unsafe for partial writes?

    Another writer can change the other bytes between the read and the write-back, and the write-back overwrites its change. Strobes avoid the read entirely.

    Key takeaways

    • A wide bus is a row of byte lanes; a byte's lane is set by its address within the aligned word.

    • Strobes mark which lanes to write, so a partial write needs no read and touches no other bytes.

    • Unaligned writes can spill into a second beat; narrow bursts move across the lanes.

    Keep going

    Next: Lesson 5.10, Boundary Rules. Why a burst may not cross a 4 KB boundary, and how to split one that would.

    Related topics

    • Part 5 overview: Transactions

    Previous

    76 / 234

    Next: Boundary Rules

    Up next

    Up nextBoundary Rules

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Reads and Writes Are Not Symmetric
    • The Request/Response Model
    • Address Maps and Decoding