0% found this document useful (0 votes)
31 views25 pages

3.0 Introduction To Number Systems

The document provides an introduction to number systems, explaining how numerical values are represented using different bases such as binary, decimal, octal, and hexadecimal. It details the methods for converting between these systems, including the arithmetic involved in each conversion. The document emphasizes the importance of understanding these systems in the context of computer data processing.

Uploaded by

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

3.0 Introduction To Number Systems

The document provides an introduction to number systems, explaining how numerical values are represented using different bases such as binary, decimal, octal, and hexadecimal. It details the methods for converting between these systems, including the arithmetic involved in each conversion. The document emphasizes the importance of understanding these systems in the context of computer data processing.

Uploaded by

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

INTRODUCTION TO

NUMBER SYSTEMS
CCICOMP
OUTLINE

• NUMBER SYSTEMS
• BASE CONVERSIONS
RECALL:
• Computers process data into information
• Computers work exclusively with numbers. All data is represented
in binary form
• Binary represents data in combinations of 1’s and 0’s
• But, what exactly is ‘binary’??

‘Binary’ is a number system


WHAT IS A NUMBER SYSTEM?
most significant least significant
• A way of representing numerical values
digit digit
• Has its own arithmetic method
• Any arbitrary numerical value can be
represented by a fixed set of symbols

5217.2510
consisting of r elements (also known as
radix or base).
• The largest-valued symbol always has a
magnitude of one less than the radix.
• Each variable that denotes a digit is
assigned a weight dependent on its
position relative to a radix point.

radix point base


DIFFERENT NUMBER SYSTEMS
Radix/Base Number system Radix/Base Number
System
1 Unary 11 Undecimal
2 Binary 12 Duodecimal
3 Ternary 13 Tridecimal
4 Quatenary 14 Tetradecimal
5 Quinary 15 Pentadecimal
6 Senary 16 Hexadecimal
7 Septenary 18 Octodecimal
8 Octal 20 Vigesimal
9 Nonary 24 Tetravigesimal
10 Decimal 25 Pentavigesimal
DECIMAL NUMBER SYSTEM
Example:

5217.25
5 x 10-2 = 5 / 10 / 10
2 x 10-1 = 2 / 10

• Radix/Base: 10 7 x 100 = 7

• Symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 1 x 101 = 1 x 10

• Written as: 25, 25d or 2510 2 x 102 = 2 x 10 x 10

• Each digit is weighted by powers of 10 5 x 103 = 5 x 10 x 10 x 10


BINARY NUMBER SYSTEM
• Radix/Base: 2
• Symbols: 0, 1
• Written as: 1011B OR 10112
• Each digit is weighted by powers of 2

10112
1 x 20 = 1
1 x 21 = 1 x 2
0 x 22 = 0 x 2 x 2
1 x 23 = 1 x 2 x 2 x 2
OCTAL NUMBER SYSTEM
• Radix/Base: 8
• Symbols: 0, 1, 2, 3, 4, 5, 6, 7
• Written as: 327o or 3278
• Each digit is weighted by powers of 8

3278
7 x 80 = 7
2 x 81 = 2 x 8
3 x 82 = 3 x 8 x 8
HEXADECIMAL
NUMBER SYSTEM

• Radix/Base: 16
• Symbols: 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, A (10), B (11), C
(12), D (13), E (14), F (15) 5C816
• Written as: 5C8h or 5C816
• Each digit is weighted by 8 x 160 = 16
powers of 16 12 x 161 = 12 x 16
5 x 162 = 5 x 16 x 16
BASE CONVERSION

• BINARY DECIMAL
• BINARY OCTAL
• BINARY HEXADECIMAL
• DECIMAL OCTAL
• DECIMAL HEXADECIMAL
BINARY → DECIMAL CONVERSION

• Each digit appearing to the left of the binary point represents a value of
either zero or one times an increasing power of two.

EXAMPLE 1:
1012 = ?10 1 0 1
1x22 0x21 1x20
= 1x22 + 0x21 + 1x20
= 4 + 0 + 1
= 510
BINARY → DECIMAL CONVERSION

• Each digit appearing to the left of the binary point represents a value of
either zero or one times an increasing power of two.

EXAMPLE 2:
1010102 = ?10 1 0 1 0 1 0
1x25 0x24 1x23 0x22 1x21 0x20

=1x25 + 0x24 + 1x23 + 0x22 + 1x21 + 0x20


=32 + 0 + 8 + 0 + 2 +0
=4210
DECIMAL → BINARY CONVERSION
• Converting a decimal number to a binary number is done by successively
dividing the decimal number by 2 until a 0 is obtained
• Answer consists of the remainders read bottom up
R R
EXAMPLE 1: EXAMPLE 2:
2 6 0 2 23 1
610 = ?2 2310 = ?2
2 3 1 2 11 1
2 1 1 2 5 1
0 2 2 0
= 1102 2 1 1
0 = 101112
BINARY → OCTAL CONVERSION
• One octal digit is equivalent to three binary digits.
• Group the bits by three starting from the least significant bit.
• If the grouping does not have enough to form 3 bits then append 0 to the
most significant bit.
EXAMPLE 1:
0 0 1 1 0 1
11012 = ?8
0x22 + 0x21 + 1x20 1x22 + 0x21 + 1x20
=0x22 + 0x21 + 1x20 | 1x22 + 0x21 + 1x20
=0 +0 +1 |4 +0 +1
=158
BINARY → OCTAL CONVERSION
• One octal digit is equivalent to three binary digits.
• Group the bits by three starting from the least significant bit (rightmost).
• If the grouping does not have enough to form 3 bits then append 0 to the
most significant bit.
EXAMPLE 2:
11010102 = ?8
0 0 1 1 0 1 0 1 0
0x22 + 0x21 + 1x20 1x22 + 0x21 + 1x20 0x22 + 1x21 + 0x20
=0x22 + 0x21 + 1x20 | 1x22 + 0x21 + 1x20 | 0x22 + 1x21 + 0x20
=0 +0 +1 |4 +0 +1 |0 +2 +0
=1528
OCTAL → BINARY CONVERSION
• Since one octal digit is equivalent to three binary digits, just convert the
individual octal digit into three binary digits.
• Pad with 0s if the binary equivalent of a hex digit is less than 3 digits.

EXAMPLE 1:
578 = ?2 5 7
1 0 1 1 1 1 = 1011112

EXAMPLE 2:
3268 = ?2 3 2 6
0 1 1 0 1 0 1 1 0 = 110101102
BINARY → HEXADECIMAL CONVERSION
• One hexadecimal digit is equivalent to four binary digits.
• Group the bits by four starting from the least significant bit.
• If the grouping does not have enough to form 4 bits then append 0 to the
most significant bit.
EXAMPLE 1:
11012 = ?16
1 1 0 1
1x23 +1x22 + 0x21 + 1x20
=1x23 +1x22 + 0x21 + 1x20
=8 +4 +0 +1
=D16 *RECALL: 1310 = D16
BINARY → HEXADECIMAL CONVERSION
• One hexadecimal digit is equivalent to four binary digits.
• Group the bits by four starting from the least significant bit (rightmost).
• If the grouping does not have enough to form 4 bits then append 0 to the
most significant bit.

EXAMPLE 2: 0 1 1 0 1 0 1 0
11010102 = ?16
0x23 +1x22 + 1x21+0x20 1x23 +0x22 + 1x21 + 0x20
= 0x23 +1x22 + 1x21+0x20 | 1x23 +0x22 + 1x21 + 0x20
=0 +4 + 2 +0 |8 +0 +2 +0
=6A16
HEXADECIMAL → BINARY CONVERSION
• Since one hexadecimal digit is equivalent to four binary digits, just convert
the individual hexadecimal digit into four binary digits
• Pad with 0s if the binary equivalent of a hex digit is less than 4 digits.

EXAMPLE 1:
B A E
BAE16 = ?2
1 0 1 1 1 0 1 0 1 1 1 0

= 1011101011102
EXAMPLE 2:
9 1 D
91D16 = ?2
1 0 0 1 0 0 0 1 1 1 0 1

= 1001000111012
DECIMAL → OCTAL CONVERSION
• Converting a decimal number to an octal number is done by successively
dividing the decimal number by 8
• Answer consists of the remainders read bottom up

R R
EXAMPLE 1: EXAMPLE 2:
8 66 2 8 150 6
6610 = ?8 15010 = ?8
8 8 0 8 18 2
8 1 1 8 2 2
0 0
= 1028 = 2268
OCTAL → DECIMAL CONVERSION
• Each digit appearing to the left of the radix point represents a value between
zero to seven (inclusive) times an increasing power of eight.

EXAMPLE 1: EXAMPLE 2:
278 = ?10 2 7 278 = ?10 1 7 5
2x81 7x80 1x82 7x81 5x80

= 2x81 + 7x80 = 1x82 + 7x81 + 5x80


= 16 + 7 = 64 + 56 + 5
= 2310 = 12510
DECIMAL → HEXADECIMAL CONVERSION
• Converting a decimal number to an octal number is done by successively
dividing the decimal number by 16
• Answer consists of the remainders read bottom up

R R
EXAMPLE 1: EXAMPLE 2:
16 286 14 (E) 16 351 15 (F)
28610 = ?16 35110 = ?16
16 17 1 16 21 5
16 1 1 16 1 1
0 0
= 11E16 = 15F16
HEXADECIMAL → DECIMAL CONVERSION
• Each digit appearing to the left of the radix point represents a value between
zero to 15 (inclusive) times an increasing power of 16.

EXAMPLE 1: EXAMPLE 2:
2A16 = ?10 2 A 30516 = ?10 3 0 5
2x161 10x160 3x162 0x161 5x160

= 2x161 + 10x160 = 3x162 + 0x161 + 5x160


= 32 + 10 = 768 + 0 + 5
= 4210 = 87310
SUMMARY

• A number system is a method of representing numerical values wherein the


base/radix determines the number of symbols used to represent digits and each
digit is weighted based on its position relative to the radix point

• Although binary (base 2) is the native language of computers, humans commonly


also use decimal (base 10), octal (base 8) and hexadecimal (base 16) to
represent values for computer data
SUMMARY
From To
Binary Decimal Multiply each binary digit by increasing powers of 2 then add
Octal Decimal Multiply each octal digit by increasing powers of 8 then add
Hexadecimal Decimal Multiply each hex digit by increasing powers of 16 then add
Decimal Binary Continuous division by 2, remainders will be binary digits
Decimal Octal Continuous division by 8, remainders will be octal digits
Decimal Hexadecimal Continuous division by 16, remainders will be hex digits
Binary Octal Group by 3 digits from the right, convert to corresponding octal
digit
Binary Hexadecimal Group by 4 digits from the right, convert to corresponding hex
digit
Octal Binary Convert each octal digit to corresponding 3-digit binary value
Hexadecimal Binary Convert each hex digit to corresponding 4-digit binary value

You might also like