Introduction to Information and
Communication Technologies
CL1000
Week 03
Nabeela Ashraf
Department of Computer Science
Fast-NUCES CFD, Pk
Introduction to Information and Communication Technologies - CL1000 1
What Will You Learn Today?
• History and Evolutions
• Modern Applications of Computer Science
• Basic Components
• Computer Organization/Architecture
2
Introduction to Information and Communication Technologies - CL1000
Recap
• Introduction to Number Systems
• Bit/Byte
• Number Conversions (binary, decimal, octal, hexadecimal)
3
Introduction to Information and Communication Technologies - CL1000
Number System
❖ In earlier days, people used to exchange their
things for other things.
❖ The requirement for numbers primarily originated from
the need to count.
❖ There is evidence that as early as 30,000 BC our
ancient ancestors were tallying or counting
things. That is where the concept of number
systems began.
❖ They used the numbers 1,2,3,.that served the
people for many years because all they needed
to count was their crops, and animals.
❖ Later on numbers such as zero, integers,
rational numbers, irrational numbers were
introduced.
4
Introduction to Information and Communication Technologies - CL1000
Introduction to Information and Communication Technologies -
5
CL1000
Numbers
❖ Natural Numbers:
❖ A natural number is a number that comes naturally,
❖ Natural numbers are greater than zero we can use this numbers as
counting numbers: {1, 2, 3, 4, 5, 6 ….…, }.
❖ Whole numbers:
❖ Whole numbers are just all the natural numbers plus a zero: {0, 1, 2, 3, 4, 5,
……………… , }.
❖ If our system of numbers was limited to the Natural Numbers, then a
number such as –2 would have no meaning. The next number system is
the Integers.
6
Introduction to Information and Communication Technologies - CL1000
❖ Integers:
❖ Integers include the Natural numbers, zero, and the negative Natural
numbers.
❖ Numbers in the form of negative and positive numbers {
❖ ….-4, -3, -2, -1, 0, 1, 2, 3,4, …. }.
❖ Rational number:
❖ Which can be written in the form of
𝒑/𝒒
❖ Where p and q are integers and q ≠ 0 is called a rational number, so all the integers
are rational number .
7
Introduction to Information and Communication Technologies - CL1000
❖Irrational numbers :
❖ The number can not be written in the form of 𝒑/𝒒
❖ Pythagorean in Greece were first to discover irrational number .
❖ √2, √3, 𝜋 are irrational number
8
Introduction to Information and Communication Technologies - CL1000
❖ Real numbers:
❖ All the numbers including rational and irrational numbers are called real number
❖ The official symbol for real numbers is a bold R.
❖ Prime numbers:
❖ The real number which is divisible by 1 and by itself only is called prime number
Ex- 1,2,3,5,7,11,13,17, …..
9
Introduction to Information and Communication Technologies - CL1000
Real Number System
Real
Numbers
(all numbers are real)
Rational Numbers Irrational Numbers
…any number that
…-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 is
Natural Numbers
not rational
Example:
Whole
Integer =
Numbers
s p 3.14159……
e= 2.71828…..
q
10
Introduction to Information and Communication Technologies - CL1000
Number System
❖ A number 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.
11
Introduction to Information and Communication Technologies - CL1000
Bit
➢ bit =Froma shortening of the words “binary digit”
➢ the basicunit of information for computers
➢ 1 or 0 are the onlyvalues
12
Introduction to Information and Communication Technologies - CL1000
Byte
➢ Byte = 8 bits
➢ Each keyboard character is stored as a Byte
➢ Example
➢ A = 01000001
13
Introduction to Information and Communication Technologies - CL1000
14
Introduction to Information and Communication Technologies - CL1000
Text to Binary Conversion
01101000 01100101
hello world 01101100 01101100
01101111 00100000
01110111 01101111
01110010 01101100
01100100
sea = (011100110110010101100001) 2
15
Introduction to Information and Communication Technologies - CL1000
Units
• Byte a grouping of eight bits for instance --> 0110 0001
• Kb (kilobyte) about 1000bytes
• Mb (megabyte) about one thousandKb or one million bytes
• Gb(gigabyte) about one thousand Mb or one billion bytes
• Tb(terabyte) is about one thousandGb or one trillion bytes
16
Introduction to Information and Communication Technologies - CL1000
Terms for Storage Capacity
• 1 bit =0 or 1(b)
• 8 bits =1 byte (B)
• 1 thousand bytes =kilobyte (KB)
• 1 million bytes =megabyte(MB)
• 1 billion bytes =gigabyte (GB)
• 1 trillion =terabyte (TB)
17
Introduction to Information and Communication Technologies - CL1000
Common Number Systems
❑Number system can be categorized as
❑Binary number system
❑Decimal number system
❑Octal number system
❑Hexadecimal Number System
18
Introduction to Information and Communication Technologies - CL1000
❑ Each number system is associated with a base or radix
❑The decimal number system is said to be of base or radix 10
❑ A number in base r contains r digits 0,1,2,...,r-1
❑Decimal (Base 10): 0,1,2,3,4,5,6,7,8,9
19
Introduction to Information and Communication Technologies - CL1000
Used by Used in
System Base Symbols humans? computers?
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa- 16 0, 1, … 9, No No
decimal A, B, … F
Introduction to Information and Communication Technologies -
20
CL1000
Binary System (Base 2)
❑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.
21
Introduction to Information and Communication Technologies - CL1000
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.
S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.
22
Introduction to Information and Communication Technologies - CL1000
Octal System (Base 8)
❑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}
23
Introduction to Information and Communication Technologies - CL1000
Hexadecimal System (Base 16)
❑The word hexadecimal is derived from the Greek root hex (six) and
the Latin root decem (ten).
❑ In this system the base b = 16 and we use sixteen 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}
❑The symbols A, B, C, D, E, F are equivalent to 10, 11, 12, 13,
14, and 15 respectively.
❑The symbols in this system are often referred to as hexadecimal
digits.
24
Introduction to Information and Communication Technologies - CL1000
Conversion Types
• Conversion between Binary & Decimal.
• Conversion between Decimal & Hexadecimal.
• Conversion between Hexadecimal & Binary.
• Conversion between Decimal & Octal.
• Conversion between Octal & Hexadecimal.
• Conversion between Binary & Octal.
25
Introduction to Information and Communication Technologies - CL1000
Conversion Among Bases
26
Introduction to Information and Communication Technologies - CL1000
Binary to Decimal
27
Introduction to Information and Communication Technologies - CL1000
Binary to Decimal
• Technique
• Multiply each bit by 2n, where n is the “weight” of the bit.
• The weight is the position of the bit, starting from 0 on the
right.
• Add the results.
28
Introduction to Information and Communication Technologies - CL1000
Example 1
Bit “0”
(101011)2 => 1 x 20 = 1
1 x 21 = 2
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
(43)10
29
Introduction to Information and Communication Technologies - CL1000
Example 2
30
Introduction to Information and Communication Technologies - CL1000
Binary to Octal
31
Introduction to Information and Communication Technologies - CL1000
Binary to Octal
• Technique
• Group bits in threes, starting on right
• Convert to octal digits
32
Introduction to Information and Communication Technologies - CL1000
Example 1
33
Introduction to Information and Communication Technologies - CL1000
Binary to Hexadecimal
34
Introduction to Information and Communication Technologies - CL1000
Binary to Hexadecimal
• Technique
• Group bits in fours, starting on right
• Convert to hexadecimal digits
35
Introduction to Information and Communication Technologies - CL1000
Example 1
36
Introduction to Information and Communication Technologies - CL1000
Decimal to Binary
37
Introduction to Information and Communication Technologies - CL1000
Decimal to Binary
• Technique
• Divide by 2, keep track of the remainder
• First remainder is bit 0(LSB – least signif icant bit)
• Second remainder is bit 1
• Etc.
38
Introduction to Information and Communication Technologies - CL1000
Example 1
39
Introduction to Information and Communication Technologies - CL1000
Example 2
40
Introduction to Information and Communication Technologies - CL1000
Decimal to Octal
41
Introduction to Information and Communication Technologies - CL1000
Decimal to Octal
• Technique
• Divide by 8
• Keep track of the remainder
42
Introduction to Information and Communication Technologies - CL1000
Example 1
43
Introduction to Information and Communication Technologies - CL1000
Example 2
44
Introduction to Information and Communication Technologies - CL1000
Decimal to Hexadecimal
45
Introduction to Information and Communication Technologies - CL1000
Decimal to Hexadecimal
• Technique
• Divide by 16
• Keep track of the remainder
46
Introduction to Information and Communication Technologies - CL1000
Example 1
47
Introduction to Information and Communication Technologies - CL1000
Example 2
48
Introduction to Information and Communication Technologies - CL1000
Octal to Decimal
49
Introduction to Information and Communication Technologies - CL1000
Octal to Decimal
• Technique
• Multiply each bit by 8n, where n is the “weight” of the bit.
• The weight is the position of the bit, starting from 0 on
the right.
• Add the results.
50
Introduction to Information and Communication Technologies - CL1000
Example 1
51
Introduction to Information and Communication Technologies - CL1000
Example 2
52
Introduction to Information and Communication Technologies - CL1000
Octal to Binary
53
Introduction to Information and Communication Technologies - CL1000
Octal to Binary
• Technique
• Convert each octal digit to a 3-bit equivalent binary representation
54
Introduction to Information and Communication Technologies - CL1000
Example 1
55
Introduction to Information and Communication Technologies - CL1000
Example 2
56
Introduction to Information and Communication Technologies - CL1000
Octal to Hexadecimal
57
Introduction to Information and Communication Technologies - CL1000
Octal to Hexadecimal
• Technique
• Use binary as an intermediary
58
Introduction to Information and Communication Technologies - CL1000
Example
59
Introduction to Information and Communication Technologies - CL1000
Hexadecimal to Decimal
60
Introduction to Information and Communication Technologies - CL1000
Hexadecimal to Decimal
• Technique
• Multiply each bit by 16n, where n is the“weight” of the bit
• T h e weight is the position of the bit, starting from 0 on the right
• A d d the results
61
Introduction to Information and Communication Technologies - CL1000
Example 1
62
Introduction to Information and Communication Technologies - CL1000
Example 2
63
Introduction to Information and Communication Technologies - CL1000
Hexadecimal to Binary
64
Introduction to Information and Communication Technologies - CL1000
Hexadecimal to Binary
• Technique
• Convert each hexadecimal digit to a 4-bit
equivalent binary representation
65
Introduction to Information and Communication Technologies - CL1000
Example 1
66
Introduction to Information and Communication Technologies - CL1000
Example 2
67
Introduction to Information and Communication Technologies - CL1000
Hexadecimal to Octal
68
Introduction to Information and Communication Technologies - CL1000
Hexadecimal to Octal
• Technique
• Use binary as an intermediary
69
Introduction to Information and Communication Technologies - CL1000
Example
70
Introduction to Information and Communication Technologies - CL1000
Any Questions
71
Introduction to Information and Communication Technologies - CL1000