Binary Help.
Im trying to learn how to convert numbers into
binary and Im having a hard time. I found a
tutorial but its confusing as hell. Here''s
an example from it:
2^5 2^4 2^3 2^2 2^1 2^0
0 1 0 1 0 1
This says we have (0 * 2^5) + (1 * 2^4) + (0 * 2^3) + (1 * 2^2) + (0 * 2^1) + (1 * 2^0)
Algebra goes here: 0 + 16 + 0 + 4 + 0 + 1 = 21
I understand the first part, but the math is where I''m
lost.
Basicly what Im asking is how would I convert say, 8
into binary? I am totaly lost.
12/32/84
its easy, just remember not to over complicate it
here is the binary number 8
0000 1000
the first zero on the right is the 1's place
the second zero on the right is the 2's place
the third is the 4's place
the fourth is the 8's place
the fifth is the 16's place
etc etc.
so here is 1
0000 0001
here is 2
0000 0010
here is 4
0000 0100
and 8
0000 1000
16
0001 0000
32
0010 0000
64
0100 0000
128
1000 0000
and then obviously you can combine them to get numbers that arent powers of two, like 10
0000 1010
the way the tutorial showed you is the correct way to convert,
which is exactly what im saying above. the bit is either on of off. if it's on you add the acotiated value if it's off you add 0. understand what im saying and the formula will become clear.
[edited by - wild_pointer on March 29, 2002 8:55:16 PM]
here is the binary number 8
0000 1000
the first zero on the right is the 1's place
the second zero on the right is the 2's place
the third is the 4's place
the fourth is the 8's place
the fifth is the 16's place
etc etc.
so here is 1
0000 0001
here is 2
0000 0010
here is 4
0000 0100
and 8
0000 1000
16
0001 0000
32
0010 0000
64
0100 0000
128
1000 0000
and then obviously you can combine them to get numbers that arent powers of two, like 10
0000 1010
the way the tutorial showed you is the correct way to convert,
which is exactly what im saying above. the bit is either on of off. if it's on you add the acotiated value if it's off you add 0. understand what im saying and the formula will become clear.
[edited by - wild_pointer on March 29, 2002 8:55:16 PM]
[size=2]
So then 6 would be 0000 0100 ?
I dont think I did that right, but Im getting
the concept. I just need to work with it a bit
more.
I dont think I did that right, but Im getting
the concept. I just need to work with it a bit
more.
12/32/84
no, the value would be "4".
i tend to look at binary, decimal and hexadecimal all in the same way. we learn the decimal throughout our lives, so we think is easier to understand.
take the number 19.
it''s really.
binary is the same, except we don''t use 0123456789, or 10 ^ n.
we use 01, or 2 ^ n.
so the number. 101
4 + 0 + 1 == 5. so 5 == 101 in binary.
hope this helps.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
i tend to look at binary, decimal and hexadecimal all in the same way. we learn the decimal throughout our lives, so we think is easier to understand.
take the number 19.
it''s really.
10 x 1 : or ((10 ^ 1) * 1) == 10 and.1 x 9 : or ((10 ^ 0) * 9) == 9.
binary is the same, except we don''t use 0123456789, or 10 ^ n.
we use 01, or 2 ^ n.
so the number. 101
(4 * 1) : or ((2 ^ 2) * 1) == 4 and.(2 * 0) : or ((2 ^ 1) * 0) == 0 and.(1 * 1) : or ((2 ^ 0) * 1) == 1.
4 + 0 + 1 == 5. so 5 == 101 in binary.
hope this helps.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement