Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main(num):
- num = int(num, 16)
- L1 = str((num >> 0) & 0b1111_1111_1)
- L2 = str((num >> 9) & 0b1111_11)
- L3 = str((num >> 15) & 0b11)
- L4 = str((num >> 17) & 0b1111_1)
- L5 = str((num >> 22) & 0b1111_1)
- return [('L1', L1), ('L2', L2), ('L3', L3), ('L4', L4), ('L5', L5)]
- if __name__ == "__main__":
- print(main('0x4953ddc'))
- print(main('0x1460225'))
- print(main('0x1f8e3d0'))
- print(main('0x3f80948'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement