Computer Fundamentals
Computer Fundamentals
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
Computer
Data processing
Characteristic features of computers
Computers evolution to their present form
Computer generations
Characteristic features of each computer generation
Computer
Data Processing
Capture Data
Manipulate Data
Output Results
Information
Data is raw material used as input and information is
processed data obtained as output of data processing
Characteristics of Computers
Characteristics of Computers
(Continued from previous slide..)
Characteristics of Computers
(Continued from previous slide..)
Evolution of Computers
Evolution of Computers
(Continued from previous slide..)
Computer Generations
Computer Generations
(Continued from previous slide..)
Computer Generations
(Continued from previous slide..)
Third ICs with SSI and Timesharing Faster, smaller, more IBM 360/370
(1964-1975) MSI technologies operating reliable, easier and PDP-8
Larger magnetic system cheaper to produce PDP-11
cores memory Standardization Commercially, easier CDC 6600
Larger capacity of high-level to use, and easier to
disks and programming upgrade than
magnetic tapes languages previous generation
secondary Unbundling of systems
storage software from Scientific, commercial
Minicomputers; hardware and interactive on-
upward line applications
compatible family
of computers
Computer Generations
(Continued from previous slide..)
Fourth ICs with VLSI Operating systems for Small, affordable, IBM PC and
(1975-1989) technology PCs with GUI and reliable, and easy its clones
Microprocessors; multiple windows on a to use PCs Apple II
semiconductor memory single terminal screen More powerful TRS-80
Larger capacity hard Multiprocessing OS and reliable VAX 9000
disks as in-built with concurrent mainframe
programming systems and CRAY-1
secondary storage
languages supercomputers CRAY-2
Magnetic tapes and
floppy disks as portable UNIX operating system Totally general CRAY-X/MP
storage media with C programming purpose machines
Personal computers language Easier to produce
Supercomputers based Object-oriented design commercially
on parallel vector and programming Easier to upgrade
processing and PC, Network-based, Rapid software
symmetric and supercomputing development
multiprocessing applications possible
technologies
Spread of high-speed
computer networks
Computer Generations
(Continued from previous slide..)
Fifth ICs with ULSI Micro-kernel based, Portable computers IBM notebooks
(1989- technology multithreading, Powerful, cheaper, Pentium PCs
Present) Larger capacity distributed OS reliable, and easier SUN
main memory, Parallel to use desktop Workstations
hard disks with programming machines IBM SP/2
RAID support libraries like MPI & Powerful
PVM SGI Origin 2000
Optical disks as supercomputers
portable read-only JAVA PARAM 10000
High uptime due to
storage media World Wide Web hot-pluggable
Notebooks, Multimedia, components
powerful desktop Internet Totally general
PCs and applications purpose machines
workstations More complex Easier to produce
Powerful servers, supercomputing commercially,
supercomputers applications easier to upgrade
Internet Rapid software
Cluster computing development
possible
Electronic
Electronic Devices
Devices Used
Used in
in Computers
Computers of
of Different
Different Generations
Generations
Key Words/Phrases
Learning Objectives
Learning Objectives
(Continued from previous slide..)
Computer as a system
Storage Unit
Secondary
Storage
Control
Unit
Indicates flow of
instructions and data
Arithmetic Indicates the control
Logic Unit exercised by the
control unit
Central Processing Unit (CPU)
Input Unit
Output Unit
Storage Unit
Primary storage
Secondary storage
Arithmetic Central
Logic Unit Control Unit = Processing
+ (CU)
(ALU) Unit (CPU)
Key Words/Phrases
Learning Objectives
Learning Objectives
(Continued from previous slide..)
Number Systems
Characteristics
Use symbols such as I for 1, II for 2, III for 3, IIII
for 4, IIIII for 5, etc
Each symbol represents the same value regardless
of its position in the number
The symbols are simply added to find out the value
of a particular number
Difficulty
It is difficult to perform arithmetic with such a
number system
Characteristics
Characteristics
A positional number system
Has 10 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7,
8, 9). Hence, its base = 10
The maximum value of a single digit is 9 (one
less than the value of the base)
Each position of a digit represents a specific
power of the base (10)
We use this number system in our day-to-day
life
Example
= 2000 + 500 + 80 + 6
Characteristics
A positional number system
Has only 2 symbols or digits (0 and 1). Hence its
base = 2
The maximum value of a single digit is 1 (one less
than the value of the base)
Each position of a digit represents a specific power
of the base (2)
This number system is used in computers
Example
= 16 + 0 + 4 + 0 + 1
= 2110
101012 = 2110
Bit
Characteristics
A positional number system
Has total 8 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7).
Hence, its base = 8
The maximum value of a single digit is 7 (one less
than the value of the base
Each position of a digit represents a specific power of
the base (8)
Example
= 1024 + 0 + 40 + 7
= 107110
Characteristics
A positional number system
Has total 16 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7,
8, 9, A, B, C, D, E, F). Hence its base = 16
The symbols A, B, C, D, E and F represent the
decimal values 10, 11, 12, 13, 14 and 15
respectively
The maximum value of a single digit is 15 (one less
than the value of the base)
Example
1AF16 = (1 x 162) + (A x 161) + (F x 160)
= 1 x 256 + 10 x 16 + 15 x 1
= 256 + 160 + 15
= 43110
Method
Example
47068 = ?10
Common
values
multiplied
47068 = 4 x 83 + 7 x 82 + 0 x 81 + 6 x 80 by the
corresponding
= 4 x 512 + 7 x 64 + 0 + 6 x 1 digits
= 2048 + 448 + 0 + 6 Sum of these
products
= 250210
Division-Remainder Method
Step 1: Divide the decimal number to be converted by
the value of the new base
Note that the last remainder thus obtained will be the most
significant digit (MSD) of the new base number
Example
95210 = ?8
Solution:
8 952 Remainder
119 s 0
14 7
1 6
0 1
Method
Example
5456 = ?4
Solution:
Step 1: Convert from base 6 to base 10
5456 = 5 x 62 + 4 x 61 + 5 x 60
= 5 x 36 + 4 x 6 + 5 x 1
= 180 + 24 + 5
= 20910
4 209 Remainders
52 1
13 0
3 1
0 3
Method
Step 1: Divide the digits into groups of three starting
from the right
Example
11010102 = ?8
0012 = 0 x 22 + 0 x 21 + 1 x 20 = 1
1012 = 1 x 22 + 0 x 21 + 1 x 20 = 5
0102 = 0 x 22 + 1 x 21 + 0 x 20 = 2
Method
Step 1: Convert each octal digit to a 3 digit binary
number (the octal digits may be treated as
decimal for this conversion)
Example
5628 = ?2
Method
Example
1111012 = ?16
0011 1101
Method
Example
2AB16 = ?2
Fractional Numbers
Binary Point
Position 4 3 2 1 0 . -1 -2 -3 -4
Quantity 16 8 4 2 1 1/
2
1/
4
1/
8
1/
16
Represented
Example
Octal Point
Position 3 2 1 0 . -1 -2 -3
Quantity 512 64 8 1 1/
8
1/
64
1/
512
Represented
Example
Key Words/Phrases
Learning Objectives
Computer data
Computer codes: representation of data in binary
Most commonly used computer codes
Collating sequence
Data Types
Computer Codes
Computer Codes
(Continued from previous slide..)
BCD
Example
Show the binary digits used to record the word BASE in BCD
Solution:
B = 110010 in BCD binary notation
A = 110001 in BCD binary notation
S = 010010 in BCD binary notation
E = 110101 in BCD binary notation
Example
Using octal notation, show BCD coding for the word DIGIT
Solution:
D = 64 in BCD octal notation
I = 71 in BCD octal notation
G = 67 in BCD octal notation
I = 71 in BCD octal notation
T = 23 in BCD octal notation
Hence, BCD coding for the word DIGIT in octal notation will be
64 71 67 71 23
D I G I T
EBCDIC
Example
Using binary notation, write EBCDIC coding for the word BIT. How
many bytes are required for this representation?
Solution:
B = 1100 0010 in EBCDIC binary notation
I = 1100 1001 in EBCDIC binary notation
T = 1110 0011 in EBCDIC binary notation
Hence, EBCDIC coding for the word BIT in binary notation will be
ASCII
A 0100 0001 41
B 0100 0010 42
C 0100 0011 43
D 0100 0100 44
E 0100 0101 45
F 0100 0110 46
G 0100 0111 47
H 0100 1000 48
I 0100 1001 49
J 0100 1010 4A
K 0100 1011 4B
L 0100 1100 4C
M 0100 1101 4D
(Continued on next slide)
Example
Write binary coding for the word BOY in ASCII-7. How many bytes are required
for this representation?
Solution:
Since each character in ASCII-7 requires one byte for its representation and
there are 3 characters in the word BOY, 3 bytes will be required for this
representation
Example
Write binary coding for the word SKY in ASCII-8. How many bytes are
required for this representation?
Solution:
Since each character in ASCII-8 requires one byte for its representation
and there are 3 characters in the word SKY, 3 bytes will be required for
this representation
Unicode
Why Unicode:
No single encoding system supports all languages
Different encoding systems conflict
Unicode features:
Provides a consistent way of encoding multilingual
plain text
Defines codes for characters used in all major
languages of the world
Defines codes for special characters, mathematical
symbols, technical symbols, and diacritics
Unicode
Collating Sequence
Sorting in EBCDIC
Example
Solution:
A1 < 1A < 23
Sorting in ASCII
Example
Solution:
Therefore, the sorted sequence will be: 1A, 23, 2a, A1, Aa, a2, and
aA
Key Words/Phrases
Alphabetic data
Alphanumeric data
American Standard Code for Information Interchange (ASCII)
Binary Coded Decimal (BCD) code
Byte
Collating sequence
Computer codes
Control characters
Extended Binary-Coded Decimal Interchange Code (EBCDIC)
Hexadecimal equivalent
Numeric data
Octal equivalent
Packed decimal numbers
Unicode
Zoned decimal numbers
Learning Objectives
Bulb
Switch
Circuit
Pulse
Binary Arithmetic
Binary Addition
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 plus a carry of 1 to next higher column
Solution
Binary Decimal
carry 11 carry 1
10011 19
+1001 +9
11100 28
In this example, carry are generated for first and second columns
Example
Solution
The addition of three 1s
Binary Decimal can be broken up into two
steps. First, we add only
carry 11111 carry 1 two 1s giving 10 (1 + 1 =
10). The third 1 is now
100111 39
added to this result to
+11011 +27 obtain 11 (a 1 sum with a 1
carry). Hence, 1 + 1 + 1 =
1000010 66 1, plus a carry of 1 to next
higher column.
Binary Subtraction
0 - 0 = 0
0 - 1 = 1 with a borrow from the next column
1 - 0 = 1
1 - 1 = 0
Example
Solution
12
0202
10101
-01110
00111
Complement of a Number
Number of digits
in the number
C = Bn - 1 - N
Example
Solution
Example
Find the complement of 68
Solution
Since the number has 1 digit and the value of
base is 8,
(Base)n - 1 = 81 - 1 = 710 = 78
Now 78 - 68 = 18
Hence, complement of 68 = 18
Example
Complement of 1 0 1 1 0 1 0 is
0 1 0 0 1 0 1
Example:
Subtract 5610 from 9210 using complementary method.
Solution
Step 1: Complement of 5610
= 102 - 1 - 56 = 99 56 = 4310 The result may be
verified using the
Step 2: 92 + 43 (complement of 56) method of normal
= 135 (note 1 as carry) subtraction:
Result = 36
Example
Subtract 3510 from 1810 using complementary method.
Solution
18 - 35 = -17
Example
Subtract 01110002 (5610) from 10111002 (9210) using
complementary method.
Solution
1011100
+1000111 (complement of 0111000)
10100011
0100100
Example
Subtract 1000112 (3510) from 0100102 (1810) using
complementary method.
Solution
010010
+011100 (complement of 100011)
101110
Binary Multiplication
0x0=0
0x1=0
1x0=0
1x1=1
Solution
1010 Multiplicand
x1001 Multiplier
1010
x1001
1010
1010SS (S = left shift)
1011010
Binary Division
Example
Example
4 x 8 = 8 + 8 + 8 + 8 = 32
Example
Divide 3310 by 610 using the method of addition
Solution:
33 - 6 = 27
27 - 6 = 21 Since the result of the last
21 - 6 = 15 subtraction is less than zero,
15 - 6 = 9
9-6= 3 Quotient = 6 - 1 (ignore last
3 - 6 = -3 subtraction) = 5
Key Words/Phrases
Ref. Page Chapter 6: Boolean Algebra and Logic Circuits Slide 1/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
Boolean algebra
Fundamental concepts and basic laws of Boolean
algebra
Boolean function and minimization
Logic gates
Logic circuits and Boolean expressions
Combinational circuits and design
Ref. Page 60 Chapter 6: Boolean Algebra and Logic Circuits Slide 2/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Boolean Algebra
Ref. Page 60 Chapter 6: Boolean Algebra and Logic Circuits Slide 3/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 61 Chapter 6: Boolean Algebra and Logic Circuits Slide 4/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Operator Precedence
Ref. Page 62 Chapter 6: Boolean Algebra and Logic Circuits Slide 5/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Operator Precedence
(Continued from previous slide..)
X + Y Z
Ref. Page 62 Chapter 6: Boolean Algebra and Logic Circuits Slide 6/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Postulate 1:
(a) A = 0, if and only if, A is not equal to 1
(b) A = 1, if and only if, A is not equal to 0
Postulate 2:
(a) x + 0 = x
(b) x 1 = x
Ref. Page 62 Chapter 6: Boolean Algebra and Logic Circuits Slide 7/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Postulate 6:
(a) x + x = 1
(b) x x = 0
Ref. Page 62 Chapter 6: Boolean Algebra and Logic Circuits Slide 8/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
For example, in the table below, the second row is obtained from
the first row and vice versa simply by interchanging + with .
and 0 with 1
Ref. Page 63 Chapter 6: Boolean Algebra and Logic Circuits Slide 9/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
2 x+1=1 x0=0
4 x =x Involution Law
5 xx +y=xy x +x y = x + y
6 x+y = x y xy = x y+ De Morgans
Law
Ref. Page 63 Chapter 6: Boolean Algebra and Logic Circuits Slide 10/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 63 Chapter 6: Boolean Algebra and Logic Circuits Slide 11/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Proving a Theorem by Using Postulates
(Example)
Theorem:
x+xy=x
Proof:
L.H.S.
= x+xy
= x1+xy by postulate 2(b)
= x (1 + y) by postulate 5(a)
= x (y + 1) by postulate 3(a)
= x1 by theorem 2(a)
= x by postulate 2(b)
= R.H.S.
Ref. Page 64 Chapter 6: Boolean Algebra and Logic Circuits Slide 12/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Proving a Theorem by Perfect Induction
(Example)
Theorem:
x + x y = x
=
x y xy x+xy
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
Ref. Page 64 Chapter 6: Boolean Algebra and Logic Circuits Slide 13/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
x+x=x
Proof:
L.H.S.
=x+x
= (x + x) 1 by postulate 2(b)
= (x + x) (x + X) by postulate 6(a)
= x + x X by postulate 5(b)
=x+0 by postulate 6(b)
=x by postulate 2(a)
= R.H.S.
Ref. Page 63 Chapter 6: Boolean Algebra and Logic Circuits Slide 14/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Dual Theorem:
xx=x
Proof:
L.H.S.
=xx
=xx+0 by postulate 2(a) Notice that each step of
the proof of the dual
= x x+ xX by postulate 6(b)
theorem is derived from
= x (x + X ) by postulate 5(a) the proof of its
=x1 by postulate 6(a) corresponding pair in
=x by postulate 2(b) the original theorem
= R.H.S.
Ref. Page 63 Chapter 6: Boolean Algebra and Logic Circuits Slide 15/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Boolean Functions
Binary variables
An algebraic expression, or
A truth table
Ref. Page 67 Chapter 6: Boolean Algebra and Logic Circuits Slide 16/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Representation as an
Algebraic Expression
W = X + Y Z
Variable W is a function of X, Y, and Z, can also be
written as W = f (X, Y, Z)
Ref. Page 67 Chapter 6: Boolean Algebra and Logic Circuits Slide 17/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
X Y Z W
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Ref. Page 67 Chapter 6: Boolean Algebra and Logic Circuits Slide 18/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 67 Chapter 6: Boolean Algebra and Logic Circuits Slide 19/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 68 Chapter 6: Boolean Algebra and Logic Circuits Slide 20/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
F1 = x y z + x y z + x y
F1 has 3 literals (x, y, z) and 3 terms
F2 = x y + x z
F2 has 3 literals (x, y, z) and 2 terms
Ref. Page 68 Chapter 6: Boolean Algebra and Logic Circuits Slide 21/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
x y z F1 F2
0 0 0 0 0
0 0 1 1 1
0 1 0 0 0
0 1 1 1 1
1 0 0 1 1
1 0 1 1 1
1 1 0 0 0
1 1 1 0 0
Ref. Page 68 Chapter 6: Boolean Algebra and Logic Circuits Slide 22/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
(a ) x + x y
(
(b ) x x + y )
(c) x y z + x y z + x y
(d ) x y + x z + y z
(e) ( x + y ) ( x + z ) ( y +z )
Ref. Page 69 Chapter 6: Boolean Algebra and Logic Circuits Slide 23/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A +A +A +...+A = A A A ... A
1 2 3 n 1 2 3 n
A A A ... A = A +A +A +...+A
1 2 3 n 1 2 3 n
Ref. Page 70 Chapter 6: Boolean Algebra and Logic Circuits Slide 24/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
F = x y z+ x y z
1
( x + y +z ) ( x + y + z )
Now we complement each literal giving
F = ( x+ y +z) ( x+ y+ z )
1
Ref. Page 71 Chapter 6: Boolean Algebra and Logic Circuits Slide 25/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 71 Chapter 6: Boolean Algebra and Logic Circuits Slide 26/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
0 0 0
x y z m 0 x+y+z M 0
0 0 1
x y z m 1 x+y+z M 1
0 1 0
x y z m 2 x+y+z M 2
0 1 1
x y z m 3 x+y+z M 3
1 0 0
x y z m 4 x+y+z M 4
1 0 1
x y z m 5 x+y+z M 5
1 1 0
x y z m 6 x+ y+z M 6
1 1 1
x y z m 7 x+y+z M 7
Note that each minterm is the complement of its corresponding maxterm and vice-versa
Ref. Page 71 Chapter 6: Boolean Algebra and Logic Circuits Slide 27/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
x x+ y
x+ y z x y+z
xy + xy xy + x yz
Ref. Page 72 Chapter 6: Boolean Algebra and Logic Circuits Slide 28/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Steps to Express a Boolean Function
in its Sum-of-Products Form
Ref. Page 72 Chapter 6: Boolean Algebra and Logic Circuits Slide 29/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Expressing a Function in its
Sum-of-Products Form (Example)
x y z F1
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
Ref. Page 73 Chapter 6: Boolean Algebra and Logic Circuits Slide 30/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Expressing a Function in its
Sum-of-Products Form (Example)
(Continued from previous slide..)
x y z, x y z, and x y z
Taking the OR of these minterms, we get
F1 =x y z+ x y z+ x y z=m1+m 4 + m7
F1 ( x y z ) = (1,4,7 )
Ref. Page 72 Chapter 6: Boolean Algebra and Logic Circuits Slide 31/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
x ( x+ y )( x+ y )( x+ y )
x+ y ( x + y )( x+ y+z )
( x+ y ) z ( x+ y )( x+ y )
Ref. Page 74 Chapter 6: Boolean Algebra and Logic Circuits Slide 32/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 74 Chapter 6: Boolean Algebra and Logic Circuits Slide 33/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Expressing a Function in its
Product-of-Sums Form
x y z F1
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
Ref. Page 73 Chapter 6: Boolean Algebra and Logic Circuits Slide 34/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Expressing a Function in its
Product-of-Sums Form
(Continued from previous slide..)
( x+y+ z ) , ( x+ y+ z ), ( x+ y+ z ) ,
( x+y+ z ) and ( x+ y+ z )
Taking the AND of these maxterms, we get:
F1 ( x,y,z ) = ( 0,2,3,5,6 )
Ref. Page 74 Chapter 6: Boolean Algebra and Logic Circuits Slide 35/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Conversion Between Canonical Forms (Sum-of-
Products and Product-of-Sums)
Example:
( ) ( ) (
F x,y,z = 0,2,4,5 = 1,3,6,7 )
F( x,y,z ) = (1,4,7 ) = ( 0,2,3,5,6 )
Ref. Page 76 Chapter 6: Boolean Algebra and Logic Circuits Slide 36/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Logic Gates
Ref. Page 77 Chapter 6: Boolean Algebra and Logic Circuits Slide 37/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
AND Gate
Ref. Page 77 Chapter 6: Boolean Algebra and Logic Circuits Slide 38/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A
C= AB
B
Inputs Output
A B C=AB
0 0 0
0 1 0
1 0 0
1 1 1
Ref. Page 77 Chapter 6: Boolean Algebra and Logic Circuits Slide 39/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
OR Gate
Ref. Page 77 Chapter 6: Boolean Algebra and Logic Circuits Slide 40/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A
C=A+B
B
Inputs Output
A B C=A +B
0 0 0
0 1 1
1 0 1
1 1 1
Ref. Page 78 Chapter 6: Boolean Algebra and Logic Circuits Slide 41/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
NOT Gate
Ref. Page 78 Chapter 6: Boolean Algebra and Logic Circuits Slide 42/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A A
Input Output
A A
0 1
1 0
Ref. Page 79 Chapter 6: Boolean Algebra and Logic Circuits Slide 43/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
NAND Gate
Ref. Page 79 Chapter 6: Boolean Algebra and Logic Circuits Slide 44/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A
B C= A B= A B=A +B
Inputs Output
A B C = A +B
0 0 1
0 1 1
1 0 1
1 1 0
Ref. Page 79 Chapter 6: Boolean Algebra and Logic Circuits Slide 45/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
NOR Gate
Complemented OR gate
Ref. Page 79 Chapter 6: Boolean Algebra and Logic Circuits Slide 46/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A
B C= A B=A + B=A B
Inputs Output
A B C =A B
0 0 1
0 1 0
1 0 0
1 1 0
Ref. Page 80 Chapter 6: Boolean Algebra and Logic Circuits Slide 47/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Logic Circuits
The three logic gates (AND, OR, and NOT) are logically
complete because any Boolean expression can be
realized as a logic circuit using only these three gates
Ref. Page 80 Chapter 6: Boolean Algebra and Logic Circuits Slide 48/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A
A
NOT D= A (B + C )
B B+C AND
C
OR
Ref. Page 80 Chapter 6: Boolean Algebra and Logic Circuits Slide 49/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Finding Boolean Expression
of a Logic Circuit (Example 2)
OR
A A +B
B
(
C= ( A +B ) A B )
A B A B AND
AND NOT
Ref. Page 81 Chapter 6: Boolean Algebra and Logic Circuits Slide 50/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Boolean Expression = A B + C
AND
A A B
B
A B + C
C
OR
Ref. Page 83 Chapter 6: Boolean Algebra and Logic Circuits Slide 51/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Boolean Expression = A B + C D + E F
AND NOT
A A B A B
B
AND AND
C C D
D A B + C D + E F
AND
E E F E F
F NOT
Ref. Page 83 Chapter 6: Boolean Algebra and Logic Circuits Slide 52/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 84 Chapter 6: Boolean Algebra and Logic Circuits Slide 53/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A A = A + A = A
A
(a) NOT gate implementation.
A A B A B = A B
B
(b) AND gate implementation.
Ref. Page 85 Chapter 6: Boolean Algebra and Logic Circuits Slide 54/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A A = A
A
A B = A + B = A + B
B B = B
B
(c) OR gate implementation.
Ref. Page 85 Chapter 6: Boolean Algebra and Logic Circuits Slide 55/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 85 Chapter 6: Boolean Algebra and Logic Circuits Slide 56/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Boolean Expression = A B + C ( A + B D )
A A B
A B + C ( A + B D )
B
B B D
D A +B D
A
C C ( A +B D )
Ref. Page 87 Chapter 6: Boolean Algebra and Logic Circuits Slide 57/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
AND
A A B OR
1
B
5
AND OR
B B D
2
D A+B D
A B + C ( A+B D)
3
AND
C ( A+B D)
4
C
Ref. Page 87 Chapter 6: Boolean Algebra and Logic Circuits Slide 58/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A
1
B A B + C ( A +B D )
5
B
2
D
3
A
4
C
Ref. Page 87 Chapter 6: Boolean Algebra and Logic Circuits Slide 59/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 89 Chapter 6: Boolean Algebra and Logic Circuits Slide 60/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A + A = A A = A
A
A A +B A + B = A +B
B
Ref. Page 89 Chapter 6: Boolean Algebra and Logic Circuits Slide 61/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A A +A=A
A + B = A B = A B
B + B =B
B
(c) AND gate implementation.
Ref. Page 89 Chapter 6: Boolean Algebra and Logic Circuits Slide 62/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 89 Chapter 6: Boolean Algebra and Logic Circuits Slide 63/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Boolean Expression A B + C ( A +B D )
=
A A B
B A B + C ( A +B D )
B B D
D A +B D
A
C C ( A +B D )
(a) Step 1: AND/OR implementation.
Ref. Page 90 Chapter 6: Boolean Algebra and Logic Circuits Slide 64/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
AN
A D
A B
1
OR
A B + C ( A +B D )
B
5 6
AN
B D
B D
2
D OR
AN
3 D
A
C ( A +B D )
4
C
A +B D
(b) Step 2: Substituting equivalent NOR functions.
(Continued on next slide)
Ref. Page 90 Chapter 6: Boolean Algebra and Logic Circuits Slide 65/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A 1
B A B + C ( A +B D )
5 6
B 2
D
3
A
4
C
(c) Step 3: NOR implementation.
Ref. Page 91 Chapter 6: Boolean Algebra and Logic Circuits Slide 66/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Exclusive-OR Function
A B =A B + A B
A C = A B = A B+ A B
B
A C = A B = A B+ A B
B
Also, ( A B ) C = A (B C ) = A B C
Ref. Page 91 Chapter 6: Boolean Algebra and Logic Circuits Slide 67/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Inputs Output
A B C =A B
0 0 0
0 1 1
1 0 1
1 1 0
Ref. Page 92 Chapter 6: Boolean Algebra and Logic Circuits Slide 68/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A B = A B+ A B
A C = A B = A B+ A B
B
Also, (A B) = A (B C) = A B C
Ref. Page 91 Chapter 6: Boolean Algebra and Logic Circuits Slide 69/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Inputs Output
A B C=AB
0 0 1
0 1 0
1 0 0
1 1 1
Ref. Page 92 Chapter 6: Boolean Algebra and Logic Circuits Slide 70/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 93 Chapter 6: Boolean Algebra and Logic Circuits Slide 71/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Inputs Outputs
A B C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
S = A B+ A B
Boolean functions for the two outputs.
C = A B
Ref. Page 93 Chapter 6: Boolean Algebra and Logic Circuits Slide 72/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A A B
A
S = A B+ A B
B
B A B
A
B C = A B
Ref. Page 94 Chapter 6: Boolean Algebra and Logic Circuits Slide 73/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 94 Chapter 6: Boolean Algebra and Logic Circuits Slide 74/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
S = A B D+ A B D+ A B D+ A B D
C = A B D+ A B D+ A B D+ A B D
= A B+ A D+B D (when simplified)
Ref. Page 95 Chapter 6: Boolean Algebra and Logic Circuits Slide 75/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A A B D
B
D
A A B D
B
D
S
A
B A B D
D
A A B D
B
D
Ref. Page 95 Chapter 6: Boolean Algebra and Logic Circuits Slide 76/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
A A B
B
A A D C
D
B BD
D
(b) Logic circuit diagram for carry
Ref. Page 95 Chapter 6: Boolean Algebra and Logic Circuits Slide 77/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Key Words/Phrases
Absorption law Equivalence function NOT gate
AND gate Exclusive-OR function Operator precedence
Associative law Exhaustive enumeration OR gate
Boolean algebra method Parallel Binary Adder
Boolean expression Half-adder Perfect induction
Boolean functions Idempotent law method
Boolean identities Involution law Postulates of Boolean
Canonical forms for Literal algebra
Boolean functions Logic circuits Principle of duality
Combination logic Logic gates Product-of-Sums
circuits Logical addition expression
Cumulative law Logical multiplication Standard forms
Complement of a Maxterms Sum-of Products
function Minimization of Boolean expression
Complementation functions Truth table
De Morgans law Minterms Universal NAND gate
Distributive law NAND gate Universal NOR gate
Dual identities
Ref. Page 97 Chapter 6: Boolean Algebra and Logic Circuits Slide 78/78
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
Cache
Memory
Accumulato
Decode r register
r I/
Program General- O
control register purpose register
D
Instruction General- E
register purpose V
register I
Memory
address register C
E
Memory buffer
S
register
Input/Output
register
General- General-purpose
purpose register register
Instruction Set
Registers
Sr.
Name of Register Function
No.
Holds address of the active memory
1 Memory Address (MAR)
location
Holds contents of the accessed
2 Memory Buffer (MBR)
(read/written) memory word
Holds address of the next instruction to
3 Program Control (PC)
be executed
Holds data to be operated upon,
4 Accumulator (A)
intermediate results, and the results
Holds an instruction while it is being
5 Instruction (I)
executed
Used to communicate with the I/O
6 Input/Output (I/O)
devices
Processor Speed
Types of Processor
Type of
Features Usage
Architecture
Large instruction set
CISC (Complex Variable-length instructions Mostly used in
Instruction Set Variety of addressing modes personal
Computer) Complex & expensive to computers
produce
Small instruction set
RISC (Reduced
Fixed-length instructions Mostly used in
Instruction Set
Reduced references to workstations
Computer)
memory to retrieve operands
Types of Processor
(Continued from previous slide..)
Type of
Features Usage
Architecture
Allows software to
communicate explicitly to the
processor when operations
are parallel
EPIC (Explicitly
Uses tighter coupling Mostly used in
Parallel
between the compiler and the high-end servers
Instruction
processor and workstations
Computing)
Enables compiler to extract
maximum parallelism in the
original code, and explicitly
describe it to the processor
Types of Processor
(Continued from previous slide..)
Type of
Features Usage
Architecture
Processor chip has multiple
cooler-running, more energy-
efficient processing cores
Improve overall performance
Mostly used in
Multi-Core by handling more work in
high-end servers
Processor parallel
and workstations
can share architectural
components, such as memory
elements and memory
management
Main Memory
Primary Secondary
Property Desirable
storage storage
Storage
Large storage capacity Small Large
capacity
0
1
2
3
4
Addresses of The words
a memory 5
of a memory
(total N words)
N-2
N-1 Each word
contains the same
number of bits =
Bit 1 Bit 2 word length
(Continued on next slide)
1024
4096 4096
Memory Capacity
Types of ROMs
Type Usage
Data is burnt by the manufacturer
Manufacturer-programmed
of the electronic equipment in
ROM
which it is used.
User-programmed ROM
or The user can load and store
read-only programs and data in
Programmable ROM it
(PROM)
Types of ROMs
(Continued from previous slide..)
Type Usage
Electrically EPROM
(EEPROM) A type of EPROM chip in which the
or stored information is erased by
using high voltage electric pulses
Flash memory
Cache Memory
Key Words/Phrases
Key Words/Phrases
(Continued from previous slide..)
Learning Objectives
Learning Objectives
(Continued from previous slide..)
Secondary Storage
Magnetic Tape
Flash Memory
Floppy Hard CD-ROM Card
WORM CD-RW DVD Drive
Disk Disks
(CD-R)
0 12 3 4 5 6 7 8 9 A B C D E F G
Parity bit 7
6 Each vertical
Zone
line represents
5
a binary 1 bit
4
Numeric 3
Illustrates the concepts of frames, tracks, parity bit, and character-by-character data
storage
0 1 2 3 4 5 6 7 8 9 A B Each vertical
8s digit line represents
9
a binary
Track 2s digit 8
1 bit
representation Added zone 7
Added zone 6
Zone 5
Parity bit 4
Zone 3
Units digit 2
4s digit 1
Illustrates the concepts of frames, tracks, parity bit, and character-by-character data
storage
Tape motion
Tape motion
(b) A tape which uses a blocking factor of two. There is an IBG after every two records.
Tape motion
(c) A tape which uses a blocking factor of three. There is an IBG after every three records.
Illustrates the concepts of blocking of records, inter-block gap (IBG), and blocking factor
File header
File header File trailer label of next
label label file
Tape motion
Block of Block of
IBG IBG IBG IBG
records records
Tape header
label File trailer
label of
BOT File header File trailer
label last file
marker label
Tape motion
EOT marker
Write tape header label used to update the contents of tape header label
Back space one block rewinds the tape to the beginning of previous block
Read/write
head assembly
Vacuum
columns
Tape loops
varying in
length
7
8
Write head B
Read head A
Spinning
Read head B
helical
scan
Write head A
Moving tape
Shaft
Track
The number of tracks on a
199 disk may be as few as 40 on
small, low-capacity disks, to
several thousand on large,
high-capacity disks
A sector
Access arms
Surface - 4
assembly
Surface - 5
Lower surface
not used
One read/write
head per surface Central shaft
Direction of
movement of
access arms
assembly
Access arms
assembly
Vertical cross section of a disk system. There is one read/write head per
recording surface
Disk Formatting
Disk Formatting
(Continued from previous slide..)
Magnetic Disks
Floppy Disks
Floppy Disks
(Continued from previous slide..)
Drive spindle
hole in disk
5 - inch
5 - inch
A 5-inch floppy disk enclosed within jacket. The drive mechanism clamps
on to a portion of the disk exposed by the drive access opening in the jacket
Sliding metal
piece cover
3 - inch
Users label for
identification
Write-protect
plastic tab
3 - inch
(b) A 3 - inch floppy disk.
Hard Disks
Zip/Bernoulli Disks
Disk Packs
Winchester Disks
Winchester Disks
(Continued from previous slide..)
Has one long spiral track, which starts at the outer edge
and spirals inward to the center
Track is divided into equal size sectors
(a) Track pattern on an optical disk (b) Track pattern on a magnetic disk
= Number of sectors
Number of bytes per sector
Laser Laser
beam beam
source source
Prism Prism
Sensor Sensor
Laser beam gets Laser beam gets
scattered by a pit reflect by a land
(represents 0) (represents1)
Land Land
Pit Land
Pit Pit
CD-ROM
CD-Read/Write (CD-RW)
Disk Array
Disk Array
A RAID Unit
Multiple
disks
RAID Controller
Computer
CD-ROM Jukebox
Storage Hierarchy
As a single type of storage is not superior in speed of access, capacity, and
cost, most computer systems make use of a hierarchy of storage
technologies as shown below.
Key Words/Phrases
Key Words/Phrases
(Continued from previous slide..)
QIC Standard
Record
Redundant Array of Inexpensive Disks (RAID)
Secondary storage
Sector
Seek time
Sequential access device
Storage hierarchy
Tape controller
Track
Transaction file
Winchester disk
WORM disk
Zip disk
Learning Objectives
I/O Devices
Input Results of
data CPU processing
Input Output
from and in human
Devices Devices
external Memory acceptable
world form
Keyboard devices
Point-and-draw devices
Data scanning devices
Digitizer
Electronic cards based devices
Speech recognition devices
Vision based devices
Keyboard Devices
Q W E R T Y U I O P { } |
Delete
Page Down 7 8 9
Tab [ ] \ End Pg Up
Home
A S : 4 6
Caps Lock D F G H J K L Enter 5
;
< > ? ? 1 2 3
Z X C V B N M Shift
Shift , . / / End Pg Dn
Enter
0 .
Ctrl Alt Alt Ctrl Ins
Del
Point-and-Draw Devices
Mouse
Trackball
Click buttons
Ball to be
rolled with
fingers
Joystick
Click button
Stick
Light
Ball
indicator Socket
Electronic Pen
Touch Screen
Image Scanner
Bar-code Reader
21000 67520
Manufacturer/supplier
identification number Specific product code
number
Digitizer
A Digitizer
Digitizing tablet
Stylus in the form
of cross-hair cursor
Table top
Electronic-card Reader
Vision-Input Systems
Monitors
Printers
Plotters
Screen image projector
Voice response systems
Types of Output
Soft-copy output
Not produced on a paper or some material that can be touched
and carried for being shown to others
Temporary in nature and vanish after use
Examples are output displayed on a terminal screen or spoken out
by a voice response system
Hard-copy output
Produced on a paper or some material that can be touched and
carried for being shown to others
Permanent in nature and can be kept in paper files or can be
looked at a later time when the person is not using the computer
Examples are output produced by printers or plotters on paper
Monitors
Monitors
Monitor
Keyboard
Types of Monitors
Printers
Dot-Matrix Printers
ABCDEFGHIJKLMNO
PQRSTUVWXYZ
0123456789-.,
&/$*#%@=(+)
Inkjet Printers
Inkjet Printers
(Continued from previous slide..)
An Inkjet Printers
Drum Printers
WW W WWWWWWWWWWW
V V V V V V V V V V VV V V
Solid U U U U U U U U U U U U U U
cylindrical T T T T T T T T T T T T T T
S S S S S S S S S S S S S S
drum with R R R R R R R R R R R R R R
embossed QQ Q Q Q Q Q Q Q Q Q Q Q Q
characters P P P P P P P P P P P P P P
O O O O O O O O O O O O O O
N N N N N N N N N N NN N N
Chain/Band Printers
Chain/Band Printers
Laser Printers
Laser Printers
(Continued from previous slide..)
A Laser Printers
Plotters
A Drum Plotter
Paper
Design drawn
on the paper
A Flatbed Plotter
Design
drawn on
the paper
Paper
Speech Synthesizers
Key Words/Phrases
Key Words/Phrases
(Continued from previous slide..)
Soft-copy output
Speech synthesizer
Stylus
Touch Screen
Trackball
Universal Product Code (UPC)
Video Display Terminal (VDT)
Vision-input system
Voice recognition device
Voice reproduction system
Voice response system
Learning Objectives
Software
Types of Software
System Software
Application Software
HARDWARE
(Physical devices/components
of the computer system)
SYSTEM SOFTWARE
(Software that constitute the operating and
programming environment of the computer system)
APPLICATION SOFTWARE
(Software that do a specific task or solve a specific problem)
USERS
(Normally interact with the system via the user
interface provided by the application software)
Firmware
Middleware
Key Words/Phrases
Ref Page Chapter 11: Planning the Computer Program Slide 1/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
Ref Page 183 Chapter 11: Planning the Computer Program Slide 2/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 183 Chapter 11: Planning the Computer Program Slide 3/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Algorithm
Ref Page 184 Chapter 11: Planning the Computer Program Slide 4/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 184 Chapter 11: Planning the Computer Program Slide 5/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Step 8: Stop.
Ref Page 184 Chapter 11: Planning the Computer Program Slide 6/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 185 Chapter 11: Planning the Computer Program Slide 7/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 185 Chapter 11: Planning the Computer Program Slide 8/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Representation of Algorithms
As programs
As flowcharts
As pseudocodes
Ref Page 185 Chapter 11: Planning the Computer Program Slide 9/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Flowchart
Ref Page 186 Chapter 11: Planning the Computer Program Slide 10/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 187 Chapter 11: Planning the Computer Program Slide 11/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Yes A=B
Ref Page 188 Chapter 11: Planning the Computer Program Slide 12/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
I=?
=0 =1 =2 =3 =4 =5 = Other
Ref Page 188 Chapter 11: Planning the Computer Program Slide 13/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 188 Chapter 11: Planning the Computer Program Slide 14/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Percentage = Total / 10
Stop
Ref Page 189 Chapter 11: Planning the Computer Program Slide 15/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 189 Chapter 11: Planning the Computer Program Slide 16/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Start (contd)
Percentage = Total / 10
Ref Page 190 Chapter 11: Planning the Computer Program Slide 17/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Count = 0
Percentage = Total/10
Yes
Stop
Ref Page 191 Chapter 11: Planning the Computer Program Slide 18/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Yes
Is Rollno = 0000000?
Generalized flowchart
No for the solution of
Add marks of all subjects Example 4 using the
Stop
giving Total concept of trailer
record. Here the
process loop is
Percentage = Total / 10 terminated by detecting
a special non-data
record.
Write output data
Ref Page 191 Chapter 11: Planning the Computer Program Slide 19/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 192 Chapter 11: Planning the Computer Program Slide 20/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Yes
Is Rollno = 9999999?
No Write Count
Add marks of all subjects giving Total Stop
Percentage = Total/10
Yes
Write output data
Add 1 to Count
Ref Page 193 Chapter 11: Planning the Computer Program Slide 21/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 193 Chapter 11: Planning the Computer Program Slide 22/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Count = 0
Yes 2
Is Sexcode = Z?
No
1 No Is Sexcode = F?
Yes
Add marks of all subjects giving Total
Percentage = Total / 10
Ref Page 195 Chapter 11: Planning the Computer Program Slide 23/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
No
1 Is Percentage = > 45?
Yes
2
No
1 Is Percentage < 60?
Write Count
Yes
Write output data
Stop
Add 1 to Count
Ref Page 195 Chapter 11: Planning the Computer Program Slide 24/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Levels of Flowchart
Ref Page 196 Chapter 11: Planning the Computer Program Slide 25/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Part of a macro 1
flowchart
I=1 A micro
Flowchart
Total = 0
No
Is I > 10?
Yes
1
Ref Page 196 Chapter 11: Planning the Computer Program Slide 26/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Flowcharting Rules
Ref Page 196 Chapter 11: Planning the Computer Program Slide 27/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Flowcharting Rules
(contd)
Be consistent in using names and variables in the
flowchart
Ref Page 197 Chapter 11: Planning the Computer Program Slide 28/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Advantages of Flowchart
Better Communication
Proper program documentation
Efficient coding
Systematic debugging
Systematic testing
Ref Page 197 Chapter 11: Planning the Computer Program Slide 29/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Limitations of Flowchart
Ref Page 198 Chapter 11: Planning the Computer Program Slide 30/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Pseudocode
Ref Page 198 Chapter 11: Planning the Computer Program Slide 31/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
1. Sequence logic,
2. Selection logic, and
3. Iteration (or looping) logic
Ref Page 199 Chapter 11: Planning the Computer Program Slide 32/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sequence Logic
Process 1
Process 1
Process 2
Process 2
Ref Page 199 Chapter 11: Planning the Computer Program Slide 33/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Selection Logic
Ref Page 200 Chapter 11: Planning the Computer Program Slide 34/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Yes No IF Condition
IF (condition)
THEN Process 1
THEN ELSE ELSE Process 2
Process 1 Process 2
ENDIF
Ref Page 200 Chapter 11: Planning the Computer Program Slide 35/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Yes No
IF (condition)
IF Condition
THEN
THEN Process 1
Process 1
ENDIF
Ref Page 200 Chapter 11: Planning the Computer Program Slide 36/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Yes
Type 1 Process 1
No
Yes
Type 2 Process 2 CASE Type
Yes
Type n Process n
Case Type n: Process n
No
ENDCASE
(a) Flowchart
(b) Pseudocode
Ref Page 201 Chapter 11: Planning the Computer Program Slide 37/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
1. DOWHILE
2. REPEATUNTIL
Ref Page 201 Chapter 11: Planning the Computer Program Slide 38/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Iteration (or Looping) Logic
(DOWHILE Structure)
False
Condition?
True
Process 1 DO WHILE Condition
Process 1
Block
Process n
Process n ENDDO
Ref Page 202 Chapter 11: Planning the Computer Program Slide 39/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Process 1
REPEAT
Process 1
Process n
Process n
False
Condition? UNTIL Condition
True
(a) Flowchart (b) Pseudocode
Ref Page 202 Chapter 11: Planning the Computer Program Slide 40/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 203 Chapter 11: Planning the Computer Program Slide 41/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Advantages of Pseudocode
Ref Page 204 Chapter 11: Planning the Computer Program Slide 42/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Limitations of Pseudocode
Ref Page 204 Chapter 11: Planning the Computer Program Slide 43/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Key Words/Phrases
Algorithm
Basic logic structures
Control structures
Flowchart
Iteration logic
Looping logic
Micro flowchart
Macro flowchart
Pseudocode
Program Design Language (PDL)
Sequence logic
Selection logic
Sentinel value
Structured programming
Trailer record
Ref Page 204 Chapter 11: Planning the Computer Program Slide 44/44
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
Machine language
Assembly language
High-level language
Machine Language
OPCODE OPERAND
(operation code) (Address/Location)
001000000000001100111001 10001471
001100000000010000100001 14002041
011000000000011100101110 30003456
101000111111011100101110 50773456
000000000000000000000000 00000000
In Binary In Decimal
(Difficult to read and understand) (Easier to read and understand)
Advantage
Limitations
Machine Dependent
Difficult to program
Error prone
Difficult to modify
Assembly/Symbolic Language
Assembler
One-to-one correspondence
(Source Program) (Object Program)
FRST 1000
SCND 1001
ANSR 1002
Machine dependent
Knowledge of hardware required
Machine level coding
High-Level Languages
Machine independent
Do not require programmers to know anything about the
internal structure of computer on which high-level
language programs will be executed
Deal with high-level coding, enabling the programmers
to write instructions using English words and familiar
mathematical symbols and expressions
Compiler
Compiler
One-to-many correspondence
(Source (Object
Program) Program)
Compiler
Program P1 in
Compiler for
high-level Machine code
language L1
language L1 for P1
Compiler
(Continued from previous slide..)
Compiler for
language L1 Machine code for Executed on
on computer A P1 that will run computer A
on computer A
Program P1 in high-
level language L1 Same results
obtained
Syntax Errors
Illegal characters
Illegal combination of characters
Improper sequencing of instructions in a program
Use of undefined variable names
Edit
source program
Source program
Compile
source program
Syntax
errors No Generate
detected? object program
Linker
Linker
(Continued from previous slide..)
Interpreter
Role of an Interpreter
Interpreter
(translates and
High-level language executes
program Input Output Result of
statement-by-
(Source Program) program
statement)
execution
Machine independent
Easier to learn and use
Fewer errors during program development
Lower program preparation cost
Better documentation
Easier to maintain
FORTRAN
COBOL
IDENTIFICATION DIVISION.
PROGRAM_ID. SUMUP.
AUTHOR. P K SINHA.
* THIS PROGRAM COMPUTES AND PRINTS
* THE SUM OF GIVEN NUMBERS.
ENVIROMENT DIVISION.
CONFIGURATION SECTION.
SOURCE_COMPUTER. BURROUGHS_6700.
OBJECT_COMPUTER. BURROUGHS_6700.
INPUT_OUTPUT SECTION.
FILE_CONTROL.
SELECT DATA_FILE ASSIGN TO DISK.
SELECT OUTPUT_FILE ASSIGN TO PRINTER.
DATA DIVISION.
FILE SECTION.
FD DATA_FILE
RECORD CONTAINS 80 CHARACTERS
LABEL RECORD IS OMITTED
DATA RECORD IS INPUT_DATA_
RECORD.
01 INPUT_DATA_RECORD.
05 NPICTURE 9(6)V99.
05 FILLER PICTURE X(72).
FD OUTPUT_FILE
RECORD CONTAINS 132 CHARACTERS
LABEL RECORD IS OMITTED
DATA RECORD IS OUTPUT_RECORD.
01 OUTPUT_RECORD.
05 FILLER PICTURE X.
05TITLE PICTURE X(25).
05 SUM PICTURE 9(10)V99.
05 FILLER PICTURE X(94).
WORKING_STORAGE SECTION.
77MESSAGE PICTURE X(25)
VALUE IS THE SUM OF GIVEN NUMBERS=.
PROCEDURE DIVISION.
OPEN_FILES.
OPEN INPUT DATA_FILE.
OPEN OUTPUT OUTPUT_FILE.
INITIALIZATION.
MOVE SPACES TO OUTPUT_RECORD.
MOVE ZERO TO SUM.
PROCESS_LOOP.
READ DATA_FILE AT END GO TO
PRINT_PARA.
ADD N TO SUM.
GO TO PROCESS_LOOP.
PRINT_PARA.
MOVE MESSAGE TO TITLE.
WRITE OUTPUT_RECORD.
END_OF_JOB.
CLOSE DATA_FILE.
CLOSE OUTPUT_FILE.
STOP RUN.
BASIC
Pascal
(* DECLARATION OF VARIABLES *)
VAR SUM, N : REAL;
VAR I : INTEGER;
A Sample C Program
C++
Java
C# (C Sharp)
RPG
LISP
SNOBOL
Simplicity
Naturalness
Abstraction
Efficiency
Structured Programming Support
Compactness
Locality
Extensibility
Suitability to its environment
Subprogram
Structure of a Subprogram
Subprogram header
sqrt (x)
subprogram header 2 1
subprogram call statement
3
6 4 next statement
subprogram body 7
5
Key Words/Phrases
Key Words/Phrases
(Continued from previous slide..)
SNOBOL
Source program
Sub-procedure
Subprogram
Subroutine
Symbolic language
Syntax error
Syntax rules
Written subprograms
Ref Page Chapter 13: System Implementation and Operation Slide 1/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
Ref Page 239 Chapter 13: System Implementation and Operation Slide 2/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 239 Chapter 13: System Implementation and Operation Slide 3/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Syntax errors
Occurs when the rules or syntax of the programming
language are not followed
For example, incorrect punctuation, incorrect word
sequence, undefined terms, and misuse of terms
Syntax errors are detected by a language processor
Logic errors
Occurs due to errors in planning a programs logic
Such errors cause the program to produce incorrect
output.
These errors cannot be detected by a language
processor
Ref Page 240 Chapter 13: System Implementation and Operation Slide 4/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Testing of a Program
Ref Page 240 Chapter 13: System Implementation and Operation Slide 5/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 241 Chapter 13: System Implementation and Operation Slide 6/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 241 Chapter 13: System Implementation and Operation Slide 7/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Difference Between Testing and
Debugging
Ref Page 242 Chapter 13: System Implementation and Operation Slide 8/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Testing can begin in the Debugging can begin only after the program
early stages of software is coded
development. The approach used for debugging largely
Although the test runs of a depends on the personal choice of the
program can be done only programmer and the type of problem in the
4 after the program is coded, program
but the decision of what to
test, how to test, and with
what kind of data to test, can
and should be done before
the coding is started
Ref Page 242 Chapter 13: System Implementation and Operation Slide 9/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Documentation
Program comments
System manual
User manual
Ref Page 243 Chapter 13: System Implementation and Operation Slide 10/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref Page 245 Chapter 13: System Implementation and Operation Slide 11/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Cut-off date
Time
Ref Page 247 Chapter 13: System Implementation and Operation Slide 12/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Overlapping period of
complete operation of
Old system
both the old and the new
systems
New system
Time
(b) Parallel run
Ref Page 247 Chapter 13: System Implementation and Operation Slide 13/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Old system
New system
Time
Ref Page 247 Chapter 13: System Implementation and Operation Slide 14/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
System Evaluation
Ref Page 248 Chapter 13: System Implementation and Operation Slide 15/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
System Maintenance
Ref Page 248 Chapter 13: System Implementation and Operation Slide 16/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Key Words/Phrases
Beta testing
Bugs
Comments
Debugger
Debugging
Documentation
Immediate changeover
Logic errors
Memory dump
Parallel run
Phased conversion
Syntax errors
System evaluation
System maintenance
System manual
Testing
User manual
Ref Page 249 Chapter 13: System Implementation and Operation Slide 17/17
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Chapter 14
Operating Systems
Learning Objectives
Logical
Logical Architecture
Architecture of
of a
a Computer
Computer System
System
Users
Other
System Software and
Application Programs
Operating System
Main Functions of an OS
Process management
Memory management
File management
Security
Command interpretation
Process Management
$END
Data for program
$RUN
$LOAD
COBOL program
$COBOL
$JOB, ONGC05839,
USER=SINHA
Multiprogramming
Job
Uniprogramming System
Main memory
Operating OS area
system
Execution in
progress
CPU
Multiprogramming System
Main memory
Operating system
Job B
Job C
Secondary disk storage (Waiting for CPU)
Execution in
progress
CPU
Process
Process States
States in
in Multiprogramming
Multiprogramming
Requirements
Requirements of
of Multiprogramming
Multiprogramming Systems
Systems
Large memory
Memory protection
Job status preservation
Proper job mix (CPU and I/O bound jobs)
CPU scheduling
Process
Process Control
Control Block
Block (PCB)
(PCB)
process identifier
process state
program counter
values of various CPU
registers
accounting and scheduling
information
I/O status information
Multitasking
Multithreading
Multithreading System
Address space
Address space
Thread
Thread Thread Thread
Multiprocessing
Main
memory
Multiprocessing
Multiprocessing System
System
Main
CPU-1 CPU-2
memory
I/O I/O
processors processors
Time-sharing
Time-sharing
Job is allocated to
Job
New CPU for execution Running
Ready processing
Job
completed
Allotted time slice is over
I/O completed Job must wait
for I/O
completion
Blocked
Advantages
Advantages of
of Time-sharing
Time-sharing Systems
Systems
Memory
Memory Management
Management
Uniprogramming
Uniprogramming Memory
Memory Model
Model
Uniprogramming
Uniprogramming Memory
Memory Model
Model
User process
User area
Unused
Multiprogramming
Multiprogramming Memory
Memory Models
Models
Partition 1
Partition 2
Partition n
Multiprogramming
Multiprogramming with
with Variable
Variable Number
Number of
of
Memory
Memory Partitions
Partitions
The number, size, and location of the partitions vary dynamically as processes come and go.
Virtual Memory
Disadvantages
Disadvantages of
of Virtual
Virtual Memory
Memory
File Management
File Operations
File Naming
File
File Extensions
Extensions (Example)
(Example)
File
File Extensions
Extensions (Example)
(Example)
(Continued from previous slide)
Security
Security
Command Interpretation
Command Interpretation
(Continued from previous slide)
OS
OS Capability
Capability Enhancement
Enhancement Software
Software
UNIX
UNIX OS
OS
MS-DOS
Microsoft Windows
Microsoft Windows NT
Linux
Keywords/Phrases
Access control Memory management
Batch processing Memory partition
Command interpretation Microsoft Windows
Command-line interface (CLI) Microsoft Windows NT
CPU-bound jobs MS-DOS
Cryptography Multiprocessing
Demand paging Multiprogramming
External security Multiprogramming with fixed tasks (MFT)
File Multiprogramming with variable tasks
File attributes (MVT)
File extensions Operating systems
File management Multithreading
Graphical User Interface (GUI) Process
I/O-bound jobs Process Control Block (PCB) Multitasking
Internal security Process management
Job control language (JCL) Random access files
Library programs Response time
Linux Security
Loosely coupled system Sequential access files
Swapping
Keywords/Phrases
(Continued from previous slide)
Throughput
Tightly coupled system
Time-sharing
Time slice
Time slot
Translating programs
Turnaround time
Unix
User authentication
Utility programs
Virtual machine
Virtual memory
Learning Objectives
Word-processing package
Spreadsheet package
Graphics package
Personal assistance package
Ref. Page 278 Chapter 15: Application Software Packages Slide 2/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Word-Processing Package
Ref. Page 278 Chapter 15: Application Software Packages Slide 3/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 279 Chapter 15: Application Software Packages Slide 4/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 280 Chapter 15: Application Software Packages Slide 5/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 280 Chapter 15: Application Software Packages Slide 6/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 280 Chapter 15: Application Software Packages Slide 7/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 281 Chapter 15: Application Software Packages Slide 8/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 281 Chapter 15: Application Software Packages Slide 9/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 282 Chapter 15: Application Software Packages Slide 10/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Mathematical Symbols
(2)
(S (u ) u [1 ] = u [2 ])
(u)
t R (t ) u
Ref. Page 283 Chapter 15: Application Software Packages Slide 11/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Spreadsheet Package
Ref. Page 285 Chapter 15: Application Software Packages Slide 12/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 286 Chapter 15: Application Software Packages Slide 13/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Common Features of Spreadsheet
Package
Ref. Page 286 Chapter 15: Application Software Packages Slide 14/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sample Spreadsheet
A label running across
Row numbers
multiple columns
Column
letters A B C E E F
1 FINAL EXAM MARKS SHEET(CLASS-X: 2001)
2
3 NAME PHYS CHEM MATHS TOTAL PERCE A label
4 T
Cell F4
5 P. Davis 92 95 88 275 91.66
Ref. Page 288 Chapter 15: Application Software Packages Slide 15/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
15% 40%
35% 10%
(a) A line graph (b) A bar chart (c) A pie chart
Ref. Page 289 Chapter 15: Application Software Packages Slide 16/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Graphics Package
Ref. Page 289 Chapter 15: Application Software Packages Slide 17/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Drawing designs
Painting drawings and pictures
Presenting graphs and charts
Dragging-and-dropping graphic objects
Importing graphic objects
Capturing screen snapshots
Ref. Page 289 Chapter 15: Application Software Packages Slide 18/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 290 Chapter 15: Application Software Packages Slide 19/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Personal-assistance Package
Ref. Page 291 Chapter 15: Application Software Packages Slide 20/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Common Features of Personal
Assistance Package
Calendar
To-do list
Address book
Investments book
Inventory bookf
Ref. Page 291 Chapter 15: Application Software Packages Slide 21/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Key Words/Phrases
Ref. Page 292 Chapter 15: Application Software Packages Slide 22/22
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
Ref. Page 295 Chapter 16: Business Data Processing Slide 2/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Data
Data Processing
Processing
Ref. Page 295 Chapter 16: Business Data Processing Slide 3/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Data
Data Storage
Storage Hierarchy
Hierarchy
Ref. Page 296 Chapter 16: Business Data Processing Slide 4/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Relationship
Relationship Among
Among
Character,
Character, Field,
Field, Record,
Record, and
and File
File
A field having Employee CodeFirst Name Last NameHours workedHourly rateTax rate
4 characters 0004 Kumar Rana 40 14.00 0.09
Employee CodeFirst Name Last NameHours workedHourly rateTax rate
0003 Pratap Singh 43 15.00 0.10
Employee CodeFirst Name Last NameHours workedHourly rateTax rate
0002 Ravi Patel 42 10.00 0.07
Records
Fields
of a file
Ref. Page 297 Chapter 16: Business Data Processing Slide 5/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Standard
Standard Methods
Methods of
of Organizing
Organizing Data
Data
File
File Management
Management System
System
Ref. Page 299 Chapter 16: Business Data Processing Slide 7/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
File
File Types
Types
Ref. Page 299 Chapter 16: Business Data Processing Slide 8/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
File
File Organizations
Organizations
Ref. Page 300 Chapter 16: Business Data Processing Slide 9/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
File
File Organizations
Organizations
Ref. Page 300 Chapter 16: Business Data Processing Slide 10/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Organization
Organization of
of An
An Indexed
Indexed
Sequential
Sequential File
File
Ref. Page 302 Chapter 16: Business Data Processing Slide 11/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
File
File Utilities
Utilities
Ref. Page 303 Chapter 16: Business Data Processing Slide 12/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sorting
Sorting On
On One
One Key
Key
Ref. Page 303 Chapter 16: Business Data Processing Slide 13/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sorting
Sorting On
On Two
Two Key
Key
Ref. Page 303 Chapter 16: Business Data Processing Slide 14/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Merging
Merging of
of Two
Two Files
Files
Input file Output file Input file
Employee Other Employee Other Employee Other
code fields code fields code fields
125 112 112
127 119 119
137 125 129
146 127 139
159 129 150
File A 137 152
139
File B
146
150
152
159
File C
Merging of files A and B to produce file C
Ref. Page 304 Chapter 16: Business Data Processing Slide 15/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Database
Database Management
Management System
System
Ref. Page 305 Chapter 16: Business Data Processing Slide 16/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Database
Database Models
Models
Ref. Page 305 Chapter 16: Business Data Processing Slide 17/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Hierarchical
Hierarchical Database
Database
A child element
Ref. Page 306 Chapter 16: Business Data Processing Slide 18/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Network
Network Database
Database
College
Ref. Page 307 Chapter 16: Business Data Processing Slide 19/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Relational
Relational Database
Database
Membership Members Members Address Borrower Book No. Due Date
No. name (Membership No.) (ISBN) (DD-MM-YYYY)
83569 K. N. Raina C-15, Sarita Vihar, Pune-7 12859 27-21675-2 10-12-2007
62853 D. P. Singh A-22, Anand Park, Pune-5 11348 89303-530-0 08-11-2007
12859 R. Pandey D-18, Vrindavan, Pune-7 32228 13-201702-5 10-11-2007
32228 R. S. Gupta A-12, Nandanvan, Pune-2 16185 22-68111-7 05-12-2007
23466 S. K. Ray B-05, Royal Villa, Pune-3 12859 71606-214-0 06-11-2007
11348 P. K. Sen B-16, Anand Park, Pune-5 62853 13-48049-8 15-11-2007
16185 T. N. Murli A-11, Vrindavan, Pune-7 11348 18-23614-1 12-11-2007
(a) Members data table. (b) Borrowed books data table
Ref. Page 308 Chapter 16: Business Data Processing Slide 20/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sample
Sample Report
Report
Ref. Page 308 Chapter 16: Business Data Processing Slide 21/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Object-Oriented
Object-Oriented Database
Database
Vehicle VehicleSpecs
Id Length
Color Width
Specifications Height
Manufacturer Engine Type
Fuel Type
Fuel Tank Capacity
No. of Wheels
TwoWheeler FourWheeler
DomesticCompany ForeignCompany
Ref. Page 309 Chapter 16: Business Data Processing Slide 22/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Main
Main Components
Components of
of a
a DBMS
DBMS
Ref. Page 310 Chapter 16: Business Data Processing Slide 23/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Main
Main Components
Components of
of a
a DBMS
DBMS
(Continued from previous slide)
Ref. Page 310 Chapter 16: Business Data Processing Slide 24/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Creating
Creating a
a Database
Database
Ref. Page 312 Chapter 16: Business Data Processing Slide 25/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sample
Sample Database
Database Form
Form
EMPLOYEE DATABASE DATA ENTRY FORM
CITY: PUNE
STATE: MH
POSTAL CODE: 411007
Ref. Page 313 Chapter 16: Business Data Processing Slide 26/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Viewing,
Viewing, Modifying,
Modifying, Deleting,
Deleting, and
and
Adding
Adding Records
Records
Ref. Page 314 Chapter 16: Business Data Processing Slide 27/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Searching
Searching a
a Database
Database
Ref. Page 315 Chapter 16: Business Data Processing Slide 28/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Creating
Creating Reports
Reports
Ref. Page 316 Chapter 16: Business Data Processing Slide 29/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sample
Sample Output
Output of
of Report
Report
The report is sorted to present the list in alphabetical order of their last
name
Ref. Page 316 Chapter 16: Business Data Processing Slide 30/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Key
Key Words/Phrases
Words/Phrases
Ref. Page 317 Chapter 16: Business Data Processing Slide 31/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Key
Key Words/Phrases
Words/Phrases
Ref. Page 317 Chapter 16: Business Data Processing Slide 32/32
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page Chapter 17: Data Communications and Computer Networks Slide 1/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
Ref. Page 320 Chapter 17: Data Communications and Computer Networks Slide 2/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 321 Chapter 17: Data Communications and Computer Networks Slide 3/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sender Receiver
(a) Simplex
Sender OR Receiver
(or Receiver) (or Sender)
(b) Half-duplex
Sender Receiver
AND
(and Receiver) (and Sender)
(c) Full-duplex
Ref. Page 321 Chapter 17: Data Communications and Computer Networks Slide 4/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 322 Chapter 17: Data Communications and Computer Networks Slide 5/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 322 Chapter 17: Data Communications and Computer Networks Slide 6/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 323 Chapter 17: Data Communications and Computer Networks Slide 7/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Unshielded Twisted-Pair (UTP)
Cable
Ref. Page 323 Chapter 17: Data Communications and Computer Networks Slide 8/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Coaxial Cable
Copper mesh
Ref. Page 323 Chapter 17: Data Communications and Computer Networks Slide 9/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
In between
Transmitting repeaters Receiving
station station
Ref. Page 324 Chapter 17: Data Communications and Computer Networks Slide 10/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Satellite in space
6 GHz 4 GHz
Uplink Downlink
Transmitting Receiving
station on earth station on earth
Ref. Page 325 Chapter 17: Data Communications and Computer Networks Slide 11/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 326 Chapter 17: Data Communications and Computer Networks Slide 12/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 327 Chapter 17: Data Communications and Computer Networks Slide 13/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 329 Chapter 17: Data Communications and Computer Networks Slide 14/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Voltage
+v
0 t
1/f 2/f
-v
(a) Analog signal
v
1 1 1 1
0 0 0 0
t
(b) Digital signal
Ref. Page 328 Chapter 17: Data Communications and Computer Networks Slide 15/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Modulation Techniques
Ref. Page 328 Chapter 17: Data Communications and Computer Networks Slide 16/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Modems
Ref. Page 328 Chapter 17: Data Communications and Computer Networks Slide 17/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Analog signals on
Digital signals Digital signals
telephone line
01 1 0 Modulator Demodulator 0 1 1 0
Sender Receiver
Computer Modulator Computer
Demodulator
0 100 0 1 00
modem at modem at
sender receiver
computer end computer end
Ref. Page 329 Chapter 17: Data Communications and Computer Networks Slide 18/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Transmission speed
Internal versus external
Facsimile facility
Ref. Page 329 Chapter 17: Data Communications and Computer Networks Slide 19/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 331 Chapter 17: Data Communications and Computer Networks Slide 21/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Multiplexing
Ref. Page 331 Chapter 17: Data Communications and Computer Networks Slide 22/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 332 Chapter 17: Data Communications and Computer Networks Slide 23/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Frequency-Division Multiplexing
Modulator Demodulator
Frequency-Division Multiplexing
Ref. Page 332 Chapter 17: Data Communications and Computer Networks Slide 24/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Time-Division Multiplexing
Signal A3 A2 A1 A3 A2 A1
A
Sending Receiving
end end
Demulti-
Signal B3 B2 B1 Channel plexer B3 B2 B1
B
C2 B2 A2 C1 B1 A1
Signal C3 C2 C1 C3 C2 C1
C
Ref. Page 333 Chapter 17: Data Communications and Computer Networks Slide 25/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 333 Chapter 17: Data Communications and Computer Networks Slide 26/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 333 Chapter 17: Data Communications and Computer Networks Slide 27/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Data Transmission
Ref. Page 334 Chapter 17: Data Communications and Computer Networks Slide 28/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Switching Techniques
Ref. Page 334 Chapter 17: Data Communications and Computer Networks Slide 29/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Switching Techniques
Ref. Page 336 Chapter 17: Data Communications and Computer Networks Slide 30/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Switching
nodes
Dotted line
indicates
establishment of
physical path
Source
node Destination
node
Ref. Page 335 Chapter 17: Data Communications and Computer Networks Slide 31/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Store-and-Forward Method of
Message Switching
4 B
A 1
3
2
C
C
Ref. Page 336 Chapter 17: Data Communications and Computer Networks Slide 32/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Broadcast Method of Message
Switching
Nodes 1 2 3 n
Message
Broadcast Channel
Ref. Page 337 Chapter 17: Data Communications and Computer Networks Slide 33/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Routing Techniques
Ref. Page 338 Chapter 17: Data Communications and Computer Networks Slide 34/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Network Topologies
Ref. Page 338 Chapter 17: Data Communications and Computer Networks Slide 35/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Star Network
Host
Node
Ref. Page 339 Chapter 17: Data Communications and Computer Networks Slide 36/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ring Network
Ref. Page 339 Chapter 17: Data Communications and Computer Networks Slide 37/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 340 Chapter 17: Data Communications and Computer Networks Slide 38/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Computers (nodes)
Ref. Page 341 Chapter 17: Data Communications and Computer Networks Slide 39/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Hybrid Network
Ring Completely
Star connected
Ref. Page 341 Chapter 17: Data Communications and Computer Networks Slide 40/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Network Types
Ref. Page 342 Chapter 17: Data Communications and Computer Networks Slide 41/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Communication Protocols
Ref. Page 343 Chapter 17: Data Communications and Computer Networks Slide 42/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Communication Protocols
Ref. Page 343 Chapter 17: Data Communications and Computer Networks Slide 43/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 344 Chapter 17: Data Communications and Computer Networks Slide 44/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 344 Chapter 17: Data Communications and Computer Networks Slide 45/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Network
Ref. Page 346 Chapter 17: Data Communications and Computer Networks Slide 46/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
An
An example
example illustrating
illustrating transfer
transfer of
of message
message M M from
from sending
sending node
node to to the
the
receiving
receiving node
node in
in the
the OSI
OSI model:
model: H
Hnn,, header
header added
added by
by layer
layer n:T
n:Tnn,, trailer
trailer
added
added by
by layer
layer n.
n.
Sending node Receiving node
Process A Process B
H7 M H7 M
H6 H M H6 H7 M
7
H5 H6 H7 M H5 H6 H7 M
H 4 H 5 H 6 H 7 M1 H 4 H 5 H 6 H 7 M2 H 4 H 5 H 6 H 7 M1 H 4 H 5 H 6 H 7 M2
H 3 H 4 H 5 H 6 H 7 M1 H 3 H 4 H 5 H 6 H 7 M2 H 3 H 4 H 5 H 6 H 7 M1 H 3 H 4 H 5 H 6 H 7 M2
H2 H3 H4 H5 H6 H7 M1 T2 H2 H3 H4 H5 H6 H7 M2 T2 H2 H3 H4 H5 H6 H7 M1 T2 H2 H3 H4 H5 H6 H7 M2 T2
Ref. Page 348 Chapter 17: Data Communications and Computer Networks Slide 47/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Internetworking
Ref. Page 348 Chapter 17: Data Communications and Computer Networks Slide 48/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Bridges
Ref. Page 349 Chapter 17: Data Communications and Computer Networks Slide 49/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Routers
Ref. Page 349 Chapter 17: Data Communications and Computer Networks Slide 50/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Gateways
Ref. Page 349 Chapter 17: Data Communications and Computer Networks Slide 51/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 349 Chapter 17: Data Communications and Computer Networks Slide 52/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Wireless Technologies
2G and 3G
Wireless LAN
WiMAX
Wireless Local Loop (WLL)
Radio-router
Multihop Wireless Network
Wireless Application Protocol (WAP)
Ref. Page 351 Chapter 17: Data Communications and Computer Networks Slide 53/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 352 Chapter 17: Data Communications and Computer Networks Slide 54/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Main Advantages of Distributed
Computing Systems
Ref. Page 353 Chapter 17: Data Communications and Computer Networks Slide 55/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Keywords/Phrases
Ref. Page 354 Chapter 17: Data Communications and Computer Networks Slide 56/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Keywords/Phrases
Metropolitan Area Network (MAN) Protocol suite (Continued from previous slide)
Microwave system Repeater
Mobile computing Ring network
Modem Router
Modulation Session layer
Multi-access Bus network Simplex
Multiplexer Source routing
Narrowband Star network
Network Interface Card (NIC) Store-and-forward
Network layer Synchronous transmission
Network topology Time-Division Multiplexing (TDM)
Nomadic computing Transport Control Protocol (TCP)
Optical fibers Transport layer
OSI Model Twisted-pair
Packet switching Unshielded twisted-pair (UTP)
Phase Modulation (PM) User Datagram Protocol (UDP)
Physical layer Value Added Network (VAN)
POTS (Plain Old Telephone Service) Voiceband
Presentation layer VSAT (Very Small Aperture Terminals)
Protocol family Wide Area Network (WAN)
Protocol stack Wireless network
Ref. Page 354 Chapter 17: Data Communications and Computer Networks Slide 57/57
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
The Internet
The Internet
(Continued from previous slide..)
Electronic Mail
Telnet
Usenet News
WWW Browsers
WWW Browsers
(Continued from previous slide..)
Keywords/Phrases
Learning Objectives
Multimedia
Common Media
Text Media
(Continued from previous slide..)
Graphics Media
Animation Media
Animation Media
(Continued from previous slide..)
Virtual Reality
Audio Media
Video Media
Multimedia Applications
Multimedia presentation
Foreign language learning
Video games
Special effects in films
Multimedia kiosks as help desks
Animated advertisements
Multimedia conferencing
High-resolution
display screen
System
Unit
Remote
Control
Mouse
Keyboard
Keywords/Phrases
Animation
Audio
Clip art
Cognitive graphics
Computer Aided Design (CAD)
Computer Aided Manufacturing (CAM)
Frames
Generative graphics
Graphics
Multimedia
Media Center Computer
Pixel
Refresh rate
Text
Transducer
Transition effects
Video
Virtual reality
Learning Objectives
Classifications of computers
Common types of computers today
Characteristic features of various types of
computers in use today
Computer Classification
Types of Computers
Notebook Computers
Notebook Computers
(Continued from previous slide..)
Notebook Computers
Foldable flat
screen
Keyboard, trackball,
hard disk, floppy
disk drive, etc. are
in this unit
Common PC Models
Monitor
System
Unit Mouse
Mouse
Keyboard
(a) Desktop model (b) Tower model
Workstations
Mainframe Systems
Mainframe Systems
(Continued from previous slide..)
Console
Front-end
Processor
Supercomputers
Supercomputers
(Continued from previous slide..)
Client-Server Computing
PC (Client)
PC (Client) File
Server
LAN or WAN or an
Internet of Networks
PC (Client)
Database
Server
Workstation
(Client)
Workstation
(Client)
Handheld Computers
Handheld Computers
Size Very Small Medium Large Large Generally Generally Very small
small (can be (slightly (needs a (needs a small (may large (can be
(can be placed on larger than large room) large room) be large if it placed on
placed on an office PC) is also play ones palm)
ones lap) table) the role of a
server
Main memory Low Low High Higher Highest Generally Generally Low
capacity low high
Hard disk Low Low High Highest Higher Generally Generally Low
storage low high
capacity
Has its own Yes Yes Yes Generally no Generally no Yes Generally No
monitor, no
keyboard, and
mouse for
user interface
Types of
Work Mainframe Super
Computers
Notebook PC station system computer Client Server Handheld
Key
features
Display Foldable Medium Large-screen Generally Generally not Medium to Generally Small
facility flat screen size color monitor not available large not display
small display which can available screen available
display screen display high monitor
resolution
graphics
Types of
Computers Work
Notebook Personal station Mainframe Super Client Server Handheld
Key Computer system computer
features
Popular Word Personal Computing Data and Large Provide Manage a Computing,
usage processing; computing needs of information processor- highly shared Personal
Spreadsheet needs of engineers, processing bound user- resource Information
; Data individuals architects, of I/O- application friendly and Managemen
Entry; either in designers; bound s like interface provide a t (PIM), cell
Preparing their Simulation of applications complex in a client- set of phone,
presentation working complex scientific server shared digital
materials; places or at scientific and simulation computing user camera
and Making their engineering s environme services
presentation homes; and problems and nt in a
s Education visualizing the client-
and results of server
entertain- simulation; and computin
ment of Multimedia g
children applications environm
and adults ent
Major IBM, IBM, Apple, Sun IBM, DEC Cray, IBM, Same as Same as Nokia,
vendors Compaq, Compaq, Microsystems Silicon PC and Workstation, Sony,
Siemens, Dell, , IBM, DEC, Graphics, Workstati Mainframe Motorola,
Toshiba Zenith, Hewlett- Fujitsu, on System, & Dell,
Siemens, Packard, Intel, C- vendors Super- Hawlett-
Toshiba, Silicon DAC computer Packard
Hewlett- Graphics vendors
Packard
Key Words/Phrases
Back-end computer
Client computer
Client process
Front-end computer
Host computer
Handheld
I/O-bound application
Laptop PC
Mainframe system
Massively parallel processors
Minicomputer
Notebook computer
Parallel computers
Parallel processing system
Personal Computer (PC)
Processor-bound application
Server computer
Server process
Supercomputer
System board
Workstation
Learning Objectives
Ref. Page 395 Chapter 21: Introduction to C Programming Language Slide 2/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Features
Ref. Page 395 Chapter 21: Introduction to C Programming Language Slide 3/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
C Character Set
Uppercase alphabets A, B, C, , Z 26
Lowercase alphabets a, b, c, , z 26
Digits 0, 1, 2, , 9 10
~ `! @ # % ^ & * ( ) _
Special characters 31
+ = | \ {}[ ]:; " ' < > , . ? /
93
Ref. Page 396 Chapter 21: Introduction to C Programming Language Slide 4/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Constants
Ref. Page 396 Chapter 21: Introduction to C Programming Language Slide 5/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 397 Chapter 21: Introduction to C Programming Language Slide 6/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 397 Chapter 21: Introduction to C Programming Language Slide 7/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 397 Chapter 21: Introduction to C Programming Language Slide 8/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Variables
Ref. Page 398 Chapter 21: Introduction to C Programming Language Slide 9/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 398 Chapter 21: Introduction to C Programming Language Slide 10/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 399 Chapter 21: Introduction to C Programming Language Slide 11/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
int count;
short index;
long principle;
float area;
double radius;
char c;
Ref. Page 399 Chapter 21: Introduction to C Programming Language Slide 12/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Standard Qualifiers in C
Sign signed + or
unsigned + only
Ref. Page 399 Chapter 21: Introduction to C Programming Language Slide 13/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Lifetime and Visibility Scopes of
Variables
Ref. Page 399 Chapter 21: Introduction to C Programming Language Slide 14/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Keywords
Ref. Page 400 Chapter 21: Introduction to C Programming Language Slide 15/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Comments
Ref. Page 400 Chapter 21: Introduction to C Programming Language Slide 16/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Operators
Ref. Page 401 Chapter 21: Introduction to C Programming Language Slide 17/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Arithmetic Operators
Arithmetic Operators
+ Addition; x+y LR 4
- Subtraction; x-y LR 4
Multiplication; xy LR 3
/ Division; x/y LR 3
% Remainder (or Modulus); x%y LR 3
++ Increment;
x++ means post-increment (increment LR 1
the value of x by 1 after using its value);
Ref. Page 401 Chapter 21: Introduction to C Programming Language Slide 18/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Arithmetic Operators
Associativit
Operator Meaning with Example Precedence
y
Arithmetic Operators
-- Decrement;
x-- means post-decrement (decrement LR 1
the value of x by 1 after using its value);
--x means pre-decrement (decrement RL 2
the value of x by 1 before using its value)
Ref. Page 401 Chapter 21: Introduction to C Programming Language Slide 19/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Logical Operators
Logical Operators
! Reverse the logical value of a single variable; RL 2
!x means if the value of x is non-zero, make it
zero; and if it is zero, make it one
> Greater than; x>y LR 6
< Less than; x<y LR 6
>= Greater than or equal to; x >= y LR 6
<= Less than or equal to; x <= y LR 6
== Equal to; x == y LR 7
!= Not equal to; x != y LR 7
&& AND; x && y means both x and y should be LR 11
true (non-zero) for result to be true
|| OR; x || y means either x or y should be true LR 12
(non-zero) for result to be true
Ref. Page 402 Chapter 21: Introduction to C Programming Language Slide 20/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Bitwise Operators
Operator Meaning with Example Associativity Precedence
Bitwise Operators
~ Complement; ~x means RL 2
All 1s are changed to 0s and 0s to 1s
& AND; x & y means x AND y LR 8
| OR; x | y means x OR y LR 10
^ Exclusive OR; x ^ y means x y LR 9
<< Left shift; x << 4 means shift all bits in x LR 5
four places to the left
>> Right shift; x >> 3 means shift all bits LR 5
in x three places to the right
&= x &= y means x = x & y RL 14
|= x |= y means x = x | y RL 14
^= x ^= y means x = x ^ y RL 14
<<= x <<= 4 means shift all bits in x four places RL 14
to the left and assign the result to x
>>= x >>= 3 means shift all bits in x three RL 14
places to the right and assign the result to x
Ref. Page 402 Chapter 21: Introduction to C Programming Language Slide 21/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 402 Chapter 21: Introduction to C Programming Language Slide 22/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Miscellaneous Operators
Associativit Precedenc
Operator Meaning with Example
y e
Miscellaneous Operators
Ref. Page 403 Chapter 21: Introduction to C Programming Language Slide 23/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Statements
Ref. Page 403 Chapter 21: Introduction to C Programming Language Slide 24/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Examples of Statements
Ref. Page 403 Chapter 21: Introduction to C Programming Language Slide 25/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 403 Chapter 21: Introduction to C Programming Language Slide 26/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 404 Chapter 21: Introduction to C Programming Language Slide 27/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Basic Format Specifiers for
scanf() and printf()
Format
Data Types
Specifiers
%d integer (short signed)
integer (short
%u
unsigned)
%ld integer (long signed)
%lu integer (long unsigned)
%f real (float)
%lf real (double)
%c character
%s string
Ref. Page 404 Chapter 21: Introduction to C Programming Language Slide 28/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 405 Chapter 21: Introduction to C Programming Language Slide 29/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Output:
Maths marks = 92
Science marks = 87
English marks = 78
Percentage marks obtained = 85.66
Ref. Page 405 Chapter 21: Introduction to C Programming Language Slide 30/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Preprocessor Directives
Ref. Page 405 Chapter 21: Introduction to C Programming Language Slide 31/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Examples of Preprocessor
Directives
#include <stdio.h>
#define PI 3.1415
#define AND &&
#define ADMIT printf (The candidate can be admitted);
#ifdef WINDOWS
.
.
.
Code specific to windows operating system
.
.
.
#else
.
.
.
Code specific to Linux operating system
.
.
.
#endif
.
.
.
Code common to both operating systems
Ref. Page 406 Chapter 21: Introduction to C Programming Language Slide 32/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Standard Preprocessor
Directives in C
Preprocessor Directive Meaning Category
# Null directive
#error message Prints message when processed
Simple
#line linenum filename Used to update code line number and filename
#pragma name Compiler specific settings
#include filename Includes content of another file File
#define macro/string Define a macro or string substitution
#undef macro Removes a macro definition Macro
Ref. Page 407 Chapter 21: Introduction to C Programming Language Slide 33/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Pointers
Ref. Page 407 Chapter 21: Introduction to C Programming Language Slide 34/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
1000 62 i
Address of i = 1000
Value of i = 62
int i = 62;
int p;
int j;
p = &i; / p becomes 1000 /
j = p; / j becomes 62 /
j = 0; / j becomes zero /
j = (&i) / j becomes 62 /
Ref. Page 408 Chapter 21: Introduction to C Programming Language Slide 35/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Array
Ref. Page 408 Chapter 21: Introduction to C Programming Language Slide 36/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
1010 92 Y
1005
1008 63 A
1004
1006 82 1012 10.25
1003 B
1004 66 1008 250.00
1002 M
1002 84 1004 155.50 O
1001
1000 45 1000 82.75 B
1000
Ref. Page 409 Chapter 21: Introduction to C Programming Language Slide 37/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
String
Ref. Page 410 Chapter 21: Introduction to C Programming Language Slide 38/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 410 Chapter 21: Introduction to C Programming Language Slide 39/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 411 Chapter 21: Introduction to C Programming Language Slide 40/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Structure
Ref. Page 411 Chapter 21: Introduction to C Programming Language Slide 41/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Structure (Examples)
Ref. Page 411 Chapter 21: Introduction to C Programming Language Slide 42/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Union
Ref. Page 412 Chapter 21: Introduction to C Programming Language Slide 43/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Union Example
unionNum
{
int intNum;
unsigned
unsNum
};
union Num Number;
Ref. Page 412 Chapter 21: Introduction to C Programming Language Slide 44/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 412 Chapter 21: Introduction to C Programming Language Slide 45/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Control Structures
Ref. Page 413 Chapter 21: Introduction to C Programming Language Slide 46/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 413 Chapter 21: Introduction to C Programming Language Slide 47/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Examples of if Construct
if (i <= 0) if (i <= 0)
i++; i++;
else if (i >= 0)
if (i <= 0) j++;
i++; else
else k++;
j++;
Ref. Page 413 Chapter 21: Introduction to C Programming Language Slide 48/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 414 Chapter 21: Introduction to C Programming Language Slide 49/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 415 Chapter 21: Introduction to C Programming Language Slide 50/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 415 Chapter 21: Introduction to C Programming Language Slide 51/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Loop Structures
Ref. Page 415 Chapter 21: Introduction to C Programming Language Slide 52/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 415 Chapter 21: Introduction to C Programming Language Slide 53/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Ref. Page 415 Chapter 21: Introduction to C Programming Language Slide 54/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Posttest Loop Construct
dowhile
It has a loop condition only that is tested after each
iteration to decide whether to continue with next
iteration or terminate the loop
Example of dowhile is:
do {
printf(i = %d, i);
i++;
}while (i < 10) ;
Ref. Page 416 Chapter 21: Introduction to C Programming Language Slide 55/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Functions
Ref. Page 416 Chapter 21: Introduction to C Programming Language Slide 56/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Example of a Function
Ref. Page 417 Chapter 21: Introduction to C Programming Language Slide 57/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
# include <stdio.h>
void main()
{
int number, remainder;
clrscr(); / clears the console screen /
printf (Enter an integer: );
scanf (%d, &number);
remainder = number % 2;
if (remainder == 0)
printf (\n The given number is even);
else
printf (\n The given number is odd);
getch();
}
Ref. Page 418 Chapter 21: Introduction to C Programming Language Slide 58/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
# include <stdio.h>
# include <conio.h>
void main()
{
int day;
clrscr();
printf (Enter an integer in the range 1 to 7);
scanf (%d, &day);
switch(day)
Ref. Page 418 Chapter 21: Introduction to C Programming Language Slide 59/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
{
Case 1:
MON;
break;
Case 2:
TUE;
break;
Case 3:
WED;
break;
Case 4:
THU;
break;
Case 5:
FRI;
break;
Case 6:
SAT;
break;
Case 7:
SUN;
break;
defautl:
OTH;
}
getch();
}
Ref. Page 418 Chapter 21: Introduction to C Programming Language Slide 60/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
# include <stdio.h>
# include <conio.h>
# define PI 3.1415
void main()
{
float radius, area, circum;
clrscr();
printf (Enter the radius of the circle: );
scanf (%f, &radius);
area = PI radius radius;
circum = 2 PI radius;
printf (\n Area and circumference of the circle are %f
and %f respectively, area, circum);
getch();
}
(Continued on next slide)
Ref. Page 419 Chapter 21: Introduction to C Programming Language Slide 61/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
# include <stdio.h>
# include <conio.h>
# include <string.h>
void main()
{
char input_string[50]; / maximum 50 characters /
int len;
int i = 0, cnt = 0;
clrscr();
printf (Enter a string of less than 50 characters: \n);
gets (input_string);
len = strlen (input_string);
for (i = 0; i < len; i++)
{
switch (input_string[i])
Ref. Page 420 Chapter 21: Introduction to C Programming Language Slide 62/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
{
case a:
case e:
case i:
case o:
case u:
case A:
case E:
case I:
case O:
case U:
cnt++
}
}
printf (\n Number of vowels in the string are: %d, cnt);
getch();
}
Ref. Page 420 Chapter 21: Introduction to C Programming Language Slide 63/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
/ Program to illustrate use of a user defined function. The program initializes an array of n elements
from 0 to n-1 and then calculates and prints the sum of the array elements. In this example n = 10 /
#include <stdio.h>
#define SIZE 10
Ref. Page 421 Chapter 21: Introduction to C Programming Language Slide 64/65
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Key Words/Phrases
Arithmetic operators Macro expansion
Arrays Main function
Assignment operators Member element
Bit-level manipulation Null statement
Bitwise operators Operator associativity
Branch statement Operator precedence
Character set Pointer
Comment statement Posttest loop
Compound statement Preprocessor directives
Conditional branch Pretest loop
Conditional Primitive data types
compilation Reserved words
Constants Simple statement
Control structures Statement block
Format specifiers Strings
Formatted I/O Structure data type
Function Unconditional branch
Keywords Union data type
Library functions User-defined data types
Logical operators Variable name
Loop structures Variable type declaration
Variables
Ref. Page 421 Chapter 21: Introduction to C Programming Language Slide 65/65