The key feature of the third-generation (3G) wireless communication networks is the ability to dynamically support a variety of multimedia service. In order to satisfy the requirements of multimedia services with variable data rates, the orthogonal variable spreading factor (OVSF) codes, adopted by the third-generation partnership project technical specifications, are used as channelization codes. This paper presents a fast and efficient code word generation method for multiple codes assignment system. Our code word generation method can find the optimal code word under the constraint of an assigned code amount, under the constraint of a maximal resource waste ratio, and under the constraint of realistic situation of the current residual codes. The computational complexity of the code word generation method is bounded by the amount of the assigned OVSF code, and by the layers of the OVSF code tree. From the simulation results, we show that using two or three codes or the resource waste ratio is <= 40% is sufficient to achieve a high level of performance. (C) 2008 Elsevier B.V. All rights reserved.