Device-to-device (D2D) communication is a viable solution proposed by the Third Generation Partnership Project (3GPP) to handle the enormous number of devices and expected data explosion in 5G. It is competent in enhancing the system performances such as increased data rate, reduced delay, and less power consumption while maintaining a low load on the base station (BS). In this paper, channel assignment and power control scheme is proposed for underlay D2D system where one cellular channel is allowed to be shared among multiple D2D pairs. This will lead to enhanced spectral efficiency on the cost of additional interferences introduced among the D2D and cellular users (CUs). Our aim is to maximize the D2D throughput without degrading the performance of existing CU that is sharing the channel with D2D. This is achieved by maintaining a threshold signal-to-interference-plus-noise ratio (SINR) for each CU. A centralized channel assignment algorithm based on the well-known two-sided preference Gale-Shapley algorithm is proposed, named as RAbaGS-HR. Further, suboptimal distributed power control (DPC) algorithms are proposed for both uplink and downlink D2D. The novelty of the work lies in the facts that a channel is shared among multiple D2D users and the optimal power is calculated for all the users sharing the same channel under the full consideration of all kinds of interferences unlike most of the existing work that either assumed the fixed CU power or ignored the interferences among the D2D users. Numerical results show the efficacy of the proposed algorithms in terms of significant gain in throughput with a very low computational cost. In addition to this, the energy efficiency (EE) is also analyzed for different D2D user density, with respect to average circuit power consumption and D2D maximum transmit power.