Binary conversion is super simple!
The easiest way to understand it is simply this.
- Binary is comprised of bits that is each to the *2 of each bit prior.
1 bit = can hold the value of 1 numerically (decimal)
2 bits = can hold the value of 3 numerically (decimal) because 1*2 = 2, + the previous bit’s numerical value prior (1) = 3
3 bits = can hold the value of 7 numerically (decimal) because the third bit is double of the previous bit.
Etc…
When you assign either a 1 or a 0 to each bit, you can think of it as an “on” or “off switch“. 1 being on, 0 being off. If I asked you to give me the binary form of 7, you would assign the “on switch” for only 3 bits since that’s all you need to give me that numerical number – 111.
Numerically to convert it back to binary form, you find the bit that is closest in value to your goal number without going over and then work your way backwards!
Ex: If I wanted to get the number 12, I’d find the biggest bit that I could go up to following the rule that each bit is double of the previous bit’s number. 4 bits is the highest amount I could go to for this number. At 4 bits, the highest value that this bit is worth alone would be 8. Now, I still need to arrive to 12, luckily we still have our other bits! Knowing what we know about the bits, the binary assignment for 12 would be 1100. (8+4+0+0)
We have to represent all numbers that are left behind even if it’s worth 0 because that represents in total, how many bits was used to get that decimal.
