0% found this document useful (0 votes)
33 views65 pages

Number System

The document discusses different number systems including binary, decimal, octal and hexadecimal. It explains how numbers are represented in each system using digits and place value. Methods for converting between number systems such as binary to decimal and hexadecimal to decimal are also presented.

Uploaded by

Joseph22404
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)
33 views65 pages

Number System

The document discusses different number systems including binary, decimal, octal and hexadecimal. It explains how numbers are represented in each system using digits and place value. Methods for converting between number systems such as binary to decimal and hexadecimal to decimal are also presented.

Uploaded by

Joseph22404
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/ 65

INTRODUCTION TO

COMPUTING

Number System
Objectives

• Understand the principles of numbering System


• Identify coding systems used to represent data and programs to a
computer

• Convert numbers from one base to another


Outline

Data Representation

Number System Concepts

Number System Conversion


Introduction

• A number system defines a set of values used to represent a


quantity.

• We apply numbers everyday, and knowing how numbers


work, will give us an insight of how computers manipulate
and store numbers.

• A Number is a mathematical object used in counting and


measuring. Numerals are often used for labels, for ordering
serial numbers, and for codes.
History of Numbering System
• The number system with which we are most familiar is the decimal
(base-10) system, bit over time our ancestor have experimented with a
wide range of alternatives, including duo-decimal (base-12), vigesimal
(bae-20), and sexagesimal (base-60)

• To deal with the basic electronic states of on and off, von Neumann
suggested using the binary numbering system. His insight has vastly
simplified the way computers handle data.
Data Representation
Data Representation
The combination of 0s and 1s that represent characters are defined by patterns
called a coding scheme

• Numeric Data
▪ Used in arithmetic operations
• Binary Number System
▪ Has only two (2) digits : 0 and 1
▪ Allows computers to represent virtually any number simply by using 0s
and 1s

▪ Conveniently translates into electrical “on” and “off” signals


Data Representation
• Character Data
▪ Consists of letters, symbols, and numerals not used in
arithmetic calculations

▪ Represented by a series of bits in a digital computer

• ASCII
• American Standard Code for Information Interchange

• requires only seven bits for each character


Data Representation
• Extended ASCII

▪ A superset of ASCII

▪ Uses eight bits to represent each character

▪ Provides codes for 128 additional characters

• EBCDIC
▪ Extended Binary Coded Decimal Interchange Code
▪ An alternative 8-bit code used by IBM mainframe computers

• UNICODE
• Provides codes for 65,000 characters and makes use of 16 bits
Data Representation

• Bit
The smallest unit of data that a binary computer can
recognize (a single 1 or 0)

• Byte = 8 bits
Byte terminology used to express the size of documents and
other files, programs, etc.

• Nibble= 4 bits
A halfway between a little bit and a big byte
Data Representation
International Electrotechnical Commission (IEC) in 1999 introduced
these to specify binary quantities.
Data Representation

Source: https://physics.nist.gov/cuu/Units/binary.html
Numbering System Concepts
Numbering System is a way of representing numbers

• Decimal (base 10) number system - consist of 10 symbols or digits


0 1 2 3 4 5 6 7 8 9

• Binary (base 2) number system - consist of 2 symbols or digits


0 and 1

• Octal (base 8) number system – consist of 8 symbols or digits


0 1 2 3 4 5 6 7

• Hexadecimal (base 16) number system – consist of 16 symbols or digits


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

• The value denotation of a number “place” or position


Given a base-n number system, the value denotation of a
position m is:
m Value Denotation
1 1
: :
m 1 x n x n … x n (n multiplied m-1 times)

nm-1…+n2+n1+n0.n-1+n-2+n-3…
Numbering System Concepts

Example :

• Given a base-n system and a number PQRST, the value is given by:
Tx1
+Sxn
+Rxnxn
+Qxnxnxn
+Pxnxnxnxn
Number System Concepts
Number System Concepts

The right-most is the least significant digit

4202 = 2x100 + 0x101 + 2x102 + 4x103

The left-most is the most significant digit


Number System Concepts

4202 = 2x100 + 0x101 + 2x102 + 4x103

1’s
multiplier
Number System Concepts

10

4202 = 2x100 + 0x101 + 2x102 + 4x103

10’s
multiplier
Number System Concepts

100

0 1 2 3
4202 = 2x10 + 0x10 + 2x10 + 4x10

100’s
multiplier
Number System Concepts

1000

0 1 2 3
4202 = 2x10 + 0x10 + 2x10 + 4x10

1000’s
multiplier
Number System Concepts

The right-most is the least significant digit

0 1 2 3 4
10011 = 1x2 + 1x2 + 0x2 + 0x2 + 1x2

The left-most is the most significant digit


Number System Concepts

1
0 1 2 3 4
10011 = 1x2 + 1x2 + 0x2 + 0x2 + 1x2

1’s
multiplier
Number System Concepts

2
0 1 2 3 4
10011 = 1x2 + 1x2 + 0x2 + 0x2 + 1x2

2’s multiplier
Number System Concepts

4
0 1 2 3 4
10011 = 1x2 + 1x2 + 0x2 + 0x2 + 1x2

4’s multiplier
Number System Concepts

8
0 1 2 3 4
10011 = 1x2 + 1x2 + 0x2 + 0x2 + 1x2

8’s multiplier
Number System Concepts

16
0 1 2 3 4
10011 = 1x2 + 1x2 + 0x2 + 0x2 + 1x2

16’s
multiplier
Number System Concepts

Example 1: Derive the decimal value of 6409


