Hexa to Decimal Conversion, Binary to Decimal Conversion?

  • Thread starter kloong
  • Start date
  • Tags
    Binary
In summary: To convert a negative decimal number to 2's complement, start by writing out the number in binary (in this case, 101). Then flip all the bits (1s become 0s, 0s become 1s) and add 1 to the result. This will give you the 2's complement form. In summary, to convert 101010.0101B to decimal, use powers of two instead of powers of ten. For the Hexa number 17DB.C, you can use a shortcut by writing out the binary equivalent of each hexadecimal digit. To convert -101 (decimal) to
  • #1
kloong
36
0

Homework Statement


1) How to convert 101010.0101B to decimal?

2) and Hexa number 17DB.C to Binary.

3) and lastly, -101 (decimal) to the 2's complement form.


Homework Equations





The Attempt at a Solution


for the first one, clearly my problem lies at .0101B. I thought it's 1X10^-2 + 1X10^-4. Is it correct?

for the second one, I am not sure what the answer is because of the ".C"

third, i know how to do 2's complement for those without negative. So how should i do those with negative sign?
 
Physics news on Phys.org
  • #2
There isn't really a standard for decimals in binary - you normally use IEEE floating point format.
But I would interpret the digits after the decimal point to be 1/2, 1/4, 1/8 etc as you have done.
Again for 2, I would say the decimal is 0xC/0x10 = 12/16=0.75

This is a good explanation of twos complement http://en.wikipedia.org/wiki/Two's_complement
 
  • #3
kloong said:
1) How to convert 101010.0101B to decimal?

You're on the right track, but use powers of two instead: 1X2^-2 + 1X2^-4.

You can check your answer with a decimal/binary converter (one that converts fractional values as well as integers), such as the one I've written: http://www.exploringbinary.com/binary-converter/

kloong said:
2) and Hexa number 17DB.C to Binary.

Do you know how to convert the 17DB part? There's a shortcut, and it involves writing out the binary equivalent of each hexadecimal digit. Once you know that, the .C part is similar.
 

1. What is the process of converting hexa to decimal?

The process of converting hexa to decimal involves the use of the base 16 system. Each digit in hexa represents a value from 0 to 15, and the letters A to F represent the values 10 to 15. To convert, you multiply each digit by its corresponding power of 16 and then add the results together.

2. How do you convert binary to decimal?

To convert binary to decimal, you use the base 2 system. Each digit in binary represents a value of 0 or 1. To convert, you multiply each digit by its corresponding power of 2 and then add the results together.

3. What is the difference between hexa and decimal?

The main difference between hexa and decimal is the base system that they use. Hexa uses a base 16 system, while decimal uses a base 10 system. This means that hexa has 16 digits (0-9, A-F) while decimal has 10 digits (0-9).

4. Can you convert between hexa and decimal without using a calculator?

Yes, it is possible to convert between hexa and decimal without using a calculator. However, it may be more time consuming and prone to errors compared to using a calculator or a conversion tool.

5. Why is hexa and binary used in computer programming?

Hexa and binary are used in computer programming because they are more efficient for representing and manipulating data. Since computers use a binary system, it is easier to work with binary and hexa numbers as they can be easily converted to and from binary. Additionally, hexa numbers are more compact and can represent larger numbers with fewer digits compared to decimal numbers.

Similar threads

Replies
4
Views
908
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Programming and Computer Science
Replies
3
Views
960
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
6
Views
1K
  • Computing and Technology
Replies
4
Views
744
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
2K
Back
Top