answersLogoWhite

0

A decimal number is built in binary from right to left, using the symbols 1 and 0 to represent powers of 2 . It starts with 20 and goes on until the decimal number has been reached in the form of 2n + ...... + 20.

Although the number is built from right to left, starting with the lowest 20, the actual conversion starts from left to right with the highest power of 2 that can go into your number.

step 1: Start with the highest power of 2 that goes into your number and subtract it, and put a 1 in the placeholder for its power.

step 2: See if the next power of 2 down goes into your number

step 3: If it goes in, subtract it from the remaining decimal number and put a 1 in it's power placeholder. If it doesn't go in, don't subtract, put a zero in its placeholder and move on to the next power.

step 4: Repeat steps 2 and 3 until you arrive at 20

step5: Build your binary number from the powers of 2 placeholders, starting with the highest and ending with the lowest.

Let's start with an example decimal number 750.

210 = 1024 is too much, so start with the next power.

29 = 512 can be subtracted from 750, leaving 238; put a 1 in its place.

28 = 256 can't be subtracted from 238; put a 0 in its place.

27 = 128 can be subtracted from 238, leaving 110; put a 1 in its place.

26 = 64 can be subtracted from 110, leaving 46; put a 1 in its place.

25 = 32 can be subtracted from 46, leaving 14; put a 1 in its place.

24 = 16 can't be subtracted from 14; put a 0 in its place.

23 = 8 can be subtracted from 14 leaving 6; put a 1 in its place.

22 = 4 can be subtracted from 6, leaving 2; put a 1 in its place.

21 = 2 can be subtracted from 2, leaving 0; put a 1 in its place.

20 = 1 can't be subtracted from 0; put a 0 in its place

This builds the binary number: 1011101110

Which I'm guessing still looks foreign to you, but remember it it represents powers of 2.

29 + 0(28) + 27 + 26 + 25 + 0(24) + 23 + 22 + 21 + 0(20) = 1011101110 = 750

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
JudyJudy
Simplicity is my specialty.
Chat with Judy
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan

Add your answer:

Earn +20 pts
Q: Tell me the rules of convert decimal into binary?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What can you tell as a conclusion to binary trees?

conclusion about binary tree


Number 15 in binary form?

Rather than tell you what the answer is, I think it better that you learn how to do this your self. By asking the question you must realize that each binary digit can have a value of one or zero. Just like with decimal numbers, the digit of lest value is on the right and has a decimal value of one. The digit immediately to its left has a value that is twice that of it neighbor to the right and also half the value of its neighbor to the left.Here is the decimal values of 8 binary digits.[128][64][32][16][8][4][2][1] decimal value( 8)( 7)( 6)( 5)(4)(3)(2)(1) digit placeLets convert 25 decimal into binary.The largest decimal value that can be subtracted is 16 with 3 digits to the left, write down 3 zeros as place holders for the 3 left digits. Follow by a one.000125 - 16 = 9The next binary digit to the right has a decimal value of 8 and can be subtracted from 9 so we write down another 1.000119 - 8 = 1Now for each binary digit that has a decimal value greater than the remainder write a zero.0001100Now there is just the 1 left to deal with. Any time there is only 1 left you can just write down a 1.00011001So with that short intro to converting decimal into binary you should be dangerous enough to do your own decimal to binary conversions. (If still in doubt try, Google for an explanation that makes more sense to you).


Why or why not can all numbers be represented in a binary system?

All numbers can be represented in a binary number system. Binary is the base 2 number system, meaning that there 2 possible values per place: 0 and 1. A decimal system allows for 10: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. In a decimal system, you carry out and add a space once you pass 9. Thus, you end up with a 1 in the second place and a 0 in the first. The first space then counts up again. Similarly, a binary system adds a place when it reaches 2. In a decimal system, there are 10x numbers which can be represented by a system with x places. In binary, there are 2x possible numbers. If the number of places is infinite, an infinite number of values can be represented. Negative numbers can be represented in a variety of ways, from a dash as is commonly used in decimal to a 2's complement to a sign bit (i.e. a 1 or a 0 which will tell the reader or the machine the sign of the number).


How do you count all structurally different possible Binary Trees?

please tell me answer of this question. Suppose you are building an N node binary search tree with the values 1...N. how many structurally different binary trees is there that store those values? write a recursive function that, gives the number of distinct values, computes the number of structurally unique binary search trees that store those values. For example, countTrees(4) should return 14, since there are 14 structurally unique binary search trees that store 1,2,3 and 4. The base case us easy, and the recursion is short but dense. your code should not construct any actual trees; it's just a counting problem.


Why binary search algorithm did not work on an unsorted array?

The binary search algorithm works by successively halving the array and determining which half the result lies in, or if the half-way point is the result. In order for that to work, the array must be in order, otherwise choosing the half-way point would be meaningless because it would not tell you which half of the array the result is located in.