Wednesday, January 2, 2019

Converting Decimals to Binary Numbers the Easy Way


In a previous post, I showed what binary numbers are.  We need to understand know how to convert binary numbers to decimal numbers before we proceed.  

There are a few ways to do this but I am going to show you the easiest way.

So to get the idea lets start with number 7.

We know that this will the some of some roots of 2ⁿ.

Lets figure out how to count in binary but before we do that lets see how we count by going up digits  in the decimal system: (this is counting by successive decades instead of units)

1 10 100 1000 10,000 100,000 1,000,000 .............

We count the same way in binary:
1 10 100 1000 10000 10000 1000000

 If we wanted to figure out what the value of a binary digit in the decimal system, it would be as follows:

 1=2⁰ =1 10=2¹=2  100=2²=4 1000= 2³=8

or

n   1 2 3 4  5  6   7   8     9     10    11    12     13     14     15       16       17       18         19           20
n-10 1 2 3 4   5   6   7     8     9     10     11     12     13     14       15       16       17         18          19
2ⁿ  1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524,288

If you want to make your own list by expanding the series above, just keep multiplying by 2.  This list will allow you to express binary in a decimal value up to 1,000,000 .

Example

 Find the binary equivalent of 7 in the decimal system.  

First we find the largest number on our list less than 7 and that is 4.   4 is represent by 100 in binary


We will subtract 4 from 7:  7-4=3 and we will find the highest number on our list less than or equal to 3 and that is 2 or 10. We will subtract 2 from 3-2=1

So 7 in decimal is 111 in binary.

What did we just do in this example?  We ended up finding the highest digit and then subtracted to find the remainder so we can find the next highest digit and so on.  It is an easy process, but with large numbers, there can be many steps.

Okay lets find the binary equivalent of the decimal 892.
512 is the largest number on our list less than 892.   n-1=9 so n = 10.       892-512=378
256 is the largest number under 378 on our list so n=9. 378-256=122
64 is the largest number under 122 on our list so n=7. 122-64=58
32 is the largest number under 58 so n=6.  58-32=26
16 is the largest number under 26 so n=5.  26-16=10
8 is the largest number under 10 so n=4. 10-8=2
2 is at n=2

Our answer is:  1 1 0 1 1 1 1 0 1 0 or 1101111010
 Place:             10 9 8 7 6 5 4 3 2 1

To learn the concepts pick some large decimal numbers and convert into binary and use a decimal to binary calculator to check your answer.





No comments:

Post a Comment