Maximum length linearly occurring code sequence generator
FIELD OF THE INVENTION 
     This invention relates to a generator for generating maximum length linearly occurring code sequences (hereinbelow abbreviated to m sequences) of digital data. 
     BACKGROUND OF THE INVENTION 
     A GOLD code is formed by adding two m sequences PN 1 and PN 2, which are in synchronism with a clock signal CLK, modulo 2 by means of an exclusive logical sum (hereinbelow abbreviated to EOR) gate, as indicated in FIG. 8 (e.g., Japanese Application No. 61-163088, which corresponds to U.S. Ser. No. 070 491 filed July 7, 1987). In FIG. 8, PNG 1 and PNG 2 are m sequence generators and EOR indicates an exclusive logical sum gate. 
     As an m sequence generator in the form of an IC there is known a construction e.g. as indicated in FIG. 9. In FIG. 9 G 1  ˜G n  are steering gates setting the initial value for shift registers and switching the operation of the shift registers; SR 1  ˜SR n  are flipflops constituting the shift registers; L 1  ˜L 6  are latch circuits; MPX is a multiplexer; AND 0  ˜AND n  are AND circuits; DE-MPX is a demultiplexer; and INV 1 , INV 2  are inverters. Further CLK represents a supplied clock signal; STB an m sequence generation initializing signal; CS a chip select signal; LE a latch enable signal; DAT 0 ˜n data; SEL 0 ˜1 data select signals; FB 0 a feedback input terminal; FB 1 an input terminal to the first stage steering gate; CAS an output for connecting the m sequence generators in cascade; FB 2 a three state output; PN a sequence output; and e,ovs/FBCNT/  a control input terminal of the multiplexer MPX having the three state output. 
     However there are known neither circuits stated above and indicated in FIG. 9 nor prior art m sequence generators having a built-in GOLD code generating circuit. Consequently, when a GOLD code was to be generated, it was necessary to connect an external circuit EX therewith, as indicated in FIG. 10. In FIG. 10 PNG 1 and PNG 2 are m sequence generators; EOR represents an exclusive logical sum gate; and D-FF represents a D-type flipflop. FIG. 11 shows waveforms in different parts of the circuit indicated in FIG. 10. Even if PNG 1 and PNG 2 are constructed by a same kind of ICs, since there are fluctuations in transmission delay time from the clock input CLK to the m sequence outputs PN 1 and PN 2, in the case where the output of the EOR gate is used as a GOLD code,the GOLD code is obtained usually by synchronizing PNG 1 and PNG 2 with a same clock, after the output of the EOR gate has been stabilized in a desired state. 
     For this reason, as indicated in FIG. 12, the GOLD code is outputted with a delay of 1 chip (1 period of clock) with respect to the m sequences PN 1 and PN 2. Such a phase delay of the GOLD code with respect to the n sequences as indicated in FIG. 10 was an inevitable problem, as far as the GOLD code was generated by an external circuit EX. 
     OBJECT OF THE INVENTION 
     The object of this invention is to provide an m sequence generator, in which a GOLD code generating circuit is built-in, permitting to generate easily the GOLD code without external circuit and to obtain the GOLD code having the same phase as the m sequences in synchronism with the clock signal. 
     SUMMARY OF THE INVENTION 
     In order to achieve the above object, an m sequence generator according to this invention, is provided with m sequence generating means comprising exclusive logical sum gates forming exclusive logical sums of two m sequences and flipflops removing hazards from the output thereof. 
     The signals inputted in the flipflops for removing the hazards described above are either the exclusive logical sum of an m sequence input from another device and the output of the first stage of the shift register of the m sequence generating means, and the clock signal, or the exclusive logical sum of the m sequence input from another device and the output of the first stage of the shift register of the m sequence generating means, and a phase inverted signal of the clock signal, or an exclusive logical sum of the m sequence input from another device and the input of the shift register described above, and the clock signal. 
     FIGS. 4 (a) and (b) show two basic constructions of the m sequence generator. In the figures EOR 2  ˜EOR n  are exclusive logical sum gates; SW 2  ˜SW n  are switches; and D-FF 1  ˜D-FF n  are D type flipflops. Here all of them constitute the shift register. FIG. 4 (a) shows a construction, in which the output of each of the D type flipflops D-FF 1  ˜D-FF n-1  is selected by the respective switch SW 2  ˜SW n , operated by the respective EOR 2  ˜EOR n  and the output of EOR 2  is fedback to the first stage D-FF 1  of the flipflops and FIG. 4 (b) shows a construction, in which the output of the last stage D-FF n  is selected by each of the switches SW 2  ˜SW n  and the output of each of the flipflops D-FF 1  ˜D-FF n-1  is operated by EOR 2  ˜EOR n . In general the former is called the simple construction type and the latter is called the modular type m sequence generator. Depending on which stage of the flipflops is selected as the output terminal of the m sequence, the phase of the m sequence obtained at the terminal varies, but the kind thereof is always same. However in the most cases the output of the first stage of the shift register is selected as the output terminal of the m sequence so that no inconveniences are produced, when the number of stages of the shift registers is changed. 
     The m sequence generator according to this invention is constructed so as to be indicated in FIG. 1 (a), FIG. 2 (a) and FIG. 3 (a). Those indicated there are circuits further developed, starting from the circuit indicated in FIGS. 4 (a) and (b). Here the construction, in which the m sequence is obtained from the output of the first stage of the shift register of a modular type m sequence generator, is taken as an example. However the same principle can be applied both to the simple construction type m sequence generator or to the case where the m sequence is outputted from any other stage of the shift register. In any case, the circuits consist of, apart from the shift register, exclusive logical sum gates EOR 2  ˜EOR n  and D-type flipflops D-FF 1  ˜D-FF n  removing hazards from the m sequence output and synchronizing the output with the clock signal. When the m sequence generators PNG 1 and PNG 2 indicated in FIGS. 1 (a), 2 (a) and 3 (a) are connected as indicated in FIGS. 1 (b), 2 (b) and 3 (b), respectively, it is possible to obtain easily the GOLD code. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIGS. 1 (a) and (b), FIGS. 2 (a) and (b) and FIGS. 3 (a) and (b) are block diagrams illustrating the construction of three different m sequence generators and their connections for generating a GOLD code, respectively, according to this invention; 
     FIGS. 4 (a) and (b) are block diagrams illustrating the two basic constructions of the m sequence generator according to this invention; 
     FIG. 5 is a timing chart for a GOLD code output; 
     FIG. 6 (a) is a block diagram illustrating a concrete construction of the m sequence generator according to this invention; 
     FIG. 6 (b) is a block diagram illustrating the concrete construction of a steering gate according to this invention; 
     FIG. 7 is a block diagram of a circuit for switching over the output code; 
     FIG. 8 is a scheme showing the principle of the generation of the GOLD code; 
     FIG. 9 is a block diagram illustrating the construction of a prior art m sequence generating IC; 
     FIG. 10 is a block diagram illustrating the construction of a GOLD code generating circuit; 
     FIG. 11 is a scheme showing waveforms in different parts of the circuit indicated in FIG. 10; and 
     FIG. 12 is a timing chart for the GOLD code output obtained by the prior art circuit indicated in FIG. 10. 
    
    
     DETAILED DESCRIPTION 
     In FIGS. 2 (a) and (b) and FIGS. 3 (a) and (b) PN is an m sequence output terminal; GCN is an m sequence input terminal from another m sequence generator; and GOLD is a GOLD code output terminal. An input terminal of EOR g  is connected with the output of a D type flipflop D-FF (D-FF 1 ) of the m sequence output stage of the shift register and the other input thereof is connected with the GCN terminal. The output thereof is connected with the D input of the D-FF g . In FIGS. 2 (a) and (b) a clock signal, which is in phase with D-FF 1  ˜D-FF n , and in FIGS. 3 (a) and (b) a clock signal, which is in opposit phase therewith, are inputted through the CLK terminal in the D-FF g  and the GOLD code is outputted through the GOLD terminal in synchronism with the clock signal described above. 
     In FIGS. 1 (a) and (b) GCN out  is an output terminal of an m sequence, whose phase is advanced by one chip phase, and GCN in  is an input terminal of an m sequence, whose phase is advanced by one chip phase, coming from another m sequence generator. CODE is a GOLD code output terminal, in the case where an m sequence, whose phase is advanced by one chip phase, is inputted and an m sequence output terminal, in the case where GCN in  is fixed at the low level. An input of EOR g  is connected with the D-FF (D-FF 1 ) input of the m sequence output stage of the shift register and the other input thereof is connected with the GCN in  terminal, while the output thereof is connected with the D input of the D-FF g . 
     The device constructed as indicated in FIGS. 2 (a) and (b) is provided with a GOLD code generating section EX built-in therein, which delays the data output (m sequence) by 1 period of the clock signal by means of the D-FF g , removes hazards from the output of the EOR g  and outputs it. By this construction the GOLD code is outputted, delayed by one chip with respect to the m sequence. 
     In the device constructed as indicated in FIGS. 3 (a) and (b) an antiphase clock is inputted through an inverter NOT g  in the D-FF g , in order to improve further the m sequence generator in this view point. Since the D-FF g  is triggered by the fall of the clock signal CLK, if the duty of the clock is 50%, the delay of the GOLD code generated in synchronism therewith with respect to the m sequence is reduced to 1/2 chip. However, since the tolerence time until the output of the EOR g  gate is stabilized is reduced to a half, i.e. from 1 clock period to 1/2 clock period, the maximum clock frequency is reduced to 1/2 of that for the circuit indicated in FIGS. 2 (a) and (b). 
     The device constructed as indicated in FIGS. 1 (a) and (b) removes all these drawbacks. In the constructions indicated in FIGS. 2 (a) and (b) and FIGS. 3 (a) and (b), since the phase of the input signal is advanced by 1 clock with respect to that of the output signal, an m sequence, whose phase is advanced by 1 chip, is outputted to GCN out . When two devices PNG 1 and PNG 2 of this construction are connected as indicated in FIG. 1 (b), an m sequence of another m sequence generator, whose phase is advanced by 1 chip, is inputted in the GCN 1n  and in the EOR g  two m sequences, whose phase is advanced by 1 chip, are added (exclusive logical sum) modulo 2 to each other. As the result the output of the EOR g  is a GOLD code, whose phase is advanced by 1 chip, but owing to the following D-FF g  a GOLD code, which is in synchronism with the clock signal and in phase with the m sequence, is obtained at the terminal CODE. 
     The device having the construction indicated in FIGS. 1 (a) and (b) has further another advantage that the terminal CODE, which is the GOLD code output terminal, can be at the same time the m sequence output terminal. In the case where the m sequence is outputted through the terminal CODE, it is sufficient to fix the terminal GCN 1n  at the low level. For this reason it is possible to output alternatively the m sequence and the GOLD code through a same output terminal while changing over them. In this way it is possible to obtain special code outputs. 
     FIG. 5 shows timing of the m sequence and the GOLD code output of the m sequence generators indicated in FIGS. 1 (a) and (b), FIGS. 2 (a) and (b) and FIGS. 3 (a) and (b). 
     FIG. 6 (a) shows a concrete construction of the m sequence generator according to this invention based on the basic construction indicated in FIGS. 1 (a) and (b). The device indicated in the figure is of modular type. The code output thereof is taken out through the first stage (input of D-FF 1 ) of the shift register and the device has the basically same construction as that indicated in FIGS. 1 (a) and (b) except for the steering gates G 1  ˜G 2 , the multiplexer MPX and the AND gate AND. By this device it is possible to set the feedback tap by means of the AND gates AND 2  ˜AND n  (i.e. code sequence pattern), the initial value of the shift register by means of the steering gates G 1  ˜G n  (i.e. code sequence phase) and the number of stages of the shift register (i.e. sequence length) so as to be able to output an arbitrary m sequence. In the figure A 2 ˜A n, B 1 ˜B n and C 1 ˜C i are data inputs for setting sequence patterns, sequence phases and sequence lengths, respectively, from the exterior. By obtaining the GCN out  and the input to EOR g  through the output of the steering gate G 1  it is possible to output exactly the GOLD code from the initial value (chip 1 ). The steering gate G may be constructed e.g. by using three NAND gate NAND 1  ˜NAND 3 , as indicated in FIG. 6 (b). 
     FIG. 7 is a block diagram illustrating the construction of an output code switching over circuit, in which T -1  PN 1 is an m sequence, whose phase is advanced by 1 chip, from the device PNG 1 described above and T -1  PN 2 is another kind of m sequences, whose phase is advanced by 1 chip, from another device PNG 2. Further S 1 and S 2 are signals for selecting the codes outputted through the terminal CODE and the codes indicated in TABLE 1 are set, depending on the value of S 1 and S 2. 
     
                       TABLE 1                                                     
______________________________________                                    
Setting of output code                                                    
S 2     S 1         CODE                                                  
______________________________________                                    
L       L           L                                                     
L       H           PN 1 (m sequence 1)                                   
H       L           PN 2 (m sequence 2)                                   
H       L           PN 1 ⊕ PN 2 (GOLD code)                           
______________________________________                                    
 
    
     Since The terminal CODE serves both as the output terminal for 2 kinds of m sequences and as the output terminal for the GOLD code obtained based thereon, it is possible to change over continuously the code outputted through the terminal GOLD without any change of connection. Owing to this fact it is possible to generate special codes, in which the m sequences and the GOLD code are alternatively changed over. 
     As explained above, according to this invention, it is possible to generate easily the GOLD code without external circuit owing to the fact that a GOLD code generating circuit is built-in in the m sequence generator and further an advantage can be obtained that a GOLD code having the phase and timing completely identical to the m sequence output, which could not be realized heretofore without any external circuit. 
     While particular embodiments of the invention have been shown and described, it will be obvious to those skilled in the art that various changes and modifications may be made without departing from broader aspect.