A novel method for generating an optimal binary prefix condition code
is described. The proposed code generation method generates optimal va
riable length codes that have short average error spans compared to th
e existing self-synchronising codes. A technique for calculating the e
xpected error spans of variable length codes are also presented.