One of the greatest stumbling blocks for me in my academic life has been a major distaste for the numerical voodoo we know as math, so as I now have a fragile grip on some crucial concepts I am going to express my understanding in written form for posterity and as an aid to any fellow geeks.
Binary To Decimal
- Create a table of the first 8 powers of 2 like so starting at zero and write your binary number from right to left in the row below
- For each digit (bit) where the value is one add together the power value above the number in the table
- The result of this addition is the binary number expressed in decimal (base 10)
Lets convert 110110002 to decimal:
First we create the power table:
Next we add the powers of the bits which are not zero giving us the equivalent base 2 (decimal) number
128 + 64 + 16 + 8 = 21610
Q: What is the meaning of the subscript numbers after the binary and decimal digits?
A: These indicate what base applies to a given number a 2 means the number is base 2 (binary) and a 10 means the number is base 10 (decimal)
Q: Why do we use powers of two for binary:
A: Because binary is base 2 meaning that place values increase by a power of two for each place.
Q: Why do we use the first eight powers:
A: Because binary numbers get long quickly we generally only work with numbers that can fit into one byte (8 bits) meaning that the binary numbers we work with will be a maximum of eight digits, hence the use of the first eight powers
Q: Why do all powers of zero equal 1:
A: This is still a mystery to me. my teacher says it’s a rule and it seams to work so I’d stick with it.
Decimal to binary will be covered in the forthcoming part 2