This document proposes a low-complexity water filling algorithm to allocate subcarrier, bit, and power resources in an OFDM-based cognitive radio system with multiple primary user frequency bands. The algorithm aims to maximize the cognitive radio user's transmission rate while ensuring the interference power imposed on each primary user remains below an acceptable threshold. It formulates the resource allocation problem as a multidimensional knapsack problem and solves it through a water filling approach. Simulation results show the algorithm can allocate resources optimally under interference and power constraints.