Hexidecimal to Binary question

In summary, when converting from hex to binary, you simply convert each hex digit to its binary equivalent. This can be done by clumping groups of four binary digits into one hex digit. The powers of 2 are automatically taken care of in this process.
  • #1
Aristotle
169
1

Homework Statement


After being given a decimal base 10 #: 716, I've converted it to hexidecimal and got 2CC. However, if I want to convert 2CC to BINARY, do I find numbers of base 2s that ADD up to 716 ( 1011001110) OR do I find binary values for 2 , C , C separately? (Such as 0010 1100 1100)

Homework Equations


Bases of 2 values:

512 256 128 64 32 16 8 4 2 1
 
Physics news on Phys.org
  • #2
Aristotle said:

Homework Statement


After being given a decimal base 10 #: 716, I've converted it to hexidecimal and got 2CC. However, if I want to convert 2CC to BINARY, do I find numbers of base 2s that ADD up to 716 ( 1011001110) OR do I find binary values for 2 , C , C separately? (Such as 0010 1100 1100)

Homework Equations


Bases of 2 values:

512 256 128 64 32 16 8 4 2 1
Converting from hex to binary is very simple: just convert each hex digit to its binary equivalent. So 2CC16 is just as you have it, 0010 1100 11002. All the powers of 2 are automatically taken care of.
 
  • #3
Mark44 said:
Converting from hex to binary is very simple: just convert each hex digit to its binary equivalent. So 2CC16 is just as you have it, 0010 1100 11002. All the powers of 2 are automatically taken care of.
Ah okay so in never the case you never want to expand the bases to find what sums to 716...but have to break them apart in 4 bits?
 
  • #4
Aristotle said:
Ah okay so in never the case you never want to expand the bases to find what sums to 716...but have to break them apart in 4 bits?
I'm not sure I understand your question. If you have converted 71610 to hex, you have already done all of the hard work. Going one more step in converting hex to binary is very simple -- just convert each hex digit to its binary equivalent.
 
  • #5
Either. But when you realize that, you will see that one of your answers has an error. Find which one, and you should be happy.
 
  • #6
Mark44 said:
I'm not sure I understand your question. If you have converted 71610 to hex, you have already done all of the hard work. Going one more step in converting hex to binary is very simple -- just convert each hex digit to its binary equivalent.

So let's say my Hexidecimal value was actually 2CC.AB851EB...to Binary it would be 0010 1100 1100. 1010 1011 1000 0101 1110 1011 ?
 
  • #7
Aristotle said:
So let's say my Hexidecimal value was actually 2CC.AB851EB...to Binary it would be 0010 1100 1100. 1010 1011 1000 0101 1110 1011 ?
Yes. I'm assuming that you have converted each hex digit correctly -- I didn't check.

A simpler example would be 10.2510. In hex, this would be A.4 (10 + 4/16). The direct binary conversion would be 1010.0100 . This is not how numbers with decimal fractions are actually stored, but I don't think that's what you're concerned with.
 
  • #8
Mark44 said:
Yes. I'm assuming that you have converted each hex digit correctly -- I didn't check.

A simpler example would be 10.2510. In hex, this would be A.4 (10 + 4/16). The direct binary conversion would be 1010.0100 . This is not how numbers with decimal fractions are actually stored, but I don't think that's what you're concerned with.
Thank you for the help!
 
  • #9
Mark44 said:
Yes. I'm assuming that you have converted each hex digit correctly -- I didn't check.

A simpler example would be 10.2510. In hex, this would be A.4 (10 + 4/16). The direct binary conversion would be 1010.0100 . This is not how numbers with decimal fractions are actually stored, but I don't think that's what you're concerned with.
Wait last question...
So if say I had a NUMBER in hexidecimal like
42.2B ...converting that to BINARY...
just like the example you shown...
would you convert 42 to 0100 0010 ?
 
  • #10
Aristotle said:
Wait last question...
So if say I had a NUMBER in hexidecimal like
42.2B ...converting that to BINARY...
just like the example you shown...
would you convert 42 to 0100 0010 ?
0100 = 4
0010 = 2

Just like with 2CC we did binaries separately. or is numbers an exception?
 
  • #11
Aristotle said:
Wait last question...
So if say I had a NUMBER in hexidecimal like
42.2B ...converting that to BINARY...
just like the example you shown...
would you convert 42 to 0100 0010 ?
Yes.

4216 means 4 X 16 + 2 X 1, right?
In the 0100 group, the rightmost 0 bit is the number of 16s. The next digit to the left (0) is the number of 32's. Continuing to the left, the 1 digit is the number of 64's, but 1 times 64 is the same as 4 times 16. So 0100 0010 means 1 X 64 + 2 X 1, which is the same as 4 X 16 + 2 X 1. Instead of dealing with all those powers of 2 (1, 2, 4, 8, etc.), it's easier to deal with powers of 16 (1, 16, 256, 4096, etc.) by clumping each group of four binary digits into one hex digit. As I said, it's very easy going back and forth between hex and binary, but much harder to convert from either of those bases to base 10 or vice versa.
 
  • Like
Likes Aristotle

1. What is the difference between hexadecimal and binary?

Hexadecimal is a base-16 numbering system that uses 16 different symbols (0-9 and A-F) to represent numbers, while binary is a base-2 numbering system that uses only two symbols (0 and 1) to represent numbers.

2. How do you convert a hexadecimal number to binary?

To convert a hexadecimal number to binary, you can break the number into groups of 4 digits and then use a binary to decimal conversion chart to convert each group to its binary equivalent. Then, combine all the binary digits to get the final binary representation.

3. Can you convert any hexadecimal number to binary?

Yes, any hexadecimal number can be converted to binary using the method mentioned above. However, the number of digits in the binary representation will depend on the number of digits in the hexadecimal number.

4. Why is hexadecimal often used in computer programming?

Hexadecimal is often used in computer programming because it is more compact and easier to read and write than binary. It is also more convenient for representing and manipulating large binary numbers, making it a useful tool for programmers.

5. Is there a quick way to convert hexadecimal to binary?

Yes, there are several online converters and computer programs that can quickly convert hexadecimal to binary. You can also use the built-in conversion functions in programming languages like Java and Python to convert numbers between different bases.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Programming and Computer Science
Replies
3
Views
962
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
Replies
4
Views
929
  • Engineering and Comp Sci Homework Help
Replies
2
Views
10K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top