An efficient algorithm for the generation of DeBruijn cycles

An algorithm is presented for the generation of binary DeBruijn sequences using feedback shift registers (FSRs). The algorithm is based on the principle of cycle joining, through which all the cycles in the cycle structure of a FSR can be joined together to one complete cycle, thereby producing a DeBruijn sequence of period 2/sup n/, where n is the length of the FSR. By a proper choice of the feedback function of the FSR O(2/sup 2n///sup log2n/) DeBruijn sequences of period 2/sup n/ can be generated, requiring only 3n bits of storage and at most 4n FSR shifts for the generation of the next bit in the sequence. >