Pick two n-sequences of the same length such that their cross-correlation has two values. The set of the n exclusive-ors of the two sequences in their various phases, together with the two n-sequences themselves, is a set of Gold codes. The exclusive-or of two Gold codes is another Gold code in some phase.

See also Kasami code.