Formation of TiN phase in SiO2 and Si through ion implantation of constituent elements