RIV is a number to specify PDSCH or PUSCH resource allocation. In more intuitive form, we normally use two values (i.e, Number of RBs and Start RB) for the resource allocation. But with RIV, we can represent Number of RBs and Start RB in a single value. It would have some advantage in terms of number of bits to carry the information.. but it causes some confusion for us to convert RIV into Number of RBs and Start RB.
Let's make that conversion routine. First we read RIV in two real DCIs from a 10 MHz cell. Then we look at the definition in 36.213 and see why one number can hold two values without losing anything. Finally we turn the definition around, so that you can get the number of RBs and the start RB back from a RIV with two divisions instead of a search.
- Where does RIV appear in a DCI ?
- How does 36.213 define RIV ?
- How do you get the number of RBs and the start RB back from RIV ?
- Reference
Where does RIV appear in a DCI ?
RIV sits in the resource block assignment field of the DCI formats that allocate a contiguous block of RBs. A decoder log shows it as a plain decimal number, and nothing on the screen tells you which RBs it means. The two decodes below come from a 10 MHz cell, so NRB is 50 in both of them.
Followings are couple of examples showing how RIV is specified in DCI.

- This is DCI format 0, the uplink grant, with the resource allocation marked as Hopping. The NUL-hop field is 00, and RIV is 270.
- With 50 RBs, the resource block assignment field has 11 bits. For hopping, 36.213 Table 8.4-1 takes 2 of them as the NUL-hop bits, so 9 bits carry the RIV.
- Decoded with NRB = 50, RIV 270 gives LCRBs = 6 and RBstart = 20. Because hopping is on, 36.213 clause 8.4 uses this as the allocation of the first slot and then derives the PRBs that the UE actually uses.

- This is DCI format 1A with a localized VRB allocation, MCS 15 and RIV 150.
- Decoded with NRB = 50, RIV 150 gives LCRBs = 4 and RBstart = 0. So the PDSCH occupies VRB 0 to VRB 3.
- The decode section at the end of this page shows how to get these two results in one step.
RIV is one number for two values : the start RB and the number of contiguous RBs travel together in one field.You need the bandwidth to read it : the same RIV means different RBs at 5 MHz and at 10 MHz, because NRB is part of the formula.Hopping takes bits away from the RIV : in a DCI format 0 with hopping, 1 or 2 MSBs of the field carry the NUL-hop bits, and the RIV uses the rest.
How does 36.213 define RIV ?
The definition answers a counting question. In a band of N RBs there are only N(N+1)/2 ways to choose a contiguous block. A good encoding gives each of those blocks its own number from 0 upward and wastes no values. The formulas below do exactly that, and the if/else in them is the step that keeps the numbers compact.
The conversion from the number of RB and Start RB to RIV is defined as shown below.
For downlink, there are a couple of different mathematical definition for RIV depending on a specific DCI format. It is specified in 36.213 - 7.1.6.3 Resource allocation type 2 as follows.
For PDCCH DCI format 1A, 1B or 1D, or for EPDCCH DCI format 1A, 1B, or 1D, a type 2 resource allocation field

For PDCCH DCI format 1C, a type 2 resource block assignment field

For Uplink, it is defined in 36.213 - 8.1.1 Uplink resource allocation type 0 as shown below.

As you see, it is pretty simple to get RIV from Number of RBs (L_CRB) and Start RB(RB_Start), but it is not easy to figure out Number of RBs (L_CRB) and Start RB(RB_Start) from RIV.
Let's see why the if/else is there. Equation (1) alone would put the block length in the high part of the number and the start RB in the low part, which is N(LCRBs - 1) + RBstart. Long blocks have few possible start positions, so equation (1) would waste most of the upper range. Equation (2) folds every block longer than half the band back into those unused values. The result is a one-to-one mapping onto 0 to N(N+1)/2 - 1.
So the field needs ⌈log2(N(N+1)/2)⌉ bits. For 50 RBs that is 1275 values and 11 bits. Two separate fields for the start RB and the length would need 6 bits each, so RIV saves one bit at 10 MHz, and one or two bits at the other LTE bandwidths. For example, a full allocation of 50 RBs is RIV 99. Its LCRBs - 1 = 49 is above 25, so equation (2) applies: 50 x 1 + 49 = 99.
Two more rules come with the formulas. LCRBs is at least 1 and must not run past the band edge, so RBstart + LCRBs is at most N. And DCI format 1C works in steps of NRBstep RBs, which 36.213 Table 7.1.6.3-1 sets to 2 for 6 to 49 RBs and to 4 for 50 to 110 RBs. The current 36.213 v19.4.0 also applies the type 2 RIV to MPDCCH DCI format 6-1A for BL/CE UEs and to the short TTI DCI formats 7-1A to 7-1G.
The if/else makes the numbering compact : equation (2) reuses the values that equation (1) leaves empty, so every RIV from 0 to N(N+1)/2 - 1 is one allocation.The field size follows from the count : ⌈log2(N(N+1)/2)⌉ bits, which is 11 bits at 50 RBs.DCI format 1C counts in steps : its RIV is built from LCRBs / NRBstep and RBstart / NRBstep, so it cannot address single RBs.
How do you get the number of RBs and the start RB back from RIV ?
A search over every combination works, and the OpenLTE code below does exactly that. But the folding in equation (2) can be undone directly. Let's look at the search first, and then replace it with two divisions that you can do by hand when you read a log.
One way to find N_RB and Start_RB from RIV value is to try all the possible values of N_RB and Start_RB and find the combination to meet any one of the equation (1) or (2). Following is an example of the algorithm showing the method of finding N_RB and Start_RB from OpenLTE project.
% Copyright 2012 Ben Wojtowicz
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU Affero General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Affero General Public License for more details.
%
% You should have received a copy of the GNU Affero General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
% Following is from lte_dci_1a_unpack.m file in /octave folder
for(n=1:N_rb_dl)
for(m=0:(N_rb_dl-n))
if((n-1) <= floor(N_rb_dl/2))
if(RIV == N_rb_dl*(n-1)+m)
L_crb = n;
RB_start = m;
endif
else
if(RIV == N_rb_dl*(N_rb_dl-n+1)+(N_rb_dl-1-m))
L_crb = n;
RB_start = m;
endif
endif
endfor
endfor
The search works because the mapping is one-to-one, so exactly one pair matches. To undo it directly, divide RIV by N and keep the quotient a = ⌊RIV / N⌋ and the remainder b = RIV mod N. If a + b is at most N - 1, equation (1) produced the RIV, and LCRBs = a + 1 and RBstart = b. Otherwise equation (2) produced it, and LCRBs = N - a + 1 and RBstart = N - 1 - b.
The test a + b ≤ N - 1 is simply the band edge check. With equation (1), a + b is LCRBs - 1 + RBstart, which can never exceed N - 1. With equation (2), the same sum always exceeds it. This inverse was checked against every allocation for all LTE bandwidths from 6 to 110 RBs. The table below applies it to four RIV values in a 10 MHz cell.
RIV | a, b | Check a + b | LCRBs | RBstart |
150 | 3, 0 | 3 ≤ 49, equation (1) | 4 | 0 |
270 | 5, 20 | 25 ≤ 49, equation (1) | 6 | 20 |
99 | 1, 49 | 50 > 49, equation (2) | 50 | 0 |
1274 | 25, 24 | 49 ≤ 49, equation (1) | 26 | 24 |
The last row is the largest RIV at 10 MHz. It is not the full band, as you might expect. It is a block of 26 RBs that ends at the band edge, because the folding in equation (2) gives the longest blocks small RIV values. The largest RIV therefore belongs to the longest block that still uses equation (1).
Two divisions replace the search : take the quotient and the remainder of RIV / N, and the band edge check a + b ≤ N - 1 tells you which equation to undo.A large RIV is not a large allocation : the full 50 RB block is RIV 99, while RIV 1274 is only 26 RBs.Always use the N of the DCI : NRBDL for the downlink formats, NRBUL for DCI format 0, and the stepped values for DCI format 1C.
Reference
- LTE RIV Calculator-RB to RIV converter,RIV to RB converter
- 36.213 : 3GPP - E-UTRA Physical layer procedures, v19.4.0. Clause 7.1.6.3 with Table 7.1.6.3-1, clause 8.1.1 and clause 8.4 with Table 8.4-1.
- 36.212 : 3GPP - E-UTRA Multiplexing and channel coding, v19.3.0. Clause 5.3.3.1, DCI format 0 and DCI format 1A.