Solution:
6409 = 0 x 90 + 4 x 91 + 6 x 92
=0x1+4x9+6x9x9
= 0 + 36 + 486
= 522
Number System Concepts
Example 2: Derive the decimal value of 64012

• Derive the decimal value of


Solution:
64012 = 0 x 120 + 4 x 121 + 6 x 122
= 0 x 1 + 4 x 12 + 6 x 12 x 12
= 0 + 48 + 864
= 912
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Number System Conversion

Example 1: Binary to Decimal

• Derive the decimal value of 110111012


Solution:
110111012 = 1 x 20 + 0 x 21 + 1 x 22 + 1 x 23 + 1 x 24 + 0 x 25 + 1 x 26 +
1 x 27
= 1 + 0 + 4 + 8 + 16 + 0 + 64 + 128
= 221
Number System Conversion

Example 2: Fractional binary Example

• Convert 0.10112 to Decimal


Solution:
0.10112 = 1 x 2-1 + 0 x 2-2 + 1 x 2-3 + 1 x 2-4
= 0.5 + 0 + 0.125 + 0.0625
= 0.6875
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Number System Conversion
Example 1: Octal to Decimal

• Derive the Decimal value of 564728 :


Step Value
2 x 80 2x1 =2
+ 7 x 81 7x8 = 56
+ 4 x 82 4 x 64 = 256
+ 6 x 83 6 x 512 = 3,072
+ 5 x 84 5 x 4,096 = 20,480
Total: 23,866
Digits in a Number System

Example 2: Octal to Decimal

• Derive the decimal value of 541760238


Solution:
541760238 = 3 x 80 + 2 x 81 + 0 x 82 + 6 x 83 + 7 x 84 + 1 x 85 + 4 x
86 + 5 x 87
Value = 3 + 16 + 0 + 3072 + 28672 + 32768 + 1048576 +
1,0485760
= 11598867
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Number System Conversion

Example 1: Hexadecimal to Decimal

• Derive the decimal value of 64016


Solution:
64016 = 0 x 160 + 4 X 161 + 6 X 162
= 0 + 64 + 1536
= 1600
Number System Conversion

Example 2: Hexadecimal to Decimal

• Derive the decimal value of 24CF16


Solution:
24CF16 = F x 160 + C x 161 + 4 x 162 + 2 x 163
= 15 + 192 + 1024 + 8192
= 9423
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 75 to Binary
2 75 remainder
2 37 1
2 18 1
2 9 0
2 4 1
2 2 0
2 1 0
0 1

10010112
Check
0 1 2 3
1001011 = 1x2 + 1x2 + 0x2 + 1x2 +
4 5 6
0x2 + 0x2 + 1x2

= 1 + 2 + 0 + 8 + 0 + 0 + 64

= 75
Convert 100 to Binary
2 100 remainder
2 50 0
2 25 0
2 12 1
2 6 0
2 3 0
2 1 1
0 1
11001002
Converting Decimal fractions to Binary
carry
0.3125 x2 0
0.625 x2 1
1.25 x2 0
0.5 x2 1
1.0

0.3125 = 0.01012
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 2654 to Octal

8 2654 remainder
8 331 6
8 41 3
8 5 1
0 5

51368
Convert 266 to Octal

8 266 remainder
8 33 2
8 4 1
0 4

4128
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 2654 to Hexadecimal

16 2654 remainder
16 165 14 E
16 10 5
0 10 A

A5E16
Convert 1234 to Hexadecimal

16 1234 remainder
16 77 2
16 4 13 D
0 4

4D216
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 10112 to Octal
• Method 1
Solution:

a. Convert 10112 to decimal:


10112 = 1 x 20 + 1 x 21 + 0 x 22 + 1 x 23
decimal value = 1 + 2 + 0 + 8 = 11

b. Convert 11 to octal:
11/8 = 1 remainder 3
1/8 = 0 remainder 1
octal value = 138
Convert 101110112 to Octal

• Method 2
Solution:

▪ Group bits in threes, starting on right


▪ Convert to Octal digits
101110112 =10 111 0112

2 7 3 101110112 = 2738
Convert 10110101112 to Octal

• Method 2
Solution:

▪ Group bits in threes, starting on right


▪ Convert to Octal digits
10110101112 = 1 011 010 1112

1 3 2 7
10110101112 = 13278
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 101110112 to Hexadecimal

• Group bits in fours, starting on right


• Convert to Hexadecimal digits
101110112 = 1011 10112

11 11

But 11 B16
101110112 = BB16
Convert 10110101112 to Hexadecimal

• Group bits in fours, starting on right


• Convert to Octal digits
10110101112 = 10 1101 0111

2 13 D 7

10110101112 = 2D716
Convert 11001010010101112 to Hexadecimal

• Convert to each octal digit to a 4-bit equivalent


representation
11001010010101112

12 C 10 A 5 7

11001010010101112 = CA5716
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 7058 to Binary

• Convert to each octal digit to a 3-bit equivalent


representation
7 0 5

111 000 101

7058 = 1110001012
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 10AF16 to Binary

• Convert to each octal digit to a 4-bit equivalent


representation
1 0 A F

0001 0000 1010 1111

10AF16 = 10000101011112
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 10768 to Hexadecimal

1 0 7 6

001 000 111 110


2 3 14 E

10768 = 23E16
Number System Conversion

m a l Octal
Deci

ma l
Binary
a deci
He x
Convert 1F0C16 to Octal

1 F 0 C

0001 1111 0000 1100


1 7 4 1 4

1F0C16 = 174148

You might also like