(adsbygoogle = window.adsbygoogle || []).push({});
I know there's a few members out there who want to get into coding/hacking/scripting/whatever you want to call it but can't find a place to start. I thought Binary is the most simplistic form of it, and thought I'd make a guide. If it doesn't help with coding, atleast it can help with homework of some sort, or just give you the knowledge.
Binary is used by your computer to produce an output. When a key is pressed, it sends an 8-number sequence, consisting of 0's and 1's, to the processor, which produces the output. More about this later.
Enough Rambling; Onward to learning.
[multipage=Terminology]
Byte - An eight digit sequence that represents a number or letter in binary.
Bit - One number, either 0 or 1, that makes up a byte.
Nibble - Half a byte ( 4 Digits, not 8 )
[multipage=Understanding Our Counting System]
This seems like common sense, but it helps understand binary once we get to that page.
We use the
Decimal System, also known as
Base10. Everyone does. This means we use 10 digits (0-9) to create multi-digit values, such as 3485. Now, how do we know that
3485 means
three thousand four hundred and eight five? Basic math. We add each multiple of 10 (Which is why it's known as BASE10) together, and rewrite the total as the number we want expressed. I've made a very simple chart to explain. If you don't like it, let me know. I'll try to make a better one. :y:
You must login or register to view this content.
To change those values to a total number, we multiply the "Expressed As" number by the number below it, meaning:
1000 x 3
xx=
xx3000
100 x 4
xxx=
xx400
10 x 8
xxxx=
xx80
1 x 5
xxxxx=
xx5
Add the underlined numbers together for the total, 3485.
The same will be true in binary.
Now, on to the actual learning. =D
[multipage=Applying The Base10 System to Binary]
Binary is known as Base2. There are only
TWO numbers to use, instead of Base10's 10 numbers. These two numbers are 0 and 1. A 0 represents off, and a 1 represents on.
Binary numbers must be between 1 and 225 for a byte, and 15 for a nibble. Each of the eight numbers has a value represented as 2ⁿ, where n represents a number 0-8. The chart shows what each value is.
You must login or register to view this content.
To convert a decimal number to binary, start from the left side and move right. If the number is 57, try subtracting 128 from 57, and getting a positive answer. if you can, but a 1 (Showing we are using this value) and if you cannot, put a 0 (showing we are not using this value). Any number from 1 to 255 will work. Keep going from right to left, subtracting if possible as shown in the chart.
You should do:
57 - 32 = 25
25 - 16 = 9
9 - 8 = 1
1 - 1 =0
You should
ALWAYS get 0.
So, 57 in binary is represented as 00111001.
Simple.
[multipage=Converting to Hexadecimal]
Plan to add later this week. Possibly the weekend.
[multipage=Conclusion / Special Thanks]
If you have questions, PM me. I'll happily help.
If you find anything wrong with this thread, or just want something added, feel free to PM me about it. I'll give you credit here, and link your Rep =D
THANKS TO
Craig LeGlue - Not a member of NGU, but taught me most of what know about Binary, and computers in general.