graycode calculation example