Fabrication of semiconductor nanowire multifunctional devices