Doping is a key technology in modern semiconductor industry. With reduced size of semiconductor devices, quantum effect becomes significant, and the classic theory for device design will no longer be valid. Thus the traditional doping technology is facing a great challenge. On the other hand, the third generation wide-gap semiconductors like GaN, ZnO and TiO2 have great application potential in optoelectronics and microelectronics due to their wide band gap, direct gap character and good stability. However, there is a doping bottleneck on the p-type doping of these materials. In the field of application of semiconductor technology, doping mechanism in photocatalysis, spintronic materials, and novel two-dimensional (2D) semiconductors are also the frontier of research. The research in this project focuses on the above key topics. The primary discoveries include the follows: (i) Based on first-principles band structure calculations and analysis of the band-edge wave function characters, we proposed that passivated (Mo+C)-doped TiO2 is a strong candidate for hydrogen production through water splitting. The results received highly attention from the experts in the field of photocatalysis, and the feasibility was confirmed by recent experimental studies. (ii) We discovered that the presence of spontaneous magnetization in nitrides and oxides with sufficient holes is an intrinsic property of these first-row d0 semiconductors. The origin and enhancement of such hole-induced ferromagnetism is studied, which suggested new possibility of preparing non-magnetically doped spintronic semiconductor devices. (iii) We systematically studied the doping mechanism and bottleneck of donor and acceptor impurities in quantum dots and quantum wires. Due to the effect of quantum confinement effect, the energy of the conduction band minimum (CBM) increases whereas that of the valence and maximum (VBM) decreases. We found that defect formation energy and transition energy level increase when the size of the quantum dot (QD) decreases, leading to the self-purification effect and degrade the performance of devices. Focused on this problem, we proposed the approach of overcoming the doping bottleneck in nanostructures, and developed a model to describe the quantum Stark effect in hole impurity state of quantum dots. These works promoted the research in the application of nano-devices. (iv) For the first time, the band alignment between two-dimensional transition-metal dichalcogenides MX2 (M=Mo, W; X=S, Se, Te) is calculated. We predicted the type-II band alignment in MoX2/WX2 heterostructures. In addition, direct-indirect gap transition and semiconductor-metal transition in strained MoS2 is observed. Moreover, we studied the mechanical, optical properties and band gap modulation of graphyne, a new allotrope of carbon, and discovered that Ca-doped graphyne had high capacity of hydrogen storage. The project has attracted great attentions, and the related publications are highly cited by researchers all over the world. These works bring better understanding of semiconductor doping theory, and have important scientific value for the device design and property prediction of new generation semiconductors and nano-devices.