A method and apparatus for generating a code in an asynchronous code
division multiple access mobile communication system is provided.
Specifically, the method and apparatus are for use in a transmitter in a
mobile communication system which has multiple code groups having
inherent code indices in response to each of slots, which selects one
code group from among the multiple code groups, and which generates a
second synchronization code corresponding to any one slot from among
multiple slots, which are included in the selected code group. The method
and apparatus determine position information designating a Hadamard code
necessary for generating the second synchronization code by performing
the steps of (1) in response to any one slot, outputting a value, which
is obtained by subtracting 1 from a code index included in the selected
code group, as a binary bit row; and (2) selecting one bit row, which
employs the binary bit row as an upper bit and employs a binary code
"0000" as a lower bit, as position information which designates the
Hadamard code.