def hex_to_bits(hex_num):
# Convert the hex number to an integer
decimal_num = int(hex_num, 16)
# Convert the integer to binary and remove the "0b" prefix
binary_num = bin(decimal_num)[2:]
# Return the binary number (padded to 4 bits for each hex digit if needed)
return binary_num.zfill(len(hex_num) * 4)
# Example usage
hex_num = "0x7e804000"
hex_num = hex_num.replace('0x', '')
binary_rep = hex_to_bits(hex_num)
print(f"Hex: {hex_num} -> Bits: {len(binary_rep)}")
if len(binary_rep) == 32:
print ("LEGACY")
else:
print ("ARM")