Motivated by the possibility of scaling down of various electronic devices at the nanolevel, we have chosen a simple p-n junction like device in silicon structure. An aggregation of seventy-eight silicon atoms, passivated by oxygen is considered. We compute the electronic structure of such a cluster and then the density of states and the optical spectra for this aggregate are compared with a modified one. The modification is introduced by substituting phosphorus and boron atom within this cluster of silicon atoms in both sides in order to make a p-n junction like situation. A variant of this p-n junction like structure is introduced by adding a layer of oxygen between the phosphorus and boron regions. Comparison of the electronic structures of all these systems reveals several interesting properties.