def reflect(data, width):
    """Ceflect a data word, means revert the bit order."""
    reflected = data & 1
    for _ in range(width - 1):
        data >>= 1
        reflected = reflected << 1 | data & 1
    return reflected
