code: def reflect(self, data, width):
          
          x = data & 0x01
          for i in range(width - 1):
              data >>= 1
              x = (x << 1) | (data & 0x01)
          return x
docs: reflect a data word, i.e. reverts the bit order.