From smartphones to data centers, modern electronics rely on billions of tiny switches that consume electricity every time they turn on or off.