Binary number

well...I have just read a book of programming which mentions things about binary number, and as I proceeded with it, I was getting more confused.Here is the 2-byte integer value chart.

1
2
3
4
5
6
7
8
9
class="centertext">BIT NUMBER 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 The calculation is" Value = 1 x 211 + 1 x 28 + 1 x 25 + 1 x 21 = 2048 + 256 + 32 + 2 = 2338


I'm just wondering like how he got that and how is it done? Just need a clear explanation to it.
Let's take the number 1011.
in our system, each digit represents different amounts, so it can be thought of as
1
2
3
4
 1 * 1000
 0 *  100
 1 *   10
+1 *    1

notice that each digit is worth 10 times the digit to it's right
1
2
3
4
1000 = 103
100 = 102
10 = 101
1 = 100


binary works much the same way, only since it is base 2 rather than base 10, you need to use 2x. So 1011 means

1
2
3
4
 1 * 23
 1 * 22
 0 * 21
+1 * 20

Last edited on
I am still a noob and hope you guys are willing to help me in the future. Thanks alot!
Topic archived. No new replies allowed.