Radix-50 Encoding

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

CharacterASCII ValueANS Radix-50 ValueDEC Radix-50 Character
space0x200x00 
A–Z0x41–0x5A0x01–0x1A 
_0x5F0x1B$
.0x2E0x1C 
00x300x1DUnassigned
1–90x31–0x390x1E–0x260–8
\00x000x279

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