Decimal to binary, Decimal to Octal confusion

In summary: However, he would use numbers such as: 25 and nothing that had a decimal point. Well, the number is 369.3125 decimal. To convert to binary, it worked fine for the whole number 369 by just dividing by the desired base, so since i wanted binary, i would divide by 2 and the remainder of each would be the number in binary. Also, if I wanted to convert decimal to octal, i could just keep on divding by 8, and so on. However, as you can see, I can't figure it out how you figure out the .3125 of the number by using the divding method
  • #1
mr_coffee
1,629
1
Hello everyone, I realize this is really basic stuff and mainly pointless considering calculators can do it for you but I'm still wondering on why this isn't working out right. I'm in a digital design class and he showed us a method for converting decimal to binary and it seemed easy and seemed to work great but he would use numbers such as: 25 and nothing that had a decimal point. Well the number is 369.3125 decimal. To convert to binary it worked fine for the whole number 369 by just divding by the desired base, so since i wanted binary, i would divide by 2 and the remainder of each would be the number in binary. Also if I wanted to convert decimal to octal, i could just keep on divding by 8, and so on. But as you can see I can't figure it out how you figure out the .3125 of the number by using the divding method? Also I'm having troubles converting it to octal using the dividing method. Here is my work in the picture. Any help would be great!
http://img139.imageshack.us/img139/7369/fff7vh.jpg
 
Last edited by a moderator:
Engineering news on Phys.org
  • #2
I'll give you a couple of hints. First, convert that to the left and that to the right separately. Second, where the left values (starting at the point) of binary numbers represent values of 1(ie 2^0), 2, 4, 8,...etc., those to the right represent values of 1/2 (ie, 2^-1), 1/4, 1/8,...etc.

KM
 
  • #3
Same consideration for Octal, except the values to the left (starting at the point), are n*8, n*64, n*512,...etc., those to the right are n*1/8, n*1/64...etc. Operate on them accordingly.

KM
 
  • #4
Thanks for the reply, well I know how to convert using that method, but I think it takes longer to do, is that the only way you can find the numbers after the decimal point? You can't use the dividing by power rule?
 
  • #5
mr_coffee said:
Thanks for the reply, well I know how to convert using that method, but I think it takes longer to do, is that the only way you can find the numbers after the decimal point? You can't use the dividing by power rule?


Sure you can. I thought what I told you would give you the answer. Hint: instead of repetitively dividing by two or eight, you divide repetitively by ?? or ??. (and what should that imply?)

KM
 
  • #6
ohhh, instead of dividing by 2 or 8, it would be by 2^-1 then 2^-2? or 8^-1, etc>?
 
  • #7
mr_coffee said:
ohhh, instead of dividing by 2 or 8, it would be by 2^-1 then 2^-2? or 8^-1, etc>?

Yes, and what are those values, and what does the use of those values imply? You can check it on your example, because it is a very simple case.

KM
 
  • #8
actually, I found a much easier way, you don't divide by anything, if you want to convert a decimal base 10, to a binary, just multiply by 2, and keep doing it, if u want octal, multiply by 8, its simple. THanks for the help though.
 
  • #9
mr_coffee said:
actually, I found a much easier way, you don't divide by anything, if you want to convert a decimal base 10, to a binary, just multiply by 2, and keep doing it, if u want octal, multiply by 8, its simple. THanks for the help though.


What do you think I was trying to hint to you. Dividing by 1/2 is the same as multiplying by 2. The same with 1/8 and 8, or any other base. Then whatever carries each time to the "left" of the point is the value you use.

KM
 
  • #10
oh hah, sorry my bad, i forgot about the whole 1/.5 = 2. And I'm in calc III, sad. hah
 
  • #11
I know this is an old post, but for some of you still reading this, you can use this http://www.stringfunction.com/decimal-binary.html" to make sure you are converting the right way.
Also, check this article on http://www.stringfunction.com/blog/convert-binary-and-decimal-values/"
Hope this help
David
 
Last edited by a moderator:

1. How do I convert a decimal number to binary?

To convert a decimal number to binary, you can use the repeated division method. Start by dividing the decimal number by 2 and writing down the remainder. Then, continue dividing the quotient by 2 until you reach 0. The remainders, read from bottom to top, will give you the binary equivalent of the decimal number.

2. What is the difference between decimal and binary numbers?

Decimal numbers are based on the number 10, and use 10 digits (0-9) to represent any value. Binary numbers, on the other hand, are based on the number 2 and only use 2 digits (0 and 1). This means that in binary, each digit has a value of either 0 or 1, whereas in decimal, each digit has a value between 0 and 9.

3. How do I convert a decimal number to octal?

To convert a decimal number to octal, you can use the repeated division method. This is similar to converting to binary, except that you divide by 8 instead of 2. The remainders, read from bottom to top, will give you the octal equivalent of the decimal number.

4. Why is it important to understand decimal, binary, and octal numbers?

Understanding these number systems is important in computer science and programming, as computers use binary code to represent and process data. Octal and hexadecimal numbers are also commonly used in computer programming, so having a basic understanding of them can be helpful in understanding and debugging code.

5. Are there any shortcuts or tricks for converting between decimal, binary, and octal?

There are some shortcuts and tricks that can make converting between these number systems easier. For example, to quickly convert a binary number to decimal, you can use the doubling method where you start from the right and double the previous number each time. For converting between decimal and octal, you can use the grouping method where you group the decimal number into sets of 3 digits and then convert each set to octal individually.

Similar threads

Replies
4
Views
892
  • Introductory Physics Homework Help
Replies
11
Views
792
  • Programming and Computer Science
Replies
3
Views
953
  • Electrical Engineering
Replies
3
Views
8K
  • Electrical Engineering
Replies
5
Views
1K
  • Programming and Computer Science
Replies
29
Views
2K
Replies
10
Views
1K
  • Introductory Physics Homework Help
Replies
3
Views
164
  • Electrical Engineering
Replies
20
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
4K
Back
Top