Code Block Segmentation
Understanding Code Block Segmentation
5G NR achieves peak data rates exceeding 20 Gbps by transmitting very large transport blocks that can contain over 1 million information bits in a single slot. However, the LDPC channel coder has a fixed maximum block size determined by the parity-check matrix dimensions (8,448 bits for base graph 1). Code block segmentation bridges this gap: it splits the transport block into smaller pieces, each small enough for the LDPC encoder, adds per-block error detection (CRC24B), and enables the decoder to process blocks in parallel for low latency.
The segmentation procedure is straightforward. First, a 24-bit CRC (CRC24A) is appended to the transport block for whole-block error detection. If the resulting size B+24 exceeds the maximum code block size Kcb, the block is divided into C = ceil((B+24)/(Kcb-24)) code blocks. The 24 bits subtracted from Kcb in the denominator account for the per-block CRC24B that will be added to each code block. Filler bits (zero padding) are prepended to the first code block if needed to equalize block sizes. Each code block then proceeds through LDPC encoding, rate matching, and code block concatenation before modulation and mapping to OFDM resource elements.
Segmentation Formulas
C = ⌈(B + 24) / (Kcb - 24)⌉
Code Block Size (including CRC):
K = ⌈(B + 24 + C×24) / C⌉ rounded to valid LDPC lifting size
CBG HARQ Overhead Savings:
Savings = 1 - (1/NCBG) per single-CBG failure
Where B = transport block size (bits), Kcb = max code block size (8,448 for BG1, 3,840 for BG2). Example: B = 100,000 bits. C = ceil(100,024/8,424) = 12 code blocks. With 8 CBGs: retransmit 1/8 instead of full block (87.5% saving).
Segmentation Examples
| Transport Block | Base Graph | Kcb | Code Blocks (C) | CB Size (K) |
|---|---|---|---|---|
| 5,000 bits | BG1 | 8,448 | 1 | 5,024 bits |
| 50,000 bits | BG1 | 8,448 | 6 | ~8,400 bits |
| 500,000 bits | BG1 | 8,448 | 60 | ~8,400 bits |
| 1,300,000 bits | BG1 | 8,448 | 155 | ~8,400 bits |
| 2,000 bits | BG2 | 3,840 | 1 | 2,024 bits |
Frequently Asked Questions
Why is segmentation necessary?
LDPC max info block: 8,448 bits (BG1) or 3,840 bits (BG2). 5G transport blocks up to ~1.3 Mbit. Without segmentation, encoder matrix would be impossibly large. Segmentation enables parallel decoding (arrays of LDPC cores), per-block CRC for early termination, and CBG-level HARQ for efficient retransmission.
How does segmentation interact with HARQ?
Code blocks grouped into 2/4/6/8 CBGs (RRC-configured). Each CBG gets own HARQ feedback bit. Failed CBG retransmitted, not entire TB. 150 code blocks in 8 CBGs: single-block error retransmits 1/8 of data (87.5% overhead reduction). Critical for high-SNR scenarios with rare, isolated errors.
How does it affect decoding latency?
First code block decoded while later blocks still demodulating. Pipelined architecture: demod + deinterleave + LDPC decode on different blocks simultaneously. Single-block decode: 1 to 5 μs (10 to 20 iterations). 150 blocks on 8 to 16 parallel cores: ~10 to 100 μs total vs ms without parallelism.