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

Csi 02

Uploaded by

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

Csi 02

Uploaded by

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

2.

NUMBERING SYSTEMS

Subtitle
Content
 2.1 Introduction
 2.2 Positional Number Systems
 2.3 Conversion
Objectives
After studying this chapter, the student should be able to:
 Understand the concept of number systems.
 Distinguish between non-positional and positional number systems.
 Describe the decimal system (base 10).
 Describe the binary system (base 2).
 Describe the hexadecimal system (base 16).
 Describe the octal system (base 8).
 Convert a number in binary, octal, or hexadecimal to a number in the decimal system.
 Convert a number in the decimal system to a number in binary, octal, or hexadecimal.
 Find the number of digits needed in each system to represent a particular value.
1 - INTRODUCTION
1 - Introduction
 A number system (or numeral system) defines how a number can be represented using
distinct symbols.
 A number can be represented differently in different systems.
 For example, the two numbers (2A)16 and (52)8 both refer to the same quantity, (42)10, but
their representations are different. This is the same as using.

Figure 2.1 Types of number system


2 - POSITIONAL NUMBER SYSTEMS
Introduction
 In a positional number system, the position a symbol occupies in the number
determines the value it represents.
 In this system, a number represented as:

 has the value of:

 in which S is the set of symbols, b is the base (or radix)


The decimal system (base 10)
 The word decimal is derived from the Latin root decem (ten). In this system the base
b = 10 and we use ten symbols to represent a number.
 The set of symbols is S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. As we know, the symbols in this
system are often referred to as decimal digits or just digits.
 In the decimal system, a number is written as:
The binary system (base 2)
 The second positional number system we discuss in this chapter is the binary system.
 The word binary is derived from the Latin root bini (or two by two). In this system the base
b = 2 and we use only two symbols, S = {0, 1}. The symbols in this system are often
referred to as binary digits or bits (binary digit.
 Data and programs are stored in the computer using binary patterns, a string of bits.

Example 2.1 the number (101.11)2 in binary = 5.75 in decimal


The hexadecimal system (base 16)
 Problems:
 The decimal system does not show what is stored in the computer as binary directly—
there is no obvious relationship between the number of bits in binary and the number of
decimal digits. Conversion from one to the other is not fast, as we will see shortly.
 To overcome this problem, two positional systems were devised: hexadecimal and octal.
 We first discuss the hexadecimal system, which is more common. The word hexadecimal
is derived from the Greek root hex (six) and the Latin root decem (ten).
 To be consistent with decimal and binary, it should really have been called sexadecimal,
from the Latin roots sex and decem. In this system the base b = 16 and we use 16
symbols to represent a number. The set of symbols is S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B,
C, D, E, F}.

Example 2.2 the number (2AE)16 in hexadecimal = 686 in


The octal system (base 8)
 The second system that was devised to show the equivalent of the binary system outside
the computer is the octal system.
 The word octal is derived from the Latin root octo (eight). In this system the base b = 8
and we use eight symbols to represent a number.
 The set of symbols is S = {0, 1, 2, 3, 4, 5, 6, 7}. The symbols in this system are often
referred to as octal digits

Example 2.3 the number (1256)8 in octal = 686 in decimal


Summary of the four positional systems

Table 2.1 Summary of the four positional number systems


3 - CONVERSION
Introduction
 We need to know how to convert a number in
one system to the equivalent number in
another system. Since the decimal system is
more familiar than the other systems.
 First show how to covert from any base to
decimal.
 Then show how to convert from decimal to
any base.
 Finally, show how we can easily convert from
binary to hexadecimal or octal and vice
versa.
Covert from any base to decimal

Figure 2.2 Converting other bases to decimal


Covert from any base to decimal (examples)

Example 3.1 Convert the binary number (110.11)2 to decimal: (110.11)2 = 6.75

Example 2.3 Convert the hexadecimal number (1A.23)16 to decimal: 1A.23 =


Convert from decimal to any base
We can convert a decimal number to its equivalent in any base. We need two procedures,
one for the integral part and one for the fractional part.

Convert 35 in decimal to binary.

Convert 126 in decimal to Octal.

Figure 2.3 Algorithm to convert the integral part


Convert from decimal to any base (cont)

Convert decimal number 0.625 to Binary

Convert 0.634 to Octal using a maximum of four digits

Figure 2.4 Algorithm to convert the fractional part


Convert decimal number 178.6 to Hexadecimal
Binary–octal conversion

Figure 2.6 Binary to octal conversion

Example 2.5
What is the binary equivalent of for (24)8?
Solution
Write each octal digit as its equivalent bit pattern to get (010100)2.
Binary–hexadecimal conversion

Figure 2.5 Binary to hexadecimal and hexadecimal to binary

Example 2.4
What is the binary equivalent of (24C)16?
Solution
Each hexadecimal digit is converted to 4-bit patterns:
2 → 0010, 4 → 0100, and C → 1100.
The result is (001001001100)2.
Octal–hexadecimal conversion

Figure 2.7 Octal to hexadecimal and hexadecimal to octal conversion


Exercise
Thanks

You might also like