In this paper, we investigate the performance of optical code division multiple access system using the diagonal eigenvalue unity (DEU) code as a promising code for future optical networks. A comparison between the utilization of the NAND subtraction detection technique and the spectral direct detection (SDD) technique is presented to investigate which one provides better performance with the DEU code. In addition, a complete mathematical analysis for the two cases is presented. The performance of the two techniques is evaluated in terms of signal to noise ratio, bit error rate (BER), the effective received power, and phase induced intensity noise. Also, the variable weight DEU code is discussed. It demonstrates success for triple-play services (audio, video, and data) using the SDD technique to provide different quality of service (QoS) values to users. The results show that the SDD technique supports a larger number of users, reduces the receiver complexity, and provides better performance than the NAND subtraction technique. For a minimum acceptable BER of 10 -9 for a telecommunication system, the direct detection technique supports 265 users, while the NAND subtraction supports 150 users only for (weight W = 3). Also, with variable weights in a single system, the performance of users with high weight is always better compared to that of lower weight users.