In: Computer Science
Convert the hexadecimal number directly to base 4; then convert both the original number and your answer to binary to check your result.
Please show steps and explain
Let us consider the decimal value 256
In order to find the hexadecimal value, we will divide the above number using base 16
The number is divided until we get the quotient as 1
Number | Remainder | Quotient |
256 | 0 | 16 |
16 | 0 | 1 |
We will write the last quotient as Most Significant bit and other remainders from bottom to up
256 in decimal = (100)16
Hexadecimal to Base 4 conversion
To convert Hexadecimal to base 4, we need to know both the tables.
Here is the table till decimal value 0 to 7
In Base 4, we will have the range from 0 to 3 only
Hex | Base 4 |
0 | 00 |
1 | 01 |
2 | 10 |
3 | 11 |
(100)16 = (01 00 00)4
Base-4 to Binary
4 can be written as 22
Every digit in Base 4 will be written in binary using two bits
0 in base 4 = 00 in binary
1 in base 4 = 01 in binary
Therefore, (01 00 00)4 = 00 01 00 00 00 00 = (100000000)2
Similarly, for octal, every digit will be written in binary using three bits as 23 =8
For Hexadecimal, every digit will be written using four bits as 24 = 16
256 in binary is
Number | Remainder | Quotient |
256 | 0 | 128 |
128 | 0 | 64 |
64 | 0 | 32 |
32 | 0 | 16 |
16 | 0 | 8 |
8 | 0 | 4 |
4 | 0 | 2 |
2 | 0 | 1 |
We will write the last quotient as Most Significant bit and other remainders from bottom to up
The number in binary is (100000000)2
We have successfully got the same binary representation.
A humble request. If you liked the answer please don't forget to like or upvote it. Your appreciation motivates experts to help other students too. Thank you :)