Orthogonal frequency-division multiple access (OFDMA) has been integrated into emerging broadband wireless systems such as the IEEE 802.16 WirelessMAN. One critical problem in OFDMA is to assign multiple frequency bands (called subcarriers) to different users. Taking advantage of the frequency and multiuser diversities in OFDMA systems, dynamic subcarrier assignment mechanisms have been shown to achieve much higher downlink capacity than static assignment. A rich literature exists, which proposes medium-access-control- and physical-layer (MAC/PHY) schemes, aiming at exploiting the diversity gain with low implementation complexity. In this paper, we propose a cross-layer approach that explores the joint advantage of network coding and dynamic subcarrier assignment. With network coding, it becomes possible to assign the same subcarriers to different downlinks without causing interference. Consequently, our coding-aware assignment scheme improves the bandwidth efficiency and increases the downlink throughput by a substantial margin. In designing the scheme, we identify a tradeoff between diversity gain and the network coding advantage, which is critical to network performance in terms of throughput and fairness. To explore the tradeoff, we formulate the coding-aware assignment scheme as a mixed integer program and design a polynomial-time approximation algorithm that can be used in practical systems. We prove the asymptotic performance bound of the algorithm and demonstrate that it closely approximates the optimum under realistic experimental settings.