graycode = (n >> 1)^n