Computer Hope

Hardware => Hardware => Topic started by: tangerine588 on December 18, 2009, 03:25:58 PM

Title: Binary and Hexidecimal
Post by: tangerine588 on December 18, 2009, 03:25:58 PM
Hi,

I'm taking a computer class and I need to know how to convert 2009 into both Binary and Hexidecimal....
Title: Re: Binary and Hexidecimal
Post by: 2x3i5x on December 18, 2009, 03:37:56 PM
Quote
This is very simple.

The number 2009 is a decimal number. Now to convert this into binary, you have to divide this with 2 and then the quotients with 2 until you get a quotient of 0 OR 1. and to convert into hexadecimal, you have to divide this with 16 and then the quotients with 16 until you get a quotient of 0 OR 1.

Converting into binary
-------------------------------
Now, dividing 2009 with 2, you will get quotient of 1004 and reminder 1.
Now, divide 1004 with 2, you will get quotient of 502 and reminder 0.
Now, divide 502 with 2, you will get quotient of 251 and reminder 0.
Now, divide 251 with 2, you will get quotient of 125 and reminder 1.
Now, divide 125 with 2, you will get quotient of 62 and reminder 1.
Now, divide 62 with 2, you will get quotient of 31 and reminder 0.
Now, divide 31 with 2, you will get quotient of 15 and reminder 1.
Now, divide 15 with 2, you will get quotient of 7 and reminder 1.
Now, divide 7 with 2, you will get quotient of 3 and reminder 1.
Now, divide 3 with 2, you will get quotient of 1 and reminder 1.

Now, the quotient is 1 and here you can stop dividing quotients.

Now write down the last quotient and then all the reminders in reverse order which will become 11111011001

Converting into hexadecimal
--------------------------------------…
Now, dividing 2009 with 16, you will get quotient of 125 and reminder 9.
Now, divide 125 with 16, you will get quotient of 7 and reminder 13 (This will be represented as D).
Now, divide 7 with 16, you will get quotient of 0 and reminder 7.

Now, the quotient is 0 and here you can stop dividing quotients.

Now write down the last quotient and then all the reminders in reverse order which will become 07D9.

You can ignore the leading 0 and you can represent this as 7D9.

Hope that helps.
Title: Re: Binary and Hexidecimal
Post by: tangerine588 on December 18, 2009, 04:05:35 PM
A little bit can you help me with one more?  Convert 1971 into binary and hexidecimal
Title: Re: Binary and Hexidecimal
Post by: 2x3i5x on December 18, 2009, 04:22:45 PM
A little bit can you help me with one more?  Convert 1971 into binary and hexidecimal

Try it yourself and see if you can do it. After all, you'll need to understand how it works for your class.

Here's a website that has a decimal to binary and hexadecimal converter (http://easycalculation.com/decimal-converter.php) that will give you the final answers so that you may check your work.

Just try with the method I've already given, if still having difficulty getting right answer after attempting, then we'll go from there.  :)
Title: Re: Binary and Hexidecimal
Post by: rthompson80819 on December 18, 2009, 04:29:46 PM
It's extremely important that you understand how to do something like this by hand.

Once you have the understanding of how it's done by hand, the calculator in Windows can also do it for you.

Start > accessories > calculator > view > scientific.

Then it's real easy to do conversions.
Title: Re: Binary and Hexidecimal
Post by: tangerine588 on December 18, 2009, 04:55:14 PM
thanks i got 111011011 for the binary and 7B3 for the hexidecimal....
Title: Re: Binary and Hexidecimal
Post by: 2x3i5x on December 18, 2009, 05:01:40 PM
thanks i got 111011011 for the binary and 7B3 for the hexidecimal....

great. I'm betting your teacher may ask you to do some by hand on a test or something  :)
Title: Re: Binary and Hexidecimal
Post by: Geek-9pm on December 18, 2009, 10:27:25 PM
Quote
... extremely important that you understand
how to do something like this by hand.
Exactly!
Title: Re: Binary and Hexidecimal
Post by: rthompson80819 on December 18, 2009, 10:43:46 PM
Thanks to 2x3i5x for his explanation of how to convert digital to binary.  I went through that process years and years ago but after years of using calculators all the time you tend to forget that basic process.

It's something you need to force your self to do every now and then.
Title: Re: Binary and Hexidecimal
Post by: 2x3i5x on December 18, 2009, 11:00:20 PM
A lot of things you just take for granted I guess. Just like using a calculator to do some of the conversions or math. The formulas, regardless of how simple they may be, simply flew out the window.

Then again, I think it's nice to review some of the techniques again. 

You don't know when you'll need it, since it's supposed to be a basic thing  :)
Title: Re: Binary and Hexidecimal
Post by: BC_Programmer on December 19, 2009, 09:15:35 AM
HEX to binary and Binary to hex is pretty easy by itself; each group of two digits in hexadecimal is 8 binary digits. in fact I imagine that is hald the reason it was decided that hex would be used for things like dumps of unknown data- (hex dumps). each byte can be represented by two hex digits.

of course converting either into an actual decimal number isn't always strictly necessary, and when when it is it isn't always intuitive, either.