RDS PI CODE FORMULA FOR STATION CALLSIGNS
RDS PI CODE FORMULA FOR STATION CALLSIGNS
By: Don McClatchie
The Radio Data System (RDS) Program Identification (PI) code is used to identify FM and LPFM stations that have four alphabetic character callsigns like (KAAZ or WZZA) etc. The PI code transmitted by the station must be unique to avoid conflicts with the Alternate Frequency (AF) features in receivers experiencing fading signals. The 4 letter alphabetic callsign is converted to a number using a formula specified by the National Radio Systems Committee (NRSC) in a document called NRSC-4-B and there are several website calculators to use for determining to correct code to use for your station. I was interested in breaking down the PI code to see how it converted the 4 alphabetic letters into a unique number so here is what I found.
It all starts with an ASCII table originally created for computers to send control characters, letters and numbers as well as all the various symbols for peripherals such as printers and keyboards. The ASCII assigns a decimal number for each of the various characters. The list below is for the 26 Capitol letters used to make up a callsign. Notice that the list has an ASCII number and then that number is subtracted from 65 so that the new number table starts at 0 for A and 1 for B and so on. This is the number left over after subtracting 65 from the ASCII number that is used in the formula.
ASCII # ASCII – 65 Symbol ASCII # ASCII – 65 Symbol
65 – 65 = 0 A 78 – 65 = 13 N
66 – 65 = 1 B 79 – 65 = 14 O
67 – 65 = 2 C 80 – 65 = 15 P
68 – 65 = 3 D 81 – 65 = 16 Q
69 – 65 = 4 E 82 – 65 = 17 R
70 – 65 = 5 F 83 – 65 = 18 S
71 – 65 = 6 G 84 – 65 = 19 T
72 – 65 = 7 H 85 – 65 = 20 U
73 – 65 = 8 I 86 – 65 = 21 V
74 – 65 = 9 J 87 – 65 = 22 W
75 – 65 = 10 K 88 – 65 = 23 X
76 – 65 = 11 L 89 – 65 = 24 Y
77 – 65 = 12 M 90 – 65 = 25 Z
Starting with the least significant letter on the right-hand side, record the ASCII – 65 number. Then take the ASCII – 65 number for the next letter to the left and multiply that number by 26 (the number of letters in the table) and record that number. Then take the ASCII – 65 number for the next letter to the left and multiply it by 676 or (26 x 26) and record that number. For the last letter on the left side, this letter is either a K or a W, in this position, a K equals the number 4096 and a W is equal to the number 21672. The last step is to just add up the four recorded numbers and the result equals the PI code. KBBB = 1 + 26 + 676 + 4096 = 4799 the PI code for KBBB.