The authors construct a new family of 2(n) codes, called 2(n) extended prim
e codes, for all-optical code-division multiple access (AOCDMA) application
s. Such 2(n) codes are obtained by 'extending' prime codes. As a result, th
e crosscorrelation constraint of the new codes is equal to one, as opposed
to two in the original prime codes or 2(n) prime codes. Moreover, the bit e
rror rate (BER) of AOCDMA systems using the new codes is analysed. It is sh
own that the new codes can support a larger number of active users than the
2(n) prime codes for a given BER.