Abstract. Based on the density functional theory (DFT), we predict electronic properties of the non-periodic structure and the periodic structure of carbon nanotubes (CNTs) and silicon nanotubes (SiNTs). In the simulation process, we studied how to increase the length of nanotubes or add H atoms to dangling bond to describe the feasibility of the non-periodic structure. The results show that, for the non-periodic structure of CNTs, compared with only increasing the length of the nanotubes, the simulation result of adding H atoms to dangling bond is better. For the non-periodic structure of SiNTs, the simulation result of increasing the length is more reasonable.