2 July 2012

READ AND CONVERT BINARY CODING INTO TEXT AND NUMBERS

SOLUTION:-
Convert number to binary:-
We’ve all seen binary code. We’ve come to think of them as a bunch of ones and zeroes in long strings-
010010101010101001101011

But these ones and zeroes can also represent decimal numbers. First,I will show you how to read these numbers as the decimal numbers we’re used to in our daily life. Then, I will show you how to use those numbers and your keypad to translate them into text. Note that your computer doesn’t use the decimal system, so technically, when it converts binary to text, it doesn’t go through the process I will show you. This is just a derivative way of explaining you how the binary system works.
Lets start with this example:-
10101
You need to read binary from right-to-left. It’s just the way it’s designed. The first slot from the right represents a value of one, the second from the right a value of two, the third from the right a value of four, the fourth from the right a value of eight, the fifth from the right a value of sixteen, and the cycle continues by multiples of 2.
By putting  1 or a 0 in those slots you are either saying you want to corresponding value that’s attached to that slot or you don’t. A 1 means yes, and a 0 means no.
For example, putting a zero in the first slot from the right, but a 1 in the second slot from the right means you want a two, but not a one:
_ _ _ 1 0.

Also if you want to represent 2 in binary you need to put 0 first from right then put 1 on second.
i.e it can be represented as 2 = 10 or 010,0010,00010 ans so on.always start from last.
3 can be represented as 11,011,0011,00011 and so on.
4 can be represented as 100,0100,00100,000100 and so on.
5 can be represented as 101,0101,00101,000101 and so on.
6 can be represented as 110,0110,00110,000110 and so on.
7 can be represented as 111,0111,00111,000111 and so on.
8 can be represented as 1000,01000,001000,0001000 and so on.
9 can be represented as 1001,01001,001001,0001001 ans so on.
0 can be represented as 0.
1 can be represented as 1.
Uff! tied of writing this numbers.

Convert binary to text:-
ASCII is essentially the letters, numbers and symbols that are stored in our computers through the use of fonts. When the keyboard relays the buttons you pressed, it sends in a code which is then converted to the ASCII equivalent of “k” or “5” or whatever key you pressed.

Here’s an example of a message hidden in binary numbers:
0100100001100101011011000110110001101111
Now there are only so many letters, numbers and symbols stored for ASCII. Having sets of 8 digits for their binary equivalent is more than enough to represent all of these letters and the like. As such, all strings that represent text like in the above are separated into bits of 8 for simplicity:
01001000 01100101 01101100 01101100 01101111

Okay, so example message was separated into 8 digit strings. The decimal value for each of these strings in the example was calculated.
01001000 = 72
01100101 = 101
01101100 = 108
01101100 = 108
01101111 = 111


The result was 72,101,108,108,111. Now, there is something called the ASCII table. It essentially corresponds to the binary numbers from your to the equivalent letters,symbols,numbers. But since we found the decimal values of these binary strings, we can use a major shortcut.

By pressing ALT + [The Number], you will get the ASCII equivalent of that number. For example, by pressing the ALT key and the numbers 72 in any text editor, you will get the corresponding “H” to show up.

Let’s do so for the entire example message:
72 = H
101 = e
108 = l
108 = l
111 = o

So the entire hidden message translates to “Hello”.

NOTE:- To convert binary to number simply add the values for example the numbers of

11011 = (read from right) 1 (one) + 1 (two) + 0 (four) + 1 (eight) + 1 (sixteen) = 1+2+8+16=27
010101 = (read from the right) 1 (one) + 0 (two)  + 1 (four) + 0 (eight)  + 1 (sixteen) + 0 (thirty-two) = 1+4+16 = 21.

thank you :)

No comments:

Post a Comment