Introduction
Radix-50 was invented by DEC for use on their PDP series of computers. It uses a 40 character subset of ASCII to fit three characters into a 16-bit word (40 in decimal is 50 in octal, the predominant number base used when programming PDP machines). It is used on the ANS to keep the packet size to a minimum. ANS devices rarely actually have to encode or decode Radix-50 strings at run-time, usually it is sufficient to compare encoded strings.
The ANS version of Radix-50 is slightly different to the DEC version. The dollar is replaced by an underscore and the unassigned DEC character position is replaced by the null character and moved to the end of the character table. This character may be used to pad strings which do not exactly fill a whole number of 16-bit words.
Characters
| Character | ASCII Value | ANS Radix-50 Value | DEC Radix-50 Character |
|---|---|---|---|
| space | 0x20 | 0x00 | |
| A–Z | 0x41–0x5A | 0x01–0x1A | |
| _ | 0x5F | 0x1B | $ |
| . | 0x2E | 0x1C | |
| 0 | 0x30 | 0x1D | Unassigned |
| 1–9 | 0x31–0x39 | 0x1E–0x26 | 0–8 |
| \0 | 0x00 | 0x27 | 9 |
Encoding
All Radix-50 strings must be a multiple of three characters long and should be padded by spaces at the end if necessary. To encode the character sequence “xyz” into the 16-bit word e the following formula should be used:
e = (((x × 40) + y) × 40) + z