Ground State and Electronic Properties of Silicon Carbide and Boron Nitride