Bases
BASES
Let's talk a bit about binary. And decimal. And hexadecimal. Don't panic.
You know 1+1=2, yes? 2+2=4? 4+4=8?
Of course you do. You can count them on your fingers. Now what's 6+6? You know it's 12, but it isn't really. It's 2 fingers and 1 lot of all the fingers. We call this base 10. We do this because we have ten fingers. If we had more fingers we'd count in whatever that was. With 12 fingers we'd have 0,1,2,3 ... 7,8,9,⧫,⧪ and the next number would be 10. Which is not what you know as 10, its all the fingers and no fingers. Which is what you'd call 12 but it you had 12 fingers you'd call it ten.
Remember at school (I don't) where they'd say 6 plus 6 is two and carry one? Each of the "digits" we use (0,1,2,3,4,5,6,7,8,9) takes one character to write. When you go over 9 it takes two characters to write (1 lot of all the fingers and 0 fingers, or 10).
Here is a sum in base ten, which is how we think:
Digit: 3 2 1 0
Worth: 1000 100 10 1
8 3 4 +
2 6 1 =========
1 0 9 5
See that you have (from the right):
4 lots of one plus 1 lot of one = 5 lots of 1
3 lots of ten plus 6 lots of ten = 9 lots of ten
8 lots of ten times ten (hundreds) plus 2 lots of ten of ten times ten (hundreds) = ten lots of ten times ten (hundreds).
You can't write ten in one space, so you have to carry it over to the ten times ten times ten (thousands) place.
This is how you add up. It doesn't matter whether you're old (like me) and learnt it like I did, or whether you learned it after about 8 governments who thought they knew better. This is how you add up. Tell me if I'm wrong.
Microprocessors are made up of little switches which have a single digit, or finger. Each of these is called a binary digit, or bit. They are arranged in things called nibbles, which are like hands of four fingers two of which are a byte, which are like two hands of four fingers each.
Confused much? Don't be.
A binary digit, or bit, can be 0 or 1. Take one finger. Put it up. It's 1. Put it down. It's 0. You can add 0 to 1 and it will be 1. You can add 1 to 0 and it will be 1. You can add 0 to 0 and it will be 0. If you add 1 to 1 it will be ...
Did you say 2? Show me 2 made out of one finger? Is it up (1)? Down(0)? You can't make 1+1 with one finger. You need two. In this fingery mode, 1+1=10. One lot of all the fingers and no fingers.
You have to think in base 2, or binary.
Bit: 7 6 5 4 3 2 1 0
Worth:128 64 32 16 8 4 2 1
1 0 1 +
1 1 0
=======
1 0 1 1
See the pattern? A number you know as 82563 is eight lots of ten times ten times ten times ten, plus two lots of ten times ten times ten, plus five lots of ten times ten, plus six lots of ten, plus three. Because you have ten fingers. When you have one finger, you can only have one or zero in the place.
So, in the sum up there, you have:
101 (1 lot of two times two, plus 0 lots of two, plus 1)
and you add to it
110 (1 lot of two times two, plus 1 lot of two, plus 0)
and it makes
1011 (1 lot of two times two times two, plus 0 lots of two times two, plus 1 lot of two, plus 0).
Which, if you work it out before going completely potty, is (in your ten-fingered language) 5=6 which as any schoolboy knows, is 11. Or 1 lot of two times two times two, plus 0 lot of two times two, plus 1 lot of two, plus 1.
You can try to think in your ten-fingered language and change everything to that, if you want, but I promise you won't get anywhere. You have to think like a microprocessor to work with one. Sorry.
Do the sum like a computer does. Starting from the right hand side (like you would if you were adding 834 to 261):
1 plus 0 = 1
0 plus 1 = 1
1 plus 1 IS NOT 2 BECAUSE YOU ONLY HAVE ONE FINGER!
1 plus 1 is 0 and carry 1. Which is 10.
Look at the sum again. Keep looking, and reading that again, until you can see that:
101 +
110
====
1011
Then tell me what this is, when you only have one finger?
101 +
111
====
1100 I think.
ReplyDelete