Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2013-08-23 00:30:47

Amartyanil
Member
From: Universe
Registered: 2013-05-27
Posts: 82

Numbers

Hi;

How to convert:
I. Decimal to Binary and vice versa

Last edited by Amartyanil (2016-02-05 20:24:39)


"Every place is the center of the universe. And every moment is the most important moment. And everything is the meaning of life." ~ Dan Harmon

Offline

#2 2013-08-23 00:58:17

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

Hi Amartyanil;

By hand or by computer?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2013-08-24 18:24:25

Amartyanil
Member
From: Universe
Registered: 2013-05-27
Posts: 82

Re: Numbers

Hi bobbym;

By hand


"Every place is the center of the universe. And every moment is the most important moment. And everything is the meaning of life." ~ Dan Harmon

Offline

#4 2013-08-24 20:02:38

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

Not even a calculator?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2013-08-24 23:56:05

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Numbers

You don't need a calculator for that.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#6 2013-08-25 01:14:13

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

Hi;

Maybe for very small numbers but everything is easier when you have a little computing power.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#7 2013-08-28 16:17:51

Amartyanil
Member
From: Universe
Registered: 2013-05-27
Posts: 82

Re: Numbers

Hi bobbym;

First tell it by hand; then a calculator


"Every place is the center of the universe. And every moment is the most important moment. And everything is the meaning of life." ~ Dan Harmon

Offline

#8 2013-08-28 19:21:54

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

The way I do it is by making a little table of powers of 2.

2^0 = 1
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16
2^5 = 32
2^6 = 64
2^7 = 128

Now supposing we want to change 105 from binary to decimal. We get the closest power of 2 that is smaller or equal. We see in the above chart that it is 2^6 = 64. So put a 1 and subtract 105 - 64 = 41.

Now just go down the line does 2^5 fit in 41? Yes it does  so add a 1 next to that 1.

11 and say 41 - 32 = 9

2^4 is larger than 9 so put a 0 next to that 1.

110

2^3 is smaller than 9 so put a 1

1101 and say 9 - 8 = 1

2^2 is larger than 1 so put a 0

11010

2^1 is larger than 1 so put a 0

110100

2^0 is exactly equal to 1 so put a 1

1101001 and say 1 - 1 = 0

We are done.

105 = 1101001 in binary


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#9 2013-08-28 20:12:27

Bob
Administrator
Registered: 2010-06-20
Posts: 10,053

Re: Numbers

hi Amartyanil

If I have to do this by hand, here's the method I'd use for any number base.

Step 1. work out the column headings for that base.

Step 2.  Starting with the biggest of these, subtract as many times as possible, then

Step 3, 4 etc   continue with the lower powers until I'm down to units.

eg.  Change 1123 into base 8

Step 1 the headings are 1, 8, 64, 512, ....  I can see by inspection that 512 is as high as I'll need to go.

Step 2.  1123 - 2*512 = 99  so the number in the '512' column will be 2

Step 3.  99 - 1*64 = 35 so the number in the '64' column will be 1

Step 4.  35 - 4*8 = 3 so the number in the '8' column will be 4

Step 5.  As my remainder is now less than 8 the number in the 'units' column will be 3

Final answer 1123 in base 10 is 2143 in base 8

Screen shot below shows the steps more neatly and how I checked that I'd got it right.

And here's a quick way to change that to binary.

In binary the first three columns are 4, 2 and 1

So you can change each octal digit into a 3 digit binary number thus

2143 becomes 010  001  100   011 and there's the binary version.

check 1 + 2 + 32 + 64 + 1024 = 1123

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#10 2013-08-28 20:49:53

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

Hi all;

Or as the Russian do?!

To change 530 to binary.

Make this grid:

The first column was created by dividing 530 by 2 and if there was a remainder ignoring it. The second column was created by the rule if the number next to it is even put a 0, if odd, put a 1.

Now start from the bottom

530 decimal = 1000010010 binary.

Lets do another one.

11571 decimal = 10110100110011 binary


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#11 2016-04-29 16:20:05

Amartyanil
Member
From: Universe
Registered: 2013-05-27
Posts: 82

Re: Numbers

Hi bobbym;

In my book of Computer Science(Now I am in 7th Grade), the Russian method is taught, i think it is quite easier.


"Every place is the center of the universe. And every moment is the most important moment. And everything is the meaning of life." ~ Dan Harmon

Offline

#12 2016-04-29 16:55:26

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

They are very clever programmers. So you are in the 7th grade now, I am looking forward to seeing more of you.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#13 2016-04-30 02:07:54

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Numbers

What is the Indian way?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#14 2016-04-30 03:23:10

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

Me or him?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#15 2016-04-30 12:18:22

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Numbers

You or him what?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#16 2016-04-30 13:25:47

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

Are you asking me or Amartyanil?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#17 2016-04-30 15:54:25

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Numbers

Anybody who can answer will do


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#18 2016-04-30 15:59:37

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

You should be able to answer?!


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#19 2016-04-30 16:02:07

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Numbers

No, I do not know the Indian way to convert Decimal to Binary. What is it?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#20 2016-04-30 16:03:26

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

I do not know their exact way either but I am sure they are using one of the methods that everybody else does.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#21 2016-04-30 16:06:27

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Numbers

I am an Indian. I can usually convert small numbers inside my head. If the numbers are large, I use a computer.

I also have an awesome wiki on bit hacks. Have you seen it?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#22 2016-04-30 16:09:29

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

I did not even know about it. Where is it?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#23 2016-04-30 20:03:42

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Numbers


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#24 2016-04-30 22:39:15

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Numbers

Good ole Hamming, nice page!


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#25 2016-05-01 01:01:19

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Numbers

Thanks!

Have you seen my wiki page on binary heap?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

Board footer

Powered by FluxBB