How Can I Convert Binary to Decimal?

  • Thread starter EugP
  • Start date
  • Tags
    Binary
In summary, converting from decimal to binary can be done using the division-by-powers of two method or by using unsigned multiply of binary numbers. The division-by-powers of two method involves dividing the number by 2 and looking at the remainder each time. Another method is to start with the most significant digit of the decimal input and use a binary accumulator to convert each digit. To convert binary to decimal, one can use a similar approach by multiplying the binary number by powers of 10 and adding the digits.
  • #1
EugP
107
0
I'm trying to figure out how to convert from decimal to binary. I've read a few explanations but I still don't understand. Could someone please help?

The method I've read about invloved dividing the number you want to convert, by 2 each time, and looking at the remainder.
 
Engineering news on Phys.org
  • #2
Go back to papers and find out how decimal and binary are related.
you will find the answer for question yourself.
 
  • #4
MATLABdude said:
Here you go:
http://www.wikihow.com/Convert-from-Decimal-to-Binary

If you're first starting out, use the division-by-powers of two method, as this is conceptually easier.

an alternative method, if you have the means to do unsigned multiply of binary numbers, is to:

1. start with the Most Significant Digit of the decimal input.
2. initialize your binary accumulator to zero (then you may skip to step 4. if you like).
3. multiply the binary accumulator by 10 (00001010 in base 2).
4. add that digit, 0 to 9, to the binary accumulator.
5. move to one less significant digit (right by one place in the decimal input number).
6. if there are any remaining digits, loop back to step 3.
7. if no remaining digits, you're done; converted number in binary accumulator.

it's pretty easy to code that in C or assembly language.

now, how 'bout a nice and clean way to convert binary to decimal? know how to do that?
 

What is the process for converting a decimal number to binary?

The process for converting a decimal number to binary involves dividing the decimal number by 2 and recording the remainder. This remainder is then divided by 2 again and the remainder is recorded. This process is repeated until the quotient is equal to 0. The remainders are then read in reverse order to get the binary representation of the decimal number.

Why do we need to convert decimal numbers to binary?

In computer science, binary is the language that computers use to represent and process data. Therefore, it is necessary to convert decimal numbers to binary in order for computers to understand and work with them.

What is the relationship between decimal and binary numbers?

Decimal and binary numbers are both number systems used to represent numerical values. The main difference is that decimal uses a base 10 system, while binary uses a base 2 system. This means that in decimal, each place value is 10 times greater than the one before it, while in binary, each place value is 2 times greater.

Can all decimal numbers be converted to binary?

Yes, all decimal numbers can be converted to binary. However, some decimal numbers have repeating decimal representations in binary, making the conversion process infinite. In these cases, the binary representation is rounded to a certain number of digits.

Are there any shortcuts or tricks for converting decimal to binary?

Yes, there are a few tricks that can make converting decimal to binary quicker and easier. One method is to group the decimal number's digits into sets of 4 and use a binary chart to quickly convert each set to 4 binary digits. Another method is to use the doubling and subtracting technique, where you start with the largest power of 2 that is less than the decimal number and subtract it, then continue doubling and subtracting until the remainder is 0.

Similar threads

Replies
4
Views
907
  • Electrical Engineering
Replies
14
Views
793
  • Electrical Engineering
Replies
7
Views
2K
Replies
10
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • Electrical Engineering
Replies
10
Views
1K
Replies
55
Views
3K
  • Electrical Engineering
Replies
20
Views
1K
  • Electrical Engineering
Replies
5
Views
1K
  • Programming and Computer Science
2
Replies
57
Views
3K
Back
Top