More bitwise operations for gray_code.