NOTE: The program below is written in the form of a straight forwards 'table/look up' chart. It will, quite simply, convert no more than 1 single hex digit character, at a time, into its binary number equivalent.
If you wish to convert a whole entire string of hex digit characters together at once; then, I suggest you will need to 'modify' the program yourself by using, possibly, a 'FOR/NEXT loop' statement to extract out each separate hex character which needs to be converted from the users input/together with a function such as, 'MID$()'.
====
Here is a sample program RUN/Output...
Please, enter your single character hex digit(0-9/A-F):
? C
The binary equivalent of the above hex digit is:
1100
16 is the 4th power of 2. So a hexadecimal number is converted to binary by replacing each hex digit by the 4-bit binary number having the same value. Conversely, in converting binary to hexadecimal, we group every 4 bits starting at the decimal (binary?) point and replace it with the equivalent hex digit. For example, the hexadecimal number 3F9 in binary is 1111111001, because 3 in binary is 11, F (decimal 15) is 1111, and 9 is 1001.
To store the hexadecimal number FF, we need to convert it to binary first. FF in hexadecimal is equivalent to 1111 1111 in binary, which requires 8 bits to represent. Each hexadecimal digit corresponds to 4 bits in binary, so two hexadecimal digits (FF) require 8 bits to store.
0X at the beginning represent a number in the hexadecimal system of units. FFFF is the hexadecimal equivalent of i) 65535 in decimal system of units ii) 1111111111111111 in binary system of units
Write algorithms and draw a corresponding flow chart to convert a decimal number to binary equivalent?
0xc = 1100 Hexadecimal digits use exactly 4 binary digits (bits). The 0x0 to 0xf of hexadecimal map to 0000 to 1111 of binary. Thinking of the hexadecimal digits as decimal numbers, ie 0x0 to 0x9 are 0 to 9 and 0xa to 0xf are 10 to 15, helps with the conversion to binary: 0xc is 12 decimal which is 8 + 4 → 1100 in [4 bit] binary.
The binary equivalent of the hexadecimal number EF16 is 1110111100010110.
1101111010101101 in binary is equal to DEAD in hexadecimal.
01
ABCD1 = 10101011110011010001
Octal = 52746757 Binary = 101010111100110111101111
The binary number 01011010 is 005A in hexadecimal.
hex =7
1111010110100011 = F5A3
1100010000111010
72 = 111 7Hex = 7
16 is the 4th power of 2. So a hexadecimal number is converted to binary by replacing each hex digit by the 4-bit binary number having the same value. Conversely, in converting binary to hexadecimal, we group every 4 bits starting at the decimal (binary?) point and replace it with the equivalent hex digit. For example, the hexadecimal number 3F9 in binary is 1111111001, because 3 in binary is 11, F (decimal 15) is 1111, and 9 is 1001.
Convert each group of 4 bits into one hexadecimal digit. 1010 is "A" in hexadecimal, so this particular number is "AA".