Nanowire electromechanical logic switch