Logic and memory elements using two-valley semiconductors