Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Binary, most of you have heard of it, and relayed it to Hacking, Coding/Programming, or even Matrix.
- I will not deny the fact that binary IS related to these topics in some ways, but binary's first purpose is to make computer be "alive".
- To explain binary, we will first need to give example and understand what binary is:
- Imagine a human that talks in a special language, its made out of two words, "yes" and "no", it doesn't know how to talk in any other language, so if you will ask him how much is 1 + 1, or even just write 1 + 1 = ?, he will not understand you, as he doesn't know such languages. Same works the computer, it can "talk" only in 0's and 1's while 0 is no and 1 is yes.
- But, then, how does it calculates? As you might not imagine anything does "yes + yes = no" etc.
- So let's look at binary in a new aspect, a mathematical aspect:
- You'd probably know the regular numeric system (1 + 1 = 2, etc.), but what if I would tell you, there are other numeric systems, to show you that they exist and how do they work, let's yet again view the normal numeric system.
- It might seem stupid, but to show how other numeric and our numeric system works, we will need to count to 10, starting from 0:
- 0, 1, 2, ..., 9, 10.
- You might've ask yourself, why would we count to 10, especially when starting from 0, so let me explain you, our numeric system have different names: Decimal, Base 10, and a few more names, why do I tell you that? Because we need these names, to be exact, one of them, Base 10, now I will ask you a simple question, why does it called Base 10? Why not Base 1 or any other number?
- Some answers might be "All the numbers are made out of 0 - 9", "Counting to 10 is the most basic math" etc.
- But, to understand the real reason, we'll take a look at our counting (from 0 to 10), you must agree that 0 = 00, 01 = 1, 02 = 2, etc.
- But then, when it comes to 10, a thing happens, instead of 0 and the number, there is 0 and two numbers, 0 10.
- Same happens with 100 (0 100) etc.
- Why does this happen? Because the digit increase, basically Base 10 means the amount of numbers per digit until the digit increases, to be more clear I will show an example: the numbers 0 - 9 are the first digit (1's digit), and then, 10 - 99 are the second digit (10's digit), and so on forever, basically, in every "new" digit, we have 10 numbers (including 0) till the digit change (from 1's to 10's etc.).
- Now, why did we discuss all that? Exactly because binary works the same way, but with 2 numbers instead of 10 per digit (Base 2), so, per each digit, only two numbers needed to increase the digit (0 and 1):
- 0, 1 and the digit increase. But, before we continue, unless you really want to get confused, I need to explain another thing:
- by splitting the 10's from the 1's and 100's from 10's from 1's etc we can see that the numbers repeat themselves: 0 0, 0 1, 0 2, ..., 0 9 and then 1 0 (we start counting from 0 again, but with 1 instead of 0 before the number, etc.)
- So, in binary it works the same, 0 0, 0 1, and then 1 0 (the digit increases and the counting starts again from 0), then 1 1, and the digit increases again, so 1 0 0, 1 0 1, etc.
- To make it more clear, I will just show a way how to use incerment in binary.
- Let's take the number 1 (0 1) and the number 1 again. In Base 10, 1 + 1 would be 2, but in binary, 2 is not existing in one digit as the limit of numbers per digits is 2 numbers (0 and 1), so, 1 + 1 would be in the next digit, so we add 1 in the 10's row, now we need to think logical, if 1 in binary = 1 in Base 10, then 1 + 1 that equals 2 in Base 10, is basically greater in 1 than the number 1, which means we need to find the next number in the Binary Numerical System, and so we find 10, which equals to 10.
- A conclusion we can make after testing a whole lot of numbers (about infinity) is that each 1 that added to 1 (in same digit), its being replaced with 0 and adding a 1 to the next digit, and 0 does not affect anything: 1 1 + 0 1, so 1 + 0 = 1 (10's row), but 1 + 1 = 10, (because we replace 1 + 1 with 0 and add 1 to next digit) but then we have 1 + 1 again in the 10's row (11 + 01 = 10 + 10), so we yet again replace 1 + 1 with 0 and add 1 to next digit (100 = 10 + 10), fortunatley there is 0 (011) so we don't need to repeat this action again.
- At last, I will teach you how to convert numbers from binary to Base 10:
- You count the amount of digits (let's say we have the number 10101, we have 5 digits), then decrease it by 1, and powering 2 by the number you get, while decreasing the power by 1 each time, and multiplying by the number (1 or 0) that you have in that digit: (^ is power, n is the amount of digits, m is the number in the n digit) 2^n-1 * m + 2^n-2 * m...
- For a more explained tutorial on how to convert binary to Base 10, check out this link: http://www.electronics-tutorials.ws/binary/bin_2.html
- That's it for now, if you have any issues, be sure to E-Mail me at bekerman122@gmail.com
- Made by Eldar Bakerman, please do not claim as yours and credit it as Eldar Bakerman's
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement