Thursday, December 15, 2011

Will someone please explain binary numbers to me in-depth(like u would with a grade school student)?

k so my mom is in a c++ programming course and her book for the course explains things in a way that i(a normal human being) wouldn't understand. she does'nt either and she is scared she is gonna fail the course. for instance it says note that 65=1x2(6)+0x2(5)+0x2(4)+0x2(3)+0x2(2)+0x鈥?i actually managed to stare at it for hours and grasp it...it works out to 65 and all the 0x and 1x is bits. which makes 1000001...i was baffled at the letters with all the variables and what not and i mean you cant just note that thats like a big math problem thats like saying note that the sun travels at exactly 2489894Xx amount of hours idk all that...i dont have my masters degree or a PHD so will someone please help me learn binary code for dummies?|||Okay .. Binary 001





Counting to 31 on one hand.





The concept to grasp here is that binary is JUST place holders. No incremental variety within the place, just it is, or it isn't. You start with 1, and double your way to the left (so ... 16 8 4 2 1 ). Other than that it works just like any other numbering system. (Decimal, Hexadecimal, Duodecimal, Binary, Base-whatever)





You have a place, and then next to it you have another place. In decimal you might have 15. That would be one Ten and Five ones.





In decimal you might have 1111. That would be an eight, a four a two and a one. Also 15. In Hex that would be F





So on your one hand.. (if you aren't some kind of FREAK) then you have enough fingers to hold a 16s place in binary. Go with your right hand palm towards you. Your thumb represents the Ones place. Pointer Twos, Middle Fours, Ring Eights, Pinky Sixteens. Up is on Down is off. All five fingers up is all on, so a sixteen an eight a four a two and a one is 31.





To figure out how to represent a given number in binary, you play "The Bit Is Right": Where you try to pick the place holder as close to the number you want, without going over, and then subtract that number from your target and play again until you fill the last bit needed to hit yout target.





So for a number like Decimal 11 (ten plus one) you play "The Bit Is Right" on Decimal 11 you get 8, which is the largest bit you can fill without going over. So now you subtract Decimal 8 from Decimal 11 and you have Decimal 3... so you play "The Bit Is Right" on Decimal 3 and you get 2... subtract two from three .. play again you get 1 which is the first bit (always filled in an odd number, always open in an even.)


so Decimal 11 is fill 8 2 and 1 So: 1011.





So your Heavy Metal hand is 19. 4 is "The bird". Peace is 6. and "A-Okay" is 24 depending on how you count that curled pointer finger!!|||It's all about place values.


We usually think in base 10. So, the number 65 is (5 * 10 ^ 0) + (6 * 10 ^ 1)





Note, the * is multiplication and the ^ means "to the power of".





Notice how both the digits 5 and 6 are multiplied by powers of 10.





Since binary is base 2, every digit is multiplied by powers of 2.





As an example, 4 is 100 in binary: (0 * 2 ^ 0) + (0 * 2 ^ 1) + (1 * 2 ^ 2).|||Each number is represented as a 1 or a 0. If it has a 1 it is counted as it place value. Place values are in multiples of 2.





1 2 4 8 16 32 64 128....





so using the numbers above





1 = 1


11 = 1 + 2 or 3


111 = 1 + 2 + 4 or 7


0001 = 0 + 0 + 0 + 8 or just 8





So what would 127 be?





remember our numbers


1 2 4 8 16 32 64 128





use the 1's to represent the number





it would be





1111111





because 1 + 2 + 4+ 8+16 + 32 + 64 = 127





Basically a 1 means that the number in that place is being counted, a 0 means that it is not.

No comments:

Post a Comment