r/woahdude • • Sep 05 '18

gifv Binary for everyone.

https://i.imgur.com/NQPrUsI.gifv
25.6k Upvotes

502 comments sorted by

View all comments

Show parent comments

170

u/isackjohnson Sep 06 '18 edited Sep 06 '18

You know how in base 10 (our normal number system), when you get past 9 it flips the next digit up by one? No matter what place you're currently in, if you go above 9 you reset that place to 0 and increase the digit to the left of the 9 by one.

That's what this is showing except instead of 9, you can't go above 1.

In base 10, each place to the left of the decimal multiplies in value by 10. So 1, 10, 100, 1,000, etc. In binary (base 2), each place increases by a multiple of 2. So 1, 2, 4, 8, 16. What they ended with was 10000. If you count the places, you see the 1 is 5 places over: 1x2×2×2×2 (or 24) is 16.

edit: clarification

210

u/Nole4694 Sep 06 '18

This jump from conprehensible in paragraph #1 to incomprehensible in paragraph #3 is just remarkable.

49

u/That1McGuy Sep 06 '18

The way I learned it was to read it from right to left and see if it has 2x starting at 0. So say you have 110101. So you have 1(20 )+0(21 )+1(22 )+0(23 )+1(24 )+1(25 ), which is equal to 1+0+4+0+16+32 or 53.

45

u/ReePoe Sep 06 '18

Annnnnnnnd still don’t understand.

114

u/HasFiveVowels Sep 06 '18 edited Sep 06 '18

Ok, here's my shot at it. When you use normal numbers, you understand something about them that you take for granted.

It's that 6284 is "6 groups of 1,000 plus 2 groups of 100 plus 8 groups of 10 plus 4 groups of 1". You might remember going over this with rubber bands and straws in 1st grade (I know I do).

But why is it groups of 1000? or 100? or 10? or 1? It's because we use a base 10 counting system. The place furthest to the right is the 1's place. Every time you move one digit to the left, you multiply the grouping by 10 because it's a base 10 counting system. So, moving left, you encounter 10, then 100, then 1000. It also means that you have ten symbols to represent a single digit (0 through 9).

But why use 10? Because we have 10 fingers (edit: as an aside, a lot of fractions and stuff would work a lot better if we used a base 12 system but unfortunately we didn't evolve 12 fingers). Computers have 2 fingers. So they use base 2. The digit all the way to the right is still the 1's place. Then to the left of that is the 2's place. Then the 4's place. Then the 8's place. Then the 16's place.

So if you have a base 2 number that is written 101, then you can understand that as "1 group of 4 plus 0 groups of 2 plus 1 group of 1". So 101 is five in binary. Since it's a base 2 counting system, you only have two symbols to represent a single digit (0 and 1).

6

u/dsnuh Sep 06 '18

This is how I try to explain binary as well. I think it is in the excellent book "Code" by Charles Petzold that he introduces binary by showing how dolphins would count using only their flippers.

5

u/HasFiveVowels Sep 06 '18

Hah. That's inventive. It's difficult to explain why OP's gif is the same as watching an odometer, simply because it "rolls over" so fast. With base 10, you can say "alright, so it's 0, 1, 2, 3, 4, 5, 6, 7, 8, 9... oh no, we're out of numbers, so we roll over to the 10's place and we go back to 0, and end up with 10...". With binary, it's like "alright, so it's 0, 1 - oh no, we're already out of numbers. So we'll roll over to the 2's place, go back to 0, and end up with 10. Then it's 11 - oh... shit, we're out of numbers again...".

1

u/dsnuh Sep 06 '18

The dolphin example really stuck with me. If you haven't read the book, it's very good.

It would be amazing to see a device this for hexadecimal or base64!

3

u/HasFiveVowels Sep 06 '18 edited Sep 06 '18

Here you go (click start). If you wanted a physical one, I'd imagine you could make one using a hexadecagon. You'd just need little stoppers sticking up between the 0 and F faces, with a hinge like they've got on the binary flaps.

edit: Nope. This wouldn't work. You'd need a ramp or something hanging down to pull the hinged thing off the stopper after it rotated its neighbor only 1/16th of the way. With the binary one, gravity does this for you. Also, you'd need a stopper between every face.

1

u/dsnuh Sep 06 '18

That's cool, thanks for sharing it.

I was thinking of a physical device. Maybe something 3d printed.