Two-dimensional wavelength-hopping time-spreading coding schemes have been studied recently for supporting greater numbers of subscribers and simultaneous users than conventional one-dimensional approaches in optical code-division multiple-access (OCDMA) systems. To further improve both numbers without sacrificing performance, a new code design utilizing bipolar codes for both wavelength hopping and time spreading is studied and analyzed in this paper. A rapidly programmable, integratable hardware design for this new coding scheme, based on arrayed-waveguide gratings, is also discussed.