CGS 3269 Computer Architecture Concepts: Positional Number Systems
CGS 3269 Computer Architecture Concepts: Positional Number Systems
When we need to write the number three hundred and twenty five using decimal
digits we use the following sequence of digits: 325
By denoting the base of the system as b = 10, we can rewrite 325 as:
325 = 3 x b2 + 2 x b1 + 5 x b0
For any number we will refer to each digit by “di”, where “d” represents the digit
and “i” indicates the position in the sequence. Thus we have that any number
can be represented by a sequence of digits: dn dn-1 . . . d2 d1 d0
dn . . . d2 d1 d0
dn . . . d2 d1 d0 = dn x bn. . . d2 x b2 + d1 x b1 + d0 x b0
Example:
d3 d2 d1 d0
4 7 6 2
CGS 3269 Computer Architecture Concepts
Positional number systems
And its value can be computed similarly but in this case the base b = 2.
dn . . . d2 d1 d0 = dn x bn. . . d2 x b2 + d1 x b1 + d0 x b0
Example: (10101)2 = 1 x 24 + 0 x 23 + 1 x 22 + 0 x 21 + 1 x 20
1 x 16 + 0 x 8 + 1 x 4 + 0 x 2 + 1 x 1
16 + 0 + 4 + 0 + 1 = (21) 10
CGS 3269 Computer Architecture Concepts
The following table shows the decimal, binary, and hexadecimal
representation of the first 16 decimal numbers:
(7AF3)16 = ( ?)2
Starting from left to right each hexadecimal digit is replaced by its binary
representation:
(10111110111000)2 = ( ?)16
Starting from right to left we make groups of four bits. If the last group on
the right has less than four bits we add some padding zeros.
10111110111000
2FB8
CGS 3269 Computer Architecture Concepts
Convert from decimal to binary: for example, (147) 10 = ( ? )2
2 |147 1
2|73 1 Read
2|36 0 from
2|18 0 bottom
2|9 1 to
2|4 0 top
2|2 0 the number is: (10010011)2
2|1 1
0
CGS 3269 Computer Architecture Concepts
Octal System { 0, 1, 2, 3, 4, 5, 6, 7}
The End