We present a numerical study of the electronic properties of various structural models of amorphous silicon and hydrogenated amorphous silicon. Starting from an ideal random network, dangling bonds, floating bonds, double bonds, microvoids, hydrogenated dangling bonds, and hydrogenated floating bonds are introduced. The concentrations of these defects can be varied independently, the amount of disorder introduced to the system is therefore strictly controllable. Two continuous random networks, the vacancy model of Duffy, Boudreaux, and Polk and the bond switching model of Wooten, Winer, and Weaire ͑WWW model͒ are investigated. For the relaxation of the structures the potentials of Keating and of Stillinger and Weber are employed. The electronic structure is described by a tight-binding Hamiltonian; the localized or extended character of the eigenstates is investigated via a scaling approach. The vacancy model shows a band gap for small defect concentrations but this fills up with increasing disorder. Similar behavior is found for the case of the other models. In general defects introduce states into the gap region of a-Si, where the dangling bonds lead to the largest density of states in the gap region for a given defect concentration. This model turns out to be unique. For small system sizes an impurity band results that dramatically changes its character for large systems above 4000 atoms to a nearly uniform density of states as observed experimentally. In a-Si:H the dangling and floating bonds are removed and a mobility gap results with a width in good agreement with experiment. The experimentally observed tailing of the band into the gap region ͑first linear, then exponential͒ is well described only for the a-Si:H model derived from the vacancy model and for very large system sizes above 4000 atoms. The WWW model does not lead to this tail behavior. Localized states are found at all band edges but states at the bottom of the conduction band are more strongly localized than those at the top of the valence band.