Thursday, January 24, 2019

Number Systems: Introductions

Number systems allow us to count various things with a lot more ease than before. The most common one is Decimal or Base 10, this is most likely because humans generally have 10 fingers, 5 on both hands.

Base 10
Base 10 uses 10 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
This combined with places allows us to use large numbers such as 231.
If we split 231 down we get:
  • 2 x 100s
  • 3 x 10s
  • 1 x 1s
It is interesting to note that each place increases a multiple of 10, but also can be explained exponentially so:
  • 1 = x10^0
  • 10 = x10^1
  • 100 = x10^2
  • 1000 = x10^3
Base 2 - Binary
Base 2 uses 2 symbols: 0, 1
These usually represents on and off or true and false.

Instead of each place being represented by x10^n, base 2 places are represented by x2^n.
So the first 8 places of binary are:
  • 1 = x2^0
  • 2 = x2^1
  • 4 = x2^2
  • 8 = x2^3
  • 16 = x2^4
  • 32 = x2^5
  • 64 = x2^6
  • 128 = x2^7
We can now convert 231 base 10 into base 2

128 64 32 16 8 4 2 1
---------------------------
    1   1   1   0 0 1 1 1

So in binary 231 is represented as 11100111 and we can check this by adding each place that has a value of 1: 128 + 64 + 32 + 4 + 2 + 1 = 231


Base 16 - Hexadecimal
Base 16 uses 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A (10), B(11), C(12), D(13), E(14), F (15)

As with base 2, base 16 places are represented by something different to x10^n. The places are represented by x16^n. So the first 4 places of base 16 are:
  • 1 = x16^0
  • 16 = x16^1
  • 256 = x16^2
  • 4096 = x16^3
We can now figure out how to write 231 in base 16

4096 256 16 1
-------------------
                  E 7

So in base 16, 231 can be represented as E7 and we can check this by adding the each places total together.
E or 14 x 16 = 224
7 x 1 = 7. 
224 + 7 = 231

No comments:

Post a Comment