0% found this document useful (0 votes)
76 views

CGS 3269 Computer Architecture Concepts: Positional Number Systems

This document discusses different number systems including decimal, binary, hexadecimal, and octal. It explains that numbers are represented by sequences of digits with a base or radix. The value of each digit depends on its position, with the rightmost digit having the lowest value. It provides examples of converting between decimal, binary, and hexadecimal representations.

Uploaded by

sharik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

CGS 3269 Computer Architecture Concepts: Positional Number Systems

This document discusses different number systems including decimal, binary, hexadecimal, and octal. It explains that numbers are represented by sequences of digits with a base or radix. The value of each digit depends on its position, with the rightmost digit having the lowest value. It provides examples of converting between decimal, binary, and hexadecimal representations.

Uploaded by

sharik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

CGS 3269 Computer Architecture Concepts

Positional number systems

1.- Decimal number system

2.- Binary number system

3.- Hexadecimal number system

4.- Base conversions


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

What do we know about this number?

It is written using decimal digits (a digit from 0 to 9 in decimal notation), which


means that the base of the decimal number system is 10 (the decimal system
has ten symbols or digits).

Formally we can write 325 as:

3 x 102 + 2 x 101 + 5 x 100 = (3 x 100) + (2 x 10) + (5 x 1) = 300 + 20 + 5 = 325

Note that 100 = 1


CGS 3269 Computer Architecture Concepts
Positional number systems

Formally we can write 325 as:

3 x 102 + 2 x 101 + 5 x 100 = (3 x 100) + (2 x 10) + (5 x 1) = 300 + 20 + 5 = 325

Note that 100 = 1

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

In our example, d2 = 3, d1 = 2, and d0 = 5


CGS 3269 Computer Architecture Concepts
Positional number systems

Therefore any number can be represented by a sequence of digits:

dn . . . d2 d1 d0

And its value can be computed as follows:

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

Binary numbers can be represented in the same way:

( dn . . . d2 d1 d0 )2 Indicates that the base (b) is binary

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:

Decimal Binary Hexadecimal


0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B As we have used up all decimal
12 1100 C symbols, we need to use letters
13 1101 D to represent some digits in the
14 1110 E Hexadecimal system.
15 1111 F
CGS 3269 Computer Architecture Concepts
From hexadecimal to binary

As each hexadecimal number can be represented by four binary digits, then to


convert an hexadecimal number to binary we proceed as follows:

(7AF3)16 = ( ?)2

Starting from left to right each hexadecimal digit is replaced by its binary
representation:

7 = 0111 A = 1010 F = 1111 3 = 0011

0111 1010 1111 0011

Note: see the table in the previous slide.


CGS 3269 Computer Architecture Concepts
From binary to hexadecimal

We need to convert the following binary number to hexadecimal:

(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

0010 1111 1011 1000

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}

Decimal Binary Octal


0 000 0
1 001 1
2 010 2
3 011 3
4 100 4
5 101 5
6 110 6
7 111 7
CGS 3269 Computer Architecture Concepts

Decimal Octal Binary hexadecimal


0 0 0000 0
1 1 0001 1
2 2 0010 2
3 3 0011 3
4 4 0100 4
5 5 0101 5
6 6 0110 6
7 7 0111 7
8 10 1000 8
9 11 1001 9
10 12 1010 A
11 13 1011 B
12 14 1100 C
13 15 1101 D
14 16 1110 E
15 17 1111 F
CGS 3269 Computer Architecture Concepts

The End

You might also like