Base 10 (decimal) numbers developed naturally because the original developers (probably) had ten fingers, or 10 digits. Now consider logical systems that only have wires that can be on or off. When counting with a wire the only digits are 0 and 1, giving a base 2 numbering system. Numbering systems for computers are often based on base 2 numbers but base 4,8,16 and 32 are commonly used. A list of numbering systems is given in table 1 below. An example of counting in these different numbering systems is shown in table 2.
Base
|
Name
|
Data Unit
|
2
|
Binary
|
Bit
|
8
|
Octal
|
Nibble
|
10
|
Decimal
|
Digit
|
16
|
Hexadecimal
|
Byte
|
Figure : Table 1: Numbering system
Decimal
|
Binary
|
Octal
|
Hexadecimal
|
0
|
0
|
0
|
0
|
1
|
1
|
1
|
1
|
2
|
10
|
2
|
2
|
3
|
11
|
3
|
3
|
4
|
100
|
4
|
4
|
5
|
101
|
5
|
5
|
6
|
110
|
6
|
6
|
7
|
111
|
7
|
7
|
8
|
1000
|
10
|
8
|
9
|
1001
|
11
|
9
|
10
|
1010
|
12
|
A
|
11
|
1011
|
13
|
B
|
12
|
1100
|
14
|
C
|
13
|
1101
|
15
|
D
|
14
|
1110
|
16
|
E
|
15
|
1111
|
17
|
F
|
16
|
10000
|
20
|
10
|
17
|
10001
|
21
|
11
|
18
|
10010
|
22
|
12
|
19
|
10011
|
23
|
13
|
20
|
10100
|
24
|
14
|
Figure : Table 2 : Numbers in Decimal, Binary, Octal and Hexadecimal
The effect of changing the base of a number does not change the actual value, only how it is written. The basic rules of mathematics still apply, but many beginners will feel disoriented. This chapter will cover basic topics that are needed to use more complex programming instructions later.
No comments:
Post a Comment