Channel Coding: LDPC & Polar in 5G NR
LDPC for data channels, Polar for control, and the rate-matching / CRC machinery.
Channel coding adds structured redundancy so the receiver can repair the bit errors the radio inevitably introduces. NR (TS 38.212) deliberately refuses a one-size-fits-all code: it uses LDPC for high-throughput data, Polar for small but critical control, and tiny block codes for a handful of feedback bits. Each transport channel is threaded through its own precise chain of CRC, segmentation, encoding and rate matching — and getting those steps right is the difference between "the data just arrives" and knowing exactly why a single flipped code block need not cost you the whole transport block.
Introduction
Channel coding is the forward-error-correction stage of the NR physical layer: the step that takes information bits and adds mathematically structured parity so a noisy receiver can detect and correct errors without asking for a resend. Everything the air interface carries — user data, scheduling grants, the master information block, uplink control — passes through a coding chain before it is modulated. The complete set of chains, polynomials, base graphs and rate-matching rules is specified in TS 38.212.
It runs on every single transmission. The moment a transport block is scheduled on PDSCH or PUSCH it is CRC-protected, segmented, LDPC-encoded and rate-matched; the moment a grant goes out on PDCCH it is polar-encoded; even a one-bit HARQ acknowledgement is protected by a tiny block code. Coding sits directly beneath modulation and directly above the HARQ machinery, and the redundancy versions it produces are what make soft combining possible.
It matters because coding is where NR spends its reliability budget, and it spends it differently for different traffic. Data wants throughput and cheap parallel decoding at multi-Gbps; control wants near-perfect decoding of a few dozen bits on the first and only attempt. NR refuses to compromise between the two and picks a purpose-built code for each — a clean break from LTE that is worth understanding in detail.
On this page
Why channel coding is needed
In plain words: think of sending a parcel through rough handling. If you ship the item bare it arrives dented; if you pack it with padding, a few knocks do no harm. Channel coding is that padding for bits — it adds carefully shaped redundancy so that even when the radio flips some bits in transit, the receiver can reconstruct the original from what survived, no resend required.
Concretely, the radio channel corrupts bits through noise, fading and interference, and a raw bit stream gives the receiver no way to tell a good bit from a flipped one. Coding solves two problems at once. A CRC lets the receiver detect that something is wrong; the error-correcting code (LDPC, polar, or a block code) adds enough structured parity that the receiver can repair a bounded number of errors outright. Together they turn an unreliable channel into a usable one and feed HARQ the pass/fail signal it needs.
Forward error correction plus error detection: a CRC for detection and a structured code (LDPC / polar / block) for correction, applied per transport or control channel before modulation.
The channel flips bits; retransmitting everything is wasteful and slow. Adding redundancy lets the receiver fix most errors on the spot and, via HARQ, combine the rest — trading a little spectrum for a large reliability gain.
Attach a CRC, segment into code blocks, encode with the code chosen for that channel, and rate-match the coded bits to exactly fill the allocation — a fixed sequence per channel in TS 38.212.
Why NR uses more than one code
Data channels and control channels place opposite demands on a code. A data block is huge — tens of thousands of bits — and must encode and decode at multi-Gbps throughput with good performance right up to high code rates. A control message is tiny — tens of bits — rare, and absolutely must decode: miss the scheduling grant and nothing downstream happens. No single code is optimal for both regimes, so NR picks the best tool for each job and retires LTE's codes entirely.
NR uses LDPC for the data transport channels (DL-SCH / UL-SCH on PDSCH/PUSCH), Polar for larger control (DCI on PDCCH, the BCH on PBCH, larger UCI), and small block codes (Reed-Muller / simplex / repetition) for very small UCI payloads.
LDPC scales to large blocks and high rates with massively parallel, low-complexity decoding — ideal for data. Polar gives near-optimal performance for short, high-value blocks where reliability outranks throughput — ideal for control.
Each transport channel routes through a code-specific chain: CRC attachment, segmentation, encoding, rate matching and interleaving, tuned to the code family and payload size in TS 38.212.
This is a clean break from LTE. LTE carried its data on a turbo code (parallel-concatenated convolutional codes with an interleaver) and its control on tail-biting convolutional codes. Both hit walls at NR's targets: turbo decoding does not parallelise cheaply enough for tens of Gbps and suffers an error floor at high rates, while convolutional control coding underperforms modern short-block codes. NR replaces turbo with LDPC and convolutional control with Polar, keeping only trivial block codes for the very smallest payloads.
| Attribute | LDPC (data) | Polar (control) |
|---|---|---|
| Carried on | DL-SCH/UL-SCH (PDSCH/PUSCH) | DCI (PDCCH), BCH (PBCH), UCI > 11 bits |
| Replaces (from LTE) | Turbo code | Tail-biting convolutional code |
| Block size regime | Large (up to 8448 info bits/CB) | Small (tens to a few hundred bits) |
| Optimised for | Throughput, high code rate, HARQ-IR | Reliability at short length, low SNR |
| Decoding | Iterative belief propagation (parallel) | CRC-aided successive-cancellation list |
| HARQ soft combining | Yes (circular buffer, RVs) | No (control is not HARQ-combined) |
One line: big and fast → LDPC; small and precious → Polar; a few bits → block codes. LTE's turbo and convolutional codes appear nowhere in the NR physical layer.
LTE ↔ NR: LTE used one data code (turbo) and one control code (tail-biting convolutional) across the board. NR retires both and splits the job three ways — LDPC for data, Polar for larger control, small block codes for tiny UCI. The payoff is decoder parallelism (LDPC has no turbo-style interleaver serialisation) and better short-block performance (polar beats convolutional at the lengths DCI actually uses).
The DL-SCH / UL-SCH coding chain
A transport block never goes straight into the LDPC encoder. It passes through a fixed sequence (TS 38.212, clause 7.2 for DL-SCH): attach a transport-block CRC, segment into code blocks and attach a per-CB CRC, select a base graph, LDPC-encode each code block, rate-match each into the circular buffer, then concatenate the code blocks into one bit stream for modulation. UL-SCH follows the identical structure.
The receiver runs the chain in reverse: de-concatenate, de-interleave, soft-combine into the circular buffer per HARQ process, LDPC-decode each code block, check each per-CB CRC, reassemble, and finally check the transport-block CRC. Because errors are caught at two granularities, the receiver can tell not just that a TB failed but which code blocks were responsible — the hook that makes efficient retransmission possible.
CRC attachment and code-block segmentation
The first step attaches a transport-block CRC. If the payload A is larger than 3824 bits, NR uses the 24-bit polynomial gCRC24A (giving L = 24); for smaller payloads it uses the 16-bit gCRC16 (L = 16). The CRC lets the receiver declare the whole TB good or bad after reassembly. Call the CRC-appended length B = A + L.
An LDPC code block cannot be arbitrarily large: the maximum information size per code block is Kcb = 8448 bits for BG1 and Kcb = 3840 bits for BG2. If B exceeds Kcb, the TB undergoes code-block segmentation into C nearly equal code blocks, and — critically — each code block receives its own 24-bit CRC using gCRC24B. If the block already fits (B ≤ Kcb) there is a single code block and no per-CB CRC is added.
Number of code blocks: C = ⌈ B / ( Kcb − LCB ) ⌉
Total bits after per-CB CRC: B′ = B + C × LCB
Bits per code block: K′ = B′ / C
where Kcb = 8448 (BG1) or 3840 (BG2); the lifting size Zc and code-block length K = Kb·Zc are then chosen as the smallest supported lift with K ≥ K′ (Kb = 22 for BG1).
The set of lifting sizes is not continuous: TS 38.212 defines a fixed table of Zc values of the form Zc = a·2j with a ∈ {2, 3, 5, 7, 9, 11, 13, 15}, spanning 2 to 384. The encoder rounds the required per-block size up to the smallest lift whose lifted length is large enough, which is why real code blocks are almost always a little larger than the raw arithmetic suggests and the shortfall is padded.
A worked feel for the numbers: suppose A = 20000 info bits and BG1 is selected. Then B = 20000 + 24 = 20024, which exceeds Kcb = 8448, so segmentation kicks in. With LCB = 24, C = ⌈20024 / (8448 − 24)⌉ = ⌈20024 / 8424⌉ = 3 code blocks. Total bits B′ = 20024 + 3×24 = 20096, so each code block carries K′ = 20096 / 3 ≈ 6699 bits, which is then zero-padded up to the nearest supported lifted length K = Kb·Zc. Filler bits (<NULL>) pad any shortfall and are punctured before transmission.
Spec anchor: the CRC polynomials (gCRC24A, gCRC24B, gCRC16), the segmentation rule and the set of lifting sizes Zc are all in TS 38.212. The TB CRC is 24 bits when A > 3824; the per-code-block CRC is always 24 bits and is only present when C > 1.
Q. Why does each code block carry its own CRC when the whole TB already has one?
A. The per-code-block 24-bit CRC (gCRC24B) lets the receiver pinpoint exactly which code blocks failed. That enables code-block-group (CBG) retransmission — resending only the failed groups instead of the entire transport block, which saves resources on large TBs. It is only added when the TB is actually segmented (C > 1).
Base graph selection: BG1 vs BG2
NR does not use one LDPC matrix. It defines two base graphs, each a compact quasi-cyclic parity-check template that is "lifted" by a factor Zc to produce the actual code for a given block size. BG1 targets large blocks at high code rates; BG2 targets small blocks and low code rates, where extra redundancy buys better low-SNR performance.
| Base graph | Max info block Kcb | Systematic cols (Kb) | Lowest mother rate | Best for |
|---|---|---|---|---|
BG1 | 8448 bits | 22 | ≈ 1/3 | Large TBs, high code rates (up to ~8/9) |
BG2 | 3840 bits | 6, 8, 9 or 10 | ≈ 1/5 | Small TBs, low code rates, better coverage |
The two also differ in matrix shape: BG1 is a 46×68 base matrix (46 parity rows, 68 columns) sized for high-rate large blocks, while BG2 is 42×52 with fewer systematic columns, giving it a lower minimum rate and better performance in the coverage-limited regime. The selection rule (TS 38.212) is decided from the payload A and the target code rate R before segmentation:
| Condition on A and R | Base graph chosen |
|---|---|
| A ≤ 292 | BG2 |
| A ≤ 3824 and R ≤ 0.67 | BG2 |
| R ≤ 0.25 (any A) | BG2 |
| otherwise (large A at higher rate) | BG1 |
Both graphs are quasi-cyclic: the base matrix entries are circulant shifts, so a hardware decoder can process Zc bits in lockstep. That parallelism is exactly what lets an LDPC decoder sustain multi-Gbps throughput — something turbo decoding could never do economically. Once the base graph and lifting size are fixed, LDPC encoding is a sparse matrix multiply: the systematic bits are copied through and the parity bits are computed from the parity-check structure, producing a mother codeword that is then handed to rate matching.
Rule of thumb: BG1 = large TB and/or high rate; BG2 = small TB (A ≤ 292), low rate (R ≤ 1/4), or the mid-range A ≤ 3824 at R ≤ 2/3. Same LDPC family, two structures, chosen from TB size and code rate.
Rate matching, redundancy versions and LBRM
The LDPC mother codeword almost never equals the number of coded bits the scheduler allocated. Rate matching reconciles them: each code block's coded bits are written into a circular buffer, and bits are then read out to fill exactly the allocated resource elements. If fewer bits are needed than the buffer holds, the tail is punctured; if more are needed, the buffer wraps and repeats. A bit interleaver then permutes each code block's selected bits to spread them across the modulation symbols before code-block concatenation stitches all C blocks into one codeword.
Where the read-out starts in the circular buffer is set by the redundancy version, RV0 through RV3. Each RV is a different starting offset, so successive transmissions of the same data carry different coded bits.
| Redundancy version | Circular-buffer start | Property | Typical HARQ role |
|---|---|---|---|
RV0 | Offset 0 (start) | Self-decodable — includes systematic bits | First transmission |
RV2 | ≈ middle of buffer | Mostly parity | 2nd (fresh redundancy) |
RV3 | ≈ 3/4 into buffer | Mostly parity | 3rd |
RV1 | ≈ 1/4 into buffer | Partly systematic | 4th |
The common transmit order is RV0 → RV2 → RV3 → RV1, which front-loads self-decodable content and then feeds incremental parity. This drives HARQ incremental redundancy: a NACKed transport block is retransmitted with a new RV, and the receiver soft-combines the fresh coded bits with what it already stored in the buffer for that HARQ process. Two transmissions neither of which could decode alone often decode once combined. The DCI grant signals the RV of each transmission (a 2-bit field, values 0–3).
Storing the entire mother codeword for every HARQ process would demand enormous receiver soft-buffer memory, especially at high MCS and many carriers. Limited buffer rate matching (LBRM) caps it: the length of the circular buffer actually used, Ncb, is limited to min(N, Nref) instead of the full mother-codeword length N. Nref is derived from a reference TBS at a reference code rate of 2/3, so the UE need only size its soft buffer for a bounded worst case rather than the theoretical maximum.
Limited buffer: Ncb = min( N , Nref ) , Nref = ⌊ TBSLBRM / ( C · RLBRM ) ⌋ , RLBRM = 2/3
Because each code block carries its own CRC, NR can bundle code blocks into code-block groups (CBGs) and retransmit only the CBGs that failed rather than the whole TB. On a large transport block where one code block errored, this saves resending everything — a real efficiency gain, enabled via codeBlockGroupTransmission. The number of CBGs per TB (maxCodeBlockGroupsPerTransportBlock) is configurable as 2, 4, 6 or 8. The receiver reports per-CBG success (a CBG Transmission Information bitmap) so the transmitter resends precisely what is needed, each retransmission still cycling through RVs for incremental redundancy.
Mental model: the circular buffer is the reservoir of coded bits; the RV is the tap position that decides which bits pour out; LBRM caps how big the reservoir can get; and the per-CB CRC is the seam that lets NR refill only the failed code-block groups.
Q. What do RV0–RV3 do, and why is RV0 special?
A. They are four starting offsets into the LDPC circular buffer, so each transmission of the same data carries different coded bits. RV0 is self-decodable because it includes the systematic bits; the others emphasise parity. Cycling RVs (typically 0,2,3,1) delivers fresh redundancy the receiver soft-combines — HARQ incremental redundancy.
Polar coding for control
Polar codes carry the critical control information: DCI on PDCCH (scheduling grants), the BCH (MIB on PBCH), and larger UCI (more than 11 bits, on PUCCH/PUSCH). Polar coding exploits channel polarisation: recursively combining copies of the channel drives some synthetic bit-positions toward perfectly reliable and others toward useless. Information is placed on the reliable positions; the unreliable positions are set to known frozen bits. With CRC-aided successive-cancellation list decoding, polar codes beat LTE's tail-biting convolutional code at exactly the short block lengths control needs.
The control coding chain (TS 38.212) has its own distinct steps:
| Step | What happens |
|---|---|
| CRC attachment | Append CRC (e.g. gCRC24C for DCI, 24-bit for BCH); for DCI the CRC is scrambled by the RNTI so the CRC both detects errors and addresses the UE. |
| CRC interleaving | Interleave information + CRC bits so the CRC can assist the list decoder incrementally (distributed-CRC). |
| Sub-channel allocation | Map info bits to the most reliable sub-channels; set all others to frozen bits. PC (parity-check) frozen bits may be added for very short payloads. |
| Polar encoding | Encode with the Kronecker-power polar transform (mother length N a power of 2). |
| Sub-block interleave + rate matching | Puncture, shorten or repeat from a circular buffer to fit the allocated control resources; DCI adds a final channel interleaver. |
The mother length is bounded by payload: NR uses a maximum N = 512 for the downlink (DCI/BCH) and N = 1024 for larger uplink control, with the reliable-sub-channel ordering fixed by a standardised reliability sequence in TS 38.212 so encoder and decoder agree on which positions are frozen without extra signalling.
A key contrast with data: control is not HARQ soft-combined. There is no RV cycling and no incremental-redundancy buffer for DCI or BCH. The whole reliability budget is spent up front through the aggregation level (for PDCCH) and the polar code itself, because a control message must decode on its first and only attempt.
Q. What are frozen bits, and how does DCI CRC addressing work?
A. Frozen bits are known values (usually 0) placed on the unreliable polar sub-channels; only the reliable sub-channels carry information. For DCI, the 24-bit CRC is scrambled (XORed) with the UE's RNTI, so a clean CRC after descrambling simultaneously confirms the message decoded and that it was addressed to that UE.
Small-block codes for tiny UCI
For the very smallest uplink control — UCI of just a few bits such as a 1-bit HARQ-ACK or a short CSI — even polar coding is overkill; polarisation needs length to work with. NR falls back to simple small-block codes sized to the payload, all defined in TS 38.212.
| UCI payload | Coding used | Note |
|---|---|---|
| 1 bit | Repetition | The bit (and its placeholder) simply repeated. |
| 2 bits | Simplex-style fixed mapping | Three coded outputs from the two bits. |
| 3–11 bits | Reed-Muller block code | Linear (32, O) RM code, output truncated/repeated to the allocated length. |
| > 11 bits | Polar | Handed to the polar chain above. |
These codes are trivially cheap to encode and decode — often a lookup or a short linear map — and are well matched to payloads too small to benefit from polar's structure. The 11-bit boundary is the clean dividing line: at or below it, block codes; above it, polar. That single threshold is worth memorising because it is a frequent interview target.
LTE ↔ NR: LTE also used a (32, O) Reed-Muller block code for small uplink control and repetition/simplex for 1–2 bits — that part survives almost unchanged. The break is above 11 bits: where LTE fell back to tail-biting convolutional coding for larger UCI, NR uses polar. So the small-block layer is LTE heritage; the polar layer above it is new.
Q. Which code does NR use for data versus each kind of control, and where is the polar/block-code boundary?
A. LDPC for DL-SCH/UL-SCH data. Polar for DCI on PDCCH, the BCH (MIB), and UCI > 11 bits. For UCI of 1–11 bits NR uses small-block codes: repetition (1 bit), a simplex mapping (2 bits), and Reed-Muller (3–11 bits). The polar/block-code split sits at 11 bits.
⚠ Common pitfalls / gotchas
- Assuming the per-CB CRC is always present. It is added only when the TB is segmented (C > 1). A single-code-block TB has just the TB CRC, so CBG retransmission gains nothing there.
- Thinking control is HARQ-combined. DCI and BCH have no RV cycling and no soft buffer — a missed grant is simply gone, and reliability comes only from aggregation level and the polar code. Do not look for RVs on PDCCH.
- Reading RV order as 0-1-2-3. The usual transmit order is 0-2-3-1; RV0 is the only guaranteed self-decodable version, so starting a fresh transmission on any other RV can leave it undecodable in poor SNR.
- Ignoring LBRM when sizing soft memory. With LBRM on, the usable buffer is capped at Nref (reference rate 2/3), so extra parity beyond that is never stored — a retransmission that assumes the full mother codeword is available will mis-combine.
- Confusing base-graph choice with modulation. BG1/BG2 selection depends on payload size A and target code rate R only, decided before segmentation — not on the modulation order.
Summary
NR refuses a universal code and matches each channel to a purpose-built one: LDPC for the high-throughput data channels (DL-SCH/UL-SCH), Polar for larger control (DCI, BCH, UCI > 11 bits), and small block codes (repetition, simplex, Reed-Muller) for tiny UCI — retiring LTE's turbo and convolutional codes entirely. The data chain is fixed: TB CRC (gCRC24A/gCRC16) → segmentation with per-CB CRC (gCRC24B, only when C > 1) → base-graph choice (BG1 vs BG2 from A and R) → LDPC encode → rate match from the circular buffer → concatenate.
Rate matching is where HARQ lives: the redundancy versions RV0–RV3 are read-out offsets into that buffer, cycled (typically 0,2,3,1) to feed incremental redundancy the receiver soft-combines, while LBRM caps the stored buffer and CBGs let NR resend only the failed code-block groups. Control coding is the mirror image — polar with frozen bits, RNTI-scrambled CRC for addressing, and no soft combining, because a grant must decode on its first and only attempt.
Where this connects
Coding sits beneath the channels that carry your bits and the retransmission machinery that rescues them. Follow these next: