A number base is the number of digits or combination of digits that a system of counting uses to represent numbers.
CONTENT
Number Base System
- Conversion from one base to base 10
- Conversion of decimal fraction to base 10, conversion of number from one base to another base
Modular Arithmetic
- Addition Rule
- Subtraction Rule
- Division Rule
NUMBER BASE SYSTEM
A base can be any whole number greater than 0. The most commonly used number system is the decimal system, commonly known as base 10.
Converting between different number bases is actually fairly simple, but the thinking behind it can seem a bit confusing at first.
Conversion from one base to base 10
Convert 1011001012 to base 10
The first row has the digits as listed above while in another row, count these digits off from the RIGHT, starting with zero:
digits: | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 |
numbering: | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
The first row above (labelled “digits”) contains the digits from the binary number; the second row (labelled “numbering”) contains the power of 2 (the base) corresponding to each digit. I will use this listing to convert each digit to the power of two that it represents:
1×28 + 0×27 + 1×26 + 1×25 + 0×24 + 0×23 + 1×22 + 0×21 + 1×20
= 1×256 + 0×128 + 1×64 + 1×32 + 0×16 + 0×8 + 1×4 + 0×2 + 1×1
= 256 + 64 + 32 + 4 + 1
= 357
Then 1011001012 is converted tp 35710
Example:
(1) Convert 12648 to base ten
By expanding the given number
12648 = 1 x 83 + 2 x 82 + 6 x 8 x 4 x 1
= 1 x 512 + 2 x 64 + 6 x 8 + 4 x 1
= 512 + 128 + 48 + 4
= 692ten
(2) Base ten fractions or decimals based on negative power
6 – 583 = 6 x 100 + 5 x 10-1 + 8 x 10-2 + 3 x 10-3
Modular Arithmetic
Practice makes perfect, and that’s exactly what this lesson is about; practice in modular arithmetic. Modular arithmetic is sometimes called clock arithmetic, because the rules in modular arithmetic are the same rules that apply to telling the time. In a clock, there are 12 hours, and once you get to 12:00, the next hour starts over at 1:00. In modular arithmetic, 12 would be called the modulus, and it’s the number we start over at.
Addition, subtraction & Division Rules
Addition rule
a = c (mod m)
b = d (mod m)
a + b = c + d (mod m)
Subtraction rule
When a, b, c and d are integers and m is a positive integer such that
a = c (mod m)
b = (mod m)
a.b = c.d
Division = a/e = b/e (mod m/gcd(m, e))
In each of these rules, the plus sign can be replaced by a subtraction or multiplication sign. These rules state that we can first perform the operation and then find that number modn, or we can find each of the numbers modn and then perform the operation on them. It’s important to note that when dealing with subtraction, you may get negative numbers. When this happens, you add multiples of the modulus n until you get a number between 0 and n – 1