Professional Documents
Culture Documents
Lecture # 6
By
Aimen Sikander
Asad Hanif 1
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
NUMBER SYSTEM
▪ Number systems are the technique to represent numbers
in the computer system architecture, every value that you
are saving or getting into/from computer memory has a
defined number system.
Asad Hanif 2
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Number System
▪ When we type some letters or words, the computer
translates them in numbers as computers can understand
only numbers.
Asad Hanif 3
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Number System
Computer architecture supports following number systems.
Number System
Binary Number System
• A Binary number system has only two digits that are 0 and 1.
Asad Hanif 5
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Number System
Binary Number System
• Each binary digit is also called a bit.
Asad Hanif 6
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Number System
Octal Number System
• Octal number system has only eight (8) digits from 0 to 7.
Asad Hanif 7
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Number System
Decimal Number System
• Decimal number system has only ten (10) digits from 0 to 9.
Asad Hanif 8
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Number System
Hexadecimal Number System
• A Hexadecimal number system has sixteen (16) alphanumeric
values from 0 to 9 and A to F.
Number System
Asad Hanif 10
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
4 3 2 1
Step 1 101012 ((1 x 2 ) + (0 x 2 ) + (1 x 2 ) + (0x 2 ) +
0
(1 x 2 )) 10
Asad Hanif 12
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
4 3 2 1
Step 1 125708 ((1 x 8 ) + (2 x 8 ) + (5 x 8 ) + (7 x 8 ) +
0
(0 x 8 )) 10
Asad Hanif 13
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
4 3 2 1
Step 1 19FDE16 ((1 x 16 ) + (9 x 16 ) + (F x 16 ) + (D x 16 ) +
0
(E x 16 )) 10
4 3 2 1
((1 x 16 ) + (9 x 16 ) + (15 x 16 ) + (13 x 16 ) +
Step 2 19FDE16 0
(14 x 16 ))10
Step 3 19FDE16 (65536+ 36864 + 3840 + 208 + 14) 10
Asad Hanif 14
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 15
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Step 4 − Record the remainder from Step 3 as the next digit (to
the left) of the new base number.
The last remainder thus obtained will be the Most Significant Digit
(MSD) of the new base number.
Asad Hanif 16
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Step 1 29 / 2 14 1
Step 2 14 / 2 7 0
Step 3 7/2 3 1
Step 4 3/2 1 1
Step 5 1/2 0 1
Asad Hanif 18
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 19
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
▪ Step 1 − Divide the binary digits into groups of three (starting from
the right).
▪ Step 2 − Convert each group of three binary digits to one octal digit.
Asad Hanif 21
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 22
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
▪ Step 2 − Combine all the resulting binary groups (of 3 digits each)
into a single binary number.
Asad Hanif 23
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 24
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 25
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 26
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Step 2 − Combine all the resulting binary groups (of 4 digits each)
into a single binary number.
Asad Hanif 27
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 28
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 29
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
1110101
703
1AF
Asad Hanif 30
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Asad Hanif 31
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Common Powers
Base 10 -
Power Preface Symbol Value
-12
10 pico P .000000000001
-9
10 nano n .000000001
-6
10 micro µ .000001
-3
10 milli m .001
3
10 kilo K 1000
6
10 mega M 1000000
9
10 giga G 1000000000
12
10 tera T 1000000000000
Asad Hanif 32
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Common Powers
Base 2 -
Asad Hanif 33
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
ab * ac = ab+c
26 * 210 = 216 = 65,536
or…
2 6 * 2 10 = 64 * 2 10 = 64k
Asad Hanif 34
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Binary Addition
0 1 1
1 0 1
1 1 10
Asad Hanif 35
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Binary Addition
Asad Hanif 36
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Binary Multiplication
0 1 0
1 0 0
1 1 1
Asad Hanif 37
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
Binary Multiplication
– E.g.,
Asad Hanif 38
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
ASCII
▪ASCII, in full American Standard Code for Information
Interchange, a standard data-encoding format for
electronic communication between computers.
▪ ASCII assigns standard numeric values to letters,
numerals, punctuation marks, and other characters used
in computers.
Asad Hanif 40
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
ASCII Code
▪ASCII was originally developed for basic computers and
printers. It uses a 7-bit code to represent characters.
Asad Hanif 41
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
ASCII Code
Asad Hanif 42
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
A set of codes that extends the basic ASCII set. The basic
ASCII set uses 7 bits for each character, giving it a total of 128
unique symbols. The extended ASCII character set uses 8 bits,
which gives it an additional 128 characters. The extra
characters represent characters from foreign languages and
special symbols for drawing pictures.
Asad Hanif 43
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
NUMBER SYSTEM
Asad Hanif 44
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
ASCII
ASCII sections
▪ Lower ASCII, between 32 and 127. This table originates from the
older American systems, which worked on 7-bit character tables.
Asad Hanif 45
CS
CSC 111-100 – Introduction
Introduction to Computing
To Information & Communication Technologies
ASCII
Limitation of ASCII