Given a Hexadecimal number as an input, the task is to convert that number to Binary number.
Input: Hexadecimal = 1AC5 Output: Binary = 0001101011000101 Explanation: Equivalent binary value of 1: 0001 Equivalent binary value of A: 1010 Equivalent binary value of C: 1100 Equivalent binary value of 5: 0101 Input: Hexadecimal = 5D1F Output: Binary = 0101110100011111
Approach: A hexadecimal number is a positional numeral system with a radix, or base, of 16 and uses sixteen distinct symbols.
A binary number is a number expressed in the base-2 binary numeral system, which uses only two symbols: which are 0 (zero) and 1 (one).
To convert HexaDecimal number to Binary, the binary equivalent of each digit of the HexaDecimal number is evaluated and combined at the end to get the equivalent binary number.
Below is the implementation of the above approach:
Equivalent Binary value is : 0001101011000101
Alternate Approach :
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Convert a binary number to hexadecimal number
- Program to Convert Octal to Hexadecimal
- Program for decimal to hexadecimal conversion
- Count Hexadecimal Number
- Reverse bytes of a Hexadecimal Number
- Largest Even and Odd N-digit numbers in Hexadecimal Number System
- Check if a HexaDecimal number is Even or Odd
- Check if a string represents a hexadecimal number or not
- Program to Convert Octal Number to Binary Number
- Find the count of natural Hexadecimal numbers of size N
- Check the divisibility of Hexadecimal numbers
- Largest and Smallest N-digit Hexadecimal Numbers
- How to add two Hexadecimal numbers
- Program to Convert BCD number into Decimal number
- Program to convert a given number to words
- Program to convert a given number to words | Set 2
- Program to convert given number of days in terms of Years, Weeks and Days
- Program to convert Number in characters
- Program to convert Hexa-Decimal Number to its equivalent BCD
- Program to convert a BCD to Hexa-Decimal Number