I need Help with Binary!!

Buzzika

Supreme Member
Joined
Jul 8, 2009
Messages
1,446
Reaction score
1,776
I am starting out with programming and all other geeky stuff. I have started larning. But I have some confusion with binary...

I used a binary translator here: http://home2.paulschou.net/tools/xlate/

What I don't get is:
1 ---> 00110001 in binary
I get the "0001" thing..
BUT
Why are there "1" placed in 32s and 16s place? here: 00110001???:yell:
 
hmmm... not many geeks on BHW? only marketers ground?
 
Figured it out myself.
1 ----> 00110001 is correct because the translator is treating "1" as a string and not a base 10 number.
I tried another translator in which I had the option to select the input. I selected base 10 to base 2 and the output was correct.
 
Binary base 2 right

Starting from the right 2 power 0, 2 power 1, 2 power 2 etc
ie 1 2 4 8 16 32 64 128 etc

entering text '1' is represented by decimal 49 = 0x256 + 0x128 + 0x64 + 1x32 + 1x16 + 0x8 + 0x4 + 0x2 + 1x1 i.e. 00110001
 
Yep, the above is correct.

Basically we have 10 base. (10,100,1000)

Binary uses 2 Base.

Code:
11001101
It would be broken down into the following.
ON(1) ON(1) OFF(0) OFF(0) ON (1) ON (1) OFF (0) ON (1)
So you can see on is represented by a 1.

If it is a ON then you simply do 2 To the power of the number it is on the line..

2^7, 2^6, 2^5, 2^4, 2^3, 2^2, 2^1, 2^0

^ = power to.

So for our example
Code:
11001101

It is. (Work from left to right)
2^7 + 2^6 + 0^5 + 0^4 + 2^3 + 2^2 + 0^1 + 2^0

A simplier way is to only had the values with an ON.

So,
2^7 + 2^6 + 2^3 + 2^2 + 2^0

In both situations you get 205.

205 is then the ascii code, for the character.

You can find out the ascii code from the ascii chart.
 
Mate, there are 10 kinds of people in this world. Those who understand bindary, and those don't!
 
Binary base 2 right

Starting from the right 2 power 0, 2 power 1, 2 power 2 etc
ie 1 2 4 8 16 32 64 128 etc

entering text '1' is represented by decimal 49 = 0x256 + 0x128 + 0x64 + 1x32 + 1x16 + 0x8 + 0x4 + 0x2 + 1x1 i.e. 00110001
Ok!How would one write 256?

00000001 11111111 -----> 1 255 not 256??
How??
 
Back
Top