Question:
How do you convert binary numbers to decimals, vice-versa?
laya_garfield
2007-12-01 06:19:00 UTC
I have got a quiz coming on Monday, and it will have an entire round based on this. I am in Grade 9, from India and thus, we might have slightly simple questions on this, compared to higher classes.

But still, I hardly know a thing about this conversion, and I am afraid, you might have to answer in explicit detail for me to understand.

As an example, can you please convert the number 54 to binary, decimal, octal, hexadecimal forms?? In this way, I can understand....
Three answers:
Hendry B
2007-12-01 07:03:00 UTC
54 is a number represented in decimal (base 10). Binary (base 2) numbering is a simple system where the only two valid digits are 0 or 1. Whereas, in base 10, the numbering columns are ones (far right), tens, hundreds, thousands (working from right to left), in base 2, the numbering columns are one, two,four,eight,sixteen,thirty-two,sixty-four, etc. Some more concrete examples follow:



in base10 the number 54 in decimal is 5x10+4x1



Binary is base2 math, so the numbering columns are ones(2^0), twos (2^1), fours (2^2), eights (2^3), sixteens (2^4), and so on. The only two valid digits in base2 are 0 and 1, so the number 54 doesn't exist because you can't have a digit higher than 1... but the decimal value 54 would be expressed as follows:

110110 -- that is 1x(2^5)+1x(2^4)+0x(2^3)+1x(2^2)+1x(2^1)+0x(2^0)



Octal is base 8, so the numbering columns is

ones (8^0), eights(8^1),sixty-fours(8^2), five hundred twelves (8^3) [again, from right to left]. The only vaid digits in base 8 are 0 - 7



So, to express 54 as octal, is 66 -- that is 6x(8^1)+6x(8^0) or 48+6



Hexadecimal is base 16 so the numbering is 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

and the numbering columns is ones (16^0), sixteens (16^1),

two hundred fifty-sixes(16^2), four thousand ninety-sixes (16^3) and 54 in hexadecimal is expressed as 36 -- that is 3x(16^1)+6x(16^0) = 48+6 = 54.



I hope this helps explain the numbering systems with some concrete examples.
2007-12-01 07:37:24 UTC
54 is decimal - or more correctly Denary. It is base 10 and counted in 1, 10 , 100, 1,000 etc.

v = to the power of:

Weighted values for each position:

10v4 10v3 10v2 10v 110v0

10,000 1,000 100 10 1



Binary which is computer language uses base 2.

and has only 2 possible values 0 and 1. Weighted values for each position:

2 v 4 2 v 3 2 v 2 2 v 1 2 v 0

16 8 4 2 1

So 54 is 110110.Binary

Octal number base system works to the power of 8. Less used today. You use the number 1 - 7 to represent it.

Weighted values for each position:

8 v 4 8 v 3 8 v 2 8 v 1 8 v 0

4096 512 64 8 1

54 = 66 Oct.

Hexadecimal works to the power of 16.

Weighted values for each position:

16 v 3 16 v 2 16 v 1 16 v 0

4096 256 16 1

Hex uses only the digits 0 - 9 and the letters A,B,C,D,E, and F Representing 10,11,12,13,14,15.

54 = 36 Hex.

I think my calculations are OK but it is along time since I did this. You calculate any of it by repeated division using the remainder for your number and dividing the quotient each time by the Hex, Oct or binary number 16, 8, or 2. Using 0 when there is no remainder. Do hope this helps.

17 . 15 pm GMT

Just edited this and corrected my calculations.
♥DiNoSh♥
2007-12-01 06:26:59 UTC
this website is helpful

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=50775&lngWId=1



i always use it when i have a quiz and its really easy to understand!! ;)

good luck with your quiz


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...