0% found this document useful (0 votes)
20 views445 pages

CSC 101 Compiled by SISTER IZA ???

The document provides an overview of an introductory computer science course (CSC 101), covering fundamental concepts such as data representation, computer organization, problem-solving, and programming. It outlines the objectives of the course, teaching methods, and evaluation criteria, while also discussing the roles and responsibilities of computer scientists. Additionally, it highlights the relationship between computer science and other disciplines, emphasizing the importance of computational tools and problem-solving techniques.

Uploaded by

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

CSC 101 Compiled by SISTER IZA ???

The document provides an overview of an introductory computer science course (CSC 101), covering fundamental concepts such as data representation, computer organization, problem-solving, and programming. It outlines the objectives of the course, teaching methods, and evaluation criteria, while also discussing the roles and responsibilities of computer scientists. Additionally, it highlights the relationship between computer science and other disciplines, emphasizing the importance of computational tools and problem-solving techniques.

Uploaded by

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

An Introduction to Computer Science

(CSC 101)
CSC 101 Objective
• This course is to prepare the students on the Fundamentals of
Computer science and Computing.
• It teaches the basics concepts, Data representation, Computer
Organization & Architecture, Problem Solving with Algorithm,
Computer Networks and the Internet and programming in
Visual Basics.
• The course will feature activities like teaching, demonstration,
laboratory activities, chatting, assignment and group discussion.
• Course evaluation will be based on class attendance, online
activities, quizzes, lab work and examination.
• Go to moodle learning system to see the course outline
lms.ui.edu.ng
How to get maximum benefits from the Lecture
• Attend class regularly
• Read the related chapters in the textbook
• Visit Moodle regularly
• Visit lecturer whenever you have questions
• Use your IT gadget to foster understanding of
the course by checking up new concepts online.
Go to U-tube and download lecture videos on
topics you don’t understand
• Attend Discussion Groups after studying
• Think more!
Lesson Objectives
• To Introduce Computer science through an
understanding of what computer scientists do
• To examine COMPUTER SCIENCE AS A DISCIPLINE
• To present an understanding of the nature of
computational tools and theories.
• To explain the Founding Traditions of Computer Sc
• QUALITIES OF A GOOD COMPUTER SCIENTIST
• To introduce six major criteria that computation tools
must be built to satisfy.
i.E correctness, efficiency, security, fault-tolerance,
user-friendliness and intelligence
Understanding Computer science
• Computer Scientists have been in increasing
demand since the advent of the modern
computer.
• The pervasiveness of the modern computer
has accentuated the need to train more
people in the discipline.
• These people must be able to meet the need
of the society in helping to achieve the
effective use of computers.
What Computer Scientists do
• In order to understand the discipline, it is
important to answer the question: what do
computer scientists do?
• They create and manage tools that support
and enhance the use of the modern
computer(computation tools for short).
• In order to create effective computation tools
it is important to create models of these tools
before they are built.
What Computer Scientists do
• Most of the models created are mathematical
in nature.
• Models need to be built around discrete
mathematical structures(e.g. sets, lists,
orderings etc.)
• Computer scientists use these existing
structures to create mathematical theories
• A theory is a body of knowledge that
facilitates the creation of models.
• Tools are built based on these theories
Definitions of Computer Science
• The systematic study of algorithmic processes
that describe and transform information:
their theory, analysis, design, efficiency,
implementation and application. (automation)
• Computer Science is about building computers
and writing computer programs, how we use
computational tools, and what we find out
when we do
• Computer Science is also about problem
solving. Solving problem computationally
involves the followings:
Steps in Computational Problem Solving
• ABSTRACTION
• AUTOMATION
• IMPLEMENTATION

• ABSTRACTION: Building clean abstract models (abstractions)


of real-world. Computer Science is a means of solving real-
world problems, and it all starts with abstractions.
• A representation of the actual problem
• A mental model that removes complex details at the
moment of abstraction
• This is a key concept on CSC. Abstraction will
reappear throughout the course – be sure you
understand it!
E.G of Abstraction
• Abstraction of the car
functionalities
– You don’t bother
about the internal
details that make a
car work while
driving
• Internal details of the
engine and how it works
are hidden when driving,
it is an abstract view of
a car
Abstraction
• Abstract view
Steps in Computational Problem Solving
Cont.
• AUTOMATION: builds model with the aim of using the model to solve
problems. Computer Scientists automate their models through the use of
algorithm, which performs actions on and with real world data.

• IMPLEMENTATION: Models and algorithms are implemented in the form


of code (instructions) that the computer can understand. Implementation
proves that our proposed solution actually works.
– Computers are used to implement these codes because Computers
are electronic devices that are amazingly fast at executing algorithms
on data. Ordinarily we could use pencil and paper to work through our
algorithm but this will take a very long time and will easily attract
error.
– E.g of implementation languages: VB, java, etc
COMPUTER SCIENCE AS A DISCIPLINE
• In 1953, University of Cambridge established the Cambridge
Diploma in computer science. It is the first computer science
degree program in the world.
• The first department of computer science in the U.S. was
established at Purdue University in 1962.
• Computer Science department was established in the year
1974 in the University of Ibadan.

• Computer Science as a discipline is divided into two areas:


– System
– Application
Areas of Computer Science
• Systems Area
– Algorithms and Data Structures
– Programming Languages and Compilers
– Computer Architecture
– Operating Systems
– Software Engineering
– Human-Computer Interaction
– Computer Networks
• Application Area
– Numerical Computation
– Databases
– Artificial Intelligence and Robotics
– Graphics
– Bioinformatics
– World Wide Web
– Games
Computer Science - discipline
What is Computer Science?
Studying algorithmic mechanisms of
computational processes independently of
the application domain, i.e. how to solve
problems of a society by means of
computers.
“It has often been said that a person does not really understand something until he
teaches it to someone else. Actually a person does not really understand something
until he can teach it to a computer, i.e. express it as an algorithm.” Donald Knuth
Disciplines within Computer Science
Algorithms and data structure
Programming languages
Computer Architecture
Numerical and symbolic computation
Operating systems
Software methodology and engineering
Databases and information management
Artificial intelligence/Intelligent Systems/Robotics
Human-computer communication
Net-Centric Computing and Internet Computing
Computational Science
Computing - relationship to other domains

Medicine Science

Entertainment Business

Computer Science

Engineering
Humanities

Art
What Computer Scientists do...

Design and implement algorithms in forms


of software
Design/implement algorithms using
programming languages as a way of
communications with hardware
Design, implement, test and maintain a
marketable product called software, i.e.
software manufacturing
2. Computer Scientists include...
 Software Engineers
Model, analyze, design and maintain software
 Systems Programmers
Develop and maintain system software: assemblers, macro
assemblers, compilers, and operating systems
 Systems Administrators
Administer computer systems and local area networks
 Computer Network Specialists
Design and implement computer networks, Internet and Intranet
software systems
Computer Scientists include...
 Information System Programmers
Analyze, design and maintain information systems for business,
management, and process control
 Object Technology Specialists
Model, analyze, design and maintain software built in the object
technology (Java and C++)
 Database System Specialists
Model, analyze, design and maintain decision-support and expert systems
based on database machines
Computer: What is a Computer?
What is Computer?
• Computer
– A kind of digital system
• All the information is represented, stored, and processed in binary digits.
– A programmable device
• Processor inside – microprocessors, digital signal processor (DSP),
microcontroller, etc.
• Processors can be programmed using their machine instructions.
• Hardware
– The physical elements of a computing system
• Printer, mother boards, wires, keyboard, CPU, DRAM, HDD, CD-ROM, network
cards, ..
• Software
– The programs that provide the instructions for a computer to execute
• Operating systems: Windows, Linux, MacOS
• Translators: C compilers, Java interpreters, FORTRAN compilers
• Applications; Internet Explorer, Microsoft Office, flight simulators, games, etc.
Layers of a Computer System
Layers of a Computer System
• Information Layer
– How to represent numbers, texts, images, audios, and videos
– All the information is represented using binary digits, i.e. bits (0s and 1s)
• Hardware Layer
– Physical components; CPU, memory, HDD, motherboards, gates and circuits
• Programming Layer
– Machine language, assembly language, high-level language, software
• Operating System Layer
– Interact with users, schedule programs, and manage hardware resources
• Application Layer
– Solve real-world problems
– Run application programs to use computer’s abilities to perform various tasks
• Communication Layer
– Computers are connected into networks so that they can share information
and resources
Layers of Software

Application
Programmers
and System
Programmers
Foundational Basis of CSC
As a discipline computer science brings together ideas from
different traditions i.e The Founding Traditions of Computer Sc
• Mathematics: gives the discipline much of its theory.
– Theory has to do with building of conceptual frameworks and notations
for understanding relationships among objects in a domain. A theory
clearly defines a kind of structure. The theory clearly defines its
properties. The properties must be clearly and precisely defined. The
usual vehicle for the precise description of properties is Logic or
algebra.
– The structures that a theory defines allows a computer scientist to
capture the essence of a tool to be developed.
– This essence is the model of the system to be built.
– Using the theory it is possible to reason about the behaviour of the
system to be built through the model.
– This kind of reasoning can help avoid disastrous consequences.
Foundational Basis of CSC

– Engineering Tradition : Gives it much of its creativity and design.


Computer scientist create computer programs and harware

– Experimental Science Tradition: gives it much of its science.


What is science?
Science is s a systematic enterprise that builds and
organizes knowledge in the form of testable explanations
and predictions about the universe.
It follows a set of methodology and principles that can be proven
Computer
Science Vs Technology Scientist
Write programs
to make the
artificial
organs work.
These are called
dedicated
systems
 ICT – Information and
Communication Technology
feeds on Computer Science
which provides the theory,
models and tools it needs
Facet of Technology

Knowledge from
Experimental Science

Tools Processes

SERVICE TO
HUMANITY
Information Processing
• Computation is thought of as the process of
transforming(processing) information.
• Information is “acquired facts”.. “about a
specific subject”. (Encarta)
• “I have five cows”. “Maigida has given me two
more”, “I sold one to Mr. Bako today”.
• It takes a little bit of information processing to
know how many cows I have left.
Tools
• A computational tool is a product of a creative
activity.
• It might be a piece of software or hardware.
• There are two categories of tools.
– Those tools support the creation of other tools
• E.g Programming languages
– end-user tool supports a specific task in the
human domain (and not the creation of other
tools).
• Word processing application
What can be automated?
• Automation refers to our ability to make a
computer solve a problem.
• Usually, automation consist of
• Generating software that will solve the problem
on a general purpose computer. OR
• Generating hardware that will do so.
• That software/hardware is a computational
tool.
What can be automated? How?
• Computer Scientists build and study tools based
on one or any combination of the followings set
of performance goals.
• Correctness
• Efficiency
• Security
• User-friendliness
• Fault-tolerance
• Intelligence
Each of the above represent possible objectives
that a tool may be engineered to meet.
Correctness
• A tool is said to be correct if it works according to
a pre-defined specification.
• The pre-defined specification must be clearly and
unambiguously stated – for correctness to be
assessed.
• The specification answers the question of what
tool are we expected to build.
• A correct tool conforms completely with the
specification ……..A little story will drive home the
point:
Efficiency
• The efficiency of a tool is a measure of its
ability to make judicious use of resources.
• The most important resource for tools is time.
• Another important group of resources is
machine resources (especially space).
• A tool is more efficient w. r. t. time if it uses
less time to a solve problem than another.
• A tool is more efficient w. r. t. space if it uses
less space to a solve problem than another.
Security
• A tool is secure if its functions will not be
hampered by malicious attacks or other
compromising situation.
• There are different ways in which a tool can be
compromised.
• One way is if information is intercepted during
transmission.(This happened a lot during
WW2).
Security(2)
• Another possible source of security
compromise is unauthorized use of a tool.
• Data Interception can be prevented by data
encryption.
• Data encryption is the process of transforming
data into an unintelligible form(encrypted
data) prior to transmission.
• The transformation is undone at the point of
reception (decryption).
User-Friendliness
• User-friendliness reflects the ease with which
a tool can be used by a human user.
• Factors ranging from culture, ergonomics to
personal preferences may affect user-
friendliness.
• As such user-friendliness may be context-
dependent.
Fault-tolerance
• Fault-tolerance is the ability of a tool to cope
in the presence of faults.
• A tool is fault-tolerant if every possible fault
does not lead to a failure.
• The level of fault-tolerance is measured by
mean time between failure (MTBF).
• This is a measure of the time between two
failure incidents in the use of a tool.
Intelligence
• Intelligence is the ability of a tool to mimic
human intelligence.
• Tools can mimic intelligence in a number of
ways:
– Reasoning
– Language understanding
– Learning
– Game playing
Example- Game Playing
• In 1997, IBM’s chess playing computer ‘Deep
Blue’ defeated the then world champion Garry
Kasparov under tournament conditions.
• That was a landmark in the history of game
playing machines.
• The success of game playing machines has
been attributed to their ability to ‘see’ many
moves ahead in a game.
QUALITIES OF A GOOD COMPUTER SCIENTIST
Qualities of a good computer scientist include:
• Passion for finding elegant solutions
• Ability to use mathematical analysis and logical rigor to evaluate such
solutions
• Creativity in modeling complex problems through the use of abstractions
• Attention to details and hidden assumptions
• Ability to recognize variants of the same problem in different settings
• Ability to retarget known efficient solutions to problems in new settings
i.e. reusability.
• If you like to solve puzzles, then computer science is for you!
CAREERS IN COMPUTER SCIENCE
• Many students graduate to rewarding computer-related careers in:
– Software engineering,
– System administration and management
– Research and development in industrial and governmental
laboratories etc

RELATIONSHIP BETWEEN COMPUTER SCIENCE AND OTHER DISCIPLINES

• RELATIONSHIP BETWEEN COMPUTER SCIENCE AND COMPUTER


ENGINEERING
• Computer engineering concerns itself with current practices in assembling
hardware and software components to erect computing engines with the
best cost-performance characteristics. In contrast, computer scientists
worry about the feasibility and efficiency of solutions to problems in a
manner that is less dependent on current technologies.

• RELATIONSHIP BETWEEN COMPUTER SCIENCE AND SCIENTIFIC


COMPUTING
• Computers and software artifacts have become indispensable tools in
every scientific discipline. The scientists who use Computer and software
artifacts are called Computational Scientists. The use of computers has
enabled:
• Biologists to comprehend genetics - Computational Biology
• Astrophysicists to use laser technology
• Geologists to predict earthquakes.
RELATIONSHIP BETWEEN COMPUTER SCIENCE AND OTHER DISCIPLINES
CONT

• Scientists in these disciplines increasingly rely on a computational


methodology in addition to traditional mathematical or empirical
methodologies to make advances in their respective fields of study.

• Careers in other fields: Since computer technology has transformed
almost all disciplines Computer Science graduates can use their computer
science skills in other disciplines such as:
– Medicine,
– Law, education
– Physical and life sciences
– Social sciences and humanities.
DIGITAL DIVIDE
• Digital divide represents the disparity between those who
have and those who do not have access to computer
technology.

• In developing countries like Nigeria there is a great challenge


on digital divide. In Nigeria the unequal digital divide is found
everywhere, for example, rural communities, in primary and
secondary schools, higher institutions of learning, etc. This
can be seen from the perspective of the number of people
that has access to it, and the technological skill of those that
have access to computer technology.

STUDY QUESTIONS
• Discuss the relevance of computers to your
course in University of Ibadan
• What is the core of Computer Science?
• Distinguish between systems areas and
applications areas of Computer Science
discipline.
• Is computing a mathematical discipline, a
scientific discipline, or an engineering
discipline? Explain.
• Briefly discuss the steps involved in solving
problems computationally.
History of Computing
INTRODUCTION
 It took thousands of years for the computer to
develop in to the present state.
 Earlier the process of computing was done by
counting with their own figures, stones & through
scratches on the sand or walls. But this idea is
only for the counting of small entities.
 Later, various types of computing devices such as
ABACUS, Napier's bone slide rule, diffence engine,
lady Augusta Ada Lovelace, etc. On the processing
of previous calculating machines & continuous
development on them, makes modern computer
come to this stage
PRIMATIVE CALCULATORS
THE ABBACUS
EARLY COMPUTATIONAL DEVICES

 (Chinese) Abacus
 Used for performing arithmetic operations
AL’KHOWARIZMI AND THE
ALGORITHM
 12th Century Tashkent Cleric
 Developed the concept of a
written process for doing
something
 Published a book on the
process of algorithms
 The basis of software
EARLY COMPUTATIONAL DEVICES

 Napier’s Bones, 1617


 For performing multiplication & division

John Napier
1550-1617
PHILOSOPHER FOREFATHERS OF
MODERN COMPUTING
1600-1700  Von Leibniz developed
Blaise Pascal – binary arithmetic and a
developed the hand cranked
Pascaline. calculator.
 Calculator was able to
Desk top calculator
add, subtract, multiply
worked lik an
and divide.
odometer.
BLAISE PASCAL

 Pascal (1623-62) was the son of a tax collector


and a mathematical genius. He designed the
first mechanical calculator (Pascaline) based
on gears. It performed addition and
subtraction.
EARLY COMPUTATIONAL DEVICES

 Pascaline mechanical calculator

Blaise Pascal
1623-1662
EARLY COMPUTATIONAL DEVICES

 Slide Calculators

William Oughtred
1574-1660
GOTTFRIED WILHELM VON LEIBNIZ

 Leibnitz (1646-1716) was a German


mathematician and built the first calculator to
do multiplication and division. It was not
reliable due to accuracy of contemporary parts.
 He also documented the binary number system
which is used in all modern computers.
COUNT TO 8 IN BINARY

 0001
 0010

 0011

 0100

 0101

 0110

 0111

 1000
MODERN COMPUTERS USE BINARY

 Why?
 Much simpler circuits needed for performing
arithmetic
EARLY COMPUTATIONAL DEVICES

 Leibniz’s calculating machine, 1674

Gottfried Wilhelm von Leibniz


1646-1716
GEORGE BOOLE (1815-1864)

 Invented Boolean Algebra


 System of logic using boolean values
 Used to establish inequalities:
 symbolic use of <, or >, or <>
 Used in computer switching
 Modern use in library searches
CHARLES BABBAGE
 Babbage (1792-1872) was a British inventor
who designed an two important machines:
 Difference engine
 Analytical engine

 He saw a need to replace the human


computers used to calculate numerical tables
which were prone to error with a more accurate
machine.
CHARLES BABBAGE

 Difference engine
 Designed to compute values of polynomial
functions automatically
 No multiplication was needed because he used the
method of finite differences
 He never built one

 It was built from 1989 – 1991 for the London


Science Museum
CHARLES BABBAGE DIFFERENCE ENGINE
CHARLES BABBAGE
THE NEXT LEAP FORWARD
1800’S
CHARLES BABBAGE

 Analytical Engine
 Could be programmed using punch cards – totally
revolutionary idea
 Sequential control / branching / looping

 Turing complete
The analytical engine
of Charles Babbage
LADY ADA BYRON – WORLD’S FIRST
PROGRAMMER
 Countess of Lovelace,
daughter of Lord Byron.
 One of the first women
mathematicians in England
 Documented Babbage’s
work.
 Wrote an account of the
difference engine.
 Wrote a program for the
difference engine for
computing Bernoulli numbers
HERMAN HOLLERITH
 Hollerith developed an electromechanical punched-card
tabulator to tabulate the data for 1890 U.S. census. Data
was entered on punched cards and could be sorted
according to the census requirements. The machine was
powered by electricity. He formed the Tabulating Machine
Company which became International Business Machines
(IBM). IBM is currently the largest computer manufacturer,
employing in excess of 300,000 people.
HERMAN HOLLERITH PUNCH CARD
TABULATING MACHINE
1890 CENSUS
HOLLERITH TABLES AND THE CENSUS

Improved the
speed of the
census
Reduced cost by
$5 million
Greater accuracy
of data collected
Hollerith –
unemployed after
the census
KONRAD ZUSE - FIRST CALCULATOR 1938
THE WAR YEARS 1939-1945
TWO PRIMARY USES
 Artillery Tables
 Hand calculation replaced by machine calculation
 Department of the Navy
 Cryptologist :
 Cryptography
The art or process of writing in or deciphering secret writing
Bletchley House
The Enigma Codes – U23
THE BRITISH EFFORT
HISTORY OF COMPUTERS
 Alan Turing was a British mathematician who also made significant
contributions to the early development of computing, especially to the
theory of computation.
 He developed an abstract theoretical model of a computer called a
Turing machine which is used to capture the notion of computable i.e.
what problems can and what problems cannot be computed.
 Not all problems can be solved on a computer.
 Note: A Turing machine is an abstract model and not a physical
computer
ALAN TURING
MISUNDERSTOOD GENIUS
1936
 Published a paper “On
Computable Numbers”
 Turing’s machine -
hypothetical computer
that could perform any
computation or logical
operation a human
could devise.
TURINGS HERITAGE

 Code breaking was


Touring’s strength.
 Colossus a computer to
break the German
enigma code - 100
Billion alternatives.
 Ran at rate of 25,000
characters per second
THE UNITED STATES EFFORT
THE II WORLD WAR YEARS 1939 -
1945
 Calculate artillery tables.
 Used to break codes like
the Colossus.
 Used to model future
events - Atomic and
Hydrogen Bombs.
 Cmdr. Grace Hooper
HOWARD AIKEN (1900 – 73)

 Aiken, a Harvard professor, with the backing of IBM


built the Harvard Mark I computer (51ft long) in 1944. It
was based on relays (operate in milliseconds) as
opposed to the use of gears. It required 3 seconds for a
multiplication.
 Aiken’s Mark 1. (1944) based on Babbage’s original
design - built at IBM labs, electro-mechanical, weighed
5 tons. Admiral Grace Hopper worked as programmer
on this computer, and coined the term 'bug' for a
computer fault.
HARVARD MARK - 1, 1944
THE MARK I - A DINOSAUR

 51 feet long
 3,304 electro mechanical
switches
 Add or subtract 23 digit
numbers in 3/10 of a
second.
 Instructions (software)
loaded by paper tape.
 The infamous “Bug”
ENIAC - THE NEXT JUMP FORWARD -
1946
 1st electronic digital computer
 Operated with vacuum tubes
rather electro-mechanical
switches
 1000 times faster than Mark I
 No program storage - wired
into circuitry.
 This was still based on the
decimal numbering system.
 “programmed” by switches
and cords
ENIAC
THE ADVENT OF THE
SEMICONDUCTOR - 1947
 Developed at Bell Labs
by Shockley & Bardeen –
Nobel Prize
 Point Contact Transistor
replaced power hungry,
hot and short lived
vacuum tubes
HISTORY OF COMPUTERS
 Von Neumann was a scientific genius and was a consultant on the
ENIAC project. He formulated plans with Mauchly and Eckert for a new
computer (EDVAC) which was to store programs as well as data.
 This is called the stored program concept and Von Neumann is credited
with it. Almost all modern computers are based on this idea and are
referred to as Von Neumann machines.
 He also concluded that the binary system was more suitable for
computers since switches have only two values. He went on to design
his own computer at Princeton which was a general purpose machine.
COMPUTER GENERATIONS
 st1 generation computers
 Vacuum tube, 1946-1957, 40K operations/sec
 2nd generation computers
 Transistor, 1958-1964, 200 K operations/sec
 Smaller, cheaper, less heat dissipation
 William Shockley et al. in 1947 at Bell Labs

 3rd generation computers


 SSI, MSI, 1965-1971, 1 M operations/sec
 4th generation computers
 LSI, 1972-1977, 10 M operations/sec
 5th generation computers
 VLSI, 1978 to date, 100 M operations/sec
FIRST GENERATION COMPUTERS (1951-58)

 These machines were used in business for accounting and


payroll applications. Valves were unreliable components
generating a lot of heat (still a problem in computers).
They had very limited memory capacity. Magnetic drums
were developed to store information and tapes were also
developed for secondary storage.
 They were initially programmed in machine language
(binary). A major breakthrough was the development of
assemblers and assembly language.
EDVAC - ELECTRONIC DISCREET VARIABLE
AUTOMATIC COMPUTER 1951
 Data stored internally on
a magnetic drum
 Random access
magnetic storage device
 First stored program
computer
THE 50’S THE ERA OF ADVANCES
SECOND GENERATION
(1959-64)
 The development of the transistor revolutionised the development of
computers. Invented at Bell Labs in 1948, transistors were much
smaller, more rugged, cheaper to make and far more reliable than
valves.
 Core memory (non-volatile) was introduced and disk storage was also
used. The hardware became smaller and more reliable, a trend that still
continues.
 Another major feature of the second generation was the use of high-level
programming languages such as Fortran and Cobol. These
revolutionised the development of software for computers. The
computer industry experienced explosive growth.
TECHNICAL ADVANCES IN THE 60’S
 John Mccarthy coins the term “Artificial Intelligence”
 1960 - Removable Disks appear
 1964 - BASIC - Beginners-all purpose Symbolic Instruction
Language
 Texas Instruments offers the first solid- state hand-held
calculator
 1967 - 1st issue of Computerworld published
THIRD GENERATION
(1965-71)
 IC’s (Integrated Circuits) were again smaller, cheaper, faster and more
reliable than transistors. Speeds went from the microsecond to the
nanosecond (billionth) to the picosecond (trillionth) range. ICs were used
for main memory despite the disadvantage of being volatile.
Minicomputers were developed at this time.
 Terminals replaced punched cards for data entry and disk packs
became popular for secondary storage.
 IBM introduced the idea of a compatible family of computers, 360
family, easing the problem of upgrading to a more powerful machine
THIRD GENERATION
(1965-71)
 Substantial operating systems were developed to manage and share the
computing resources and time sharing operating systems were
developed. These greatly improved the efficiency of computers.
 Computers had by now pervaded most areas of business and
administration.
 The number of transistors that be fabricated on a chip is referred to as
the scale of integration (SI). Early chips had SSI (small SI) of tens to a
few hundreds. Later chips were MSI (Medium SI): hundreds to a few
thousands,. Then came LSI chips (Large SI) in the thousands range.
MOORE’S LAW
 In 1965 Gordon Moore graphed data about growth in memory
chip performance.

 Realized each new chip roughly twice capacity of predecessor,


and released within ~2 yrs of it => computing power would rise
exponentially over relatively brief periods of time.

 Still fairly accurate. In 30 years, no of transistors on a chip has


increased ~20,000 times, from 2,300 on the 4004 in 1971 to
42 million on the Pentium® IV.
THE 1970’S - THE MICROPROCESSOR
REVOLUTION
 A single chip containing
all the elements of a
computer’s central
processing unit.
 Small, integrated,
relatively cheap to
manufacture.
THE SUPER COMPUTERS - 1972

 The Cray
 Parallel processing power
 Speed 100 million
arithmetical functions per
second
 Sensitive to heat - cooled with
liquid nitrogen
 Very expensive
FOURTH GENERATION
 VLSI allowed the equivalent of tens of thousand of
transistors to be incorporated on a single chip. This led to
the development of the microprocessor a processor on a
chip.
 Intel produced the 4004 which was followed by the
8008,8080, 8088 and 8086 etc. Other companies
developing microprocessors included Motorolla (6800,
68000), Texas Instruments and Zilog.
FOURTH GENERATION
 Personal computers were developed and IBM launched
the IBM PC based on the 8088 and 8086
microprocessors.
 Mainframe computers have grown in power.
 Memory chips are in the megabit range.
 VLSI chips had enough transistors to build 20 ENIACs.
 Secondary storage has also evolved at fantastic rates with
storage devices holding gigabytes (1000Mb = 1 Gb) of
data.
FOURTH GENERATION
 On the software side, more powerful operating systems
are available such as Unix.
 Applications software has become cheaper and easier to
use.
 Software development techniques have vastly improved.
 Fourth generation languages 4GLs make the development
process much easier and faster.
FOURTH GENERATION
 Languages are also classified according to generations
from machine language (1GL), assembly language (2GL),
high level languages (3GL) to 4GLs.
 Software is often developed as application packages.
VisiCalc a spreadsheet program, was the pioneering
application package and the original killer application.
 Killer application: A piece of software that is so useful that
people will buy a computer to use that application.
THE ALTAIR FROM A VOYAGE TO ALTAIR -
STAR TREK -1975
THE BIRTH OF THE MICRO
COMPUTER 1975
 Jobs and Wozniac develop
the Apple II
 Commodore PET, programs
stored on a cassette
 Tandy-Radio Shack TRS-80
 5 1/2 inch floppy disk
becomes the standard for
software
FINALLY, THE COMPUTER AS MAN OF THE
YEAR - 1982
REVENGE OF THE NERDS

Bill Gates

Microsoft, 1978

Steve Jobs Steve Wozniak


Alan Turing
Categories of Computers
Categories of Computers and
Computer Systems
 Computers are classified into two:
– A special-purpose computer
– A general-purpose computer
 Special-Purpose Computers
– Is a computer designed for a particular function,
executing the same stored set of instructions whenever
requested.
– For example
• microwave ovens
• washing machine
• medical diagnostic equipment
Categories of Computers and
Computer Systems
 General-Purpose Computers
– Is a computer that can be used for solving many
different types of problems.
– Available in many sizes and a wide range of
capabilities.
– Can be classified as follows:
• 1. Microcomputers
a. Laptop computers
b. Desktop computers
c. Workstations
• 2. Minicomputers
• 3. Mainframe computers
• 4. Supercomputers
Microcomputers

 Sometimes referred to as a personal computer (PC), is


one that can be placed on a desktop or carried from room
to room.
 The smallest microcomputers are known as laptop
computers or notebook computers.
 Desktop computers are compact microcomputer systems
that fit on a desk and are designed for use by individuals.
 A workstation is the largest type of microcomputer and
is generally used in scientific and engineering
applications.
Minicomputers
 More powerful and more expensive than
microcomputers.
 Are smaller and cheaper compared to
mainframes.
 Also can be server, which is used for managing
internal company networks or Web sites.
 Server computers are specifically optimized to
support a computer network enabling users to
share files, software, peripheral devices (such as
printers), or other network resources.
Mainframe Computer

 The largest computer, a powerhouse with


massive memory and e extremely rapid
processing power.
 It is used for very large business, scientific or
military application where a computer must
handle massive amounts of data or many
complicated processes.
Supercomputer

 Is highly sophisticated and powerful computer


that is used for tasks requiring extremely rapid
and complex calculations with hundreds of
thousands of variable factors.
 Used in many areas of scientific research,
weather prediction, aircraft design, nuclear
weapon and so on.
HARDWARE AND
SOFTWARE
Recall
 Computers are automatic, electronic machines that
– accept data & instructions from a user (INPUT)
– store the data & instructions (STORAGE)
– manipulate the data according to the instructions
(PROCESSING)
– store &/or output the results to the user (OUTPUT)
Rationale
 A computer system is generally composed of
hardware and software.
 Hardware make up the physical components.
Software make up the set of instructions for the
computer. Without software, the computer will not
be able to perform the tasks that you would like it
to do.
Hardware
Basic Concepts of Computer Hardware
 although specific components may vary, virtually all
modern computers have the same underlying structure
– known as the von Neumann architecture
– named after computer pioneer, John von Neumann, who
popularized the design in the early 1950's
 the von Neumann architecture identifies 3 essential
components
1. Input/Output Devices (I/O) allow the user to interact with the
computer
2. Memory stores information to be processed as well as programs
(instructions specifying the steps necessary to complete specific
tasks)
3. Central Processing Unit (CPU) carries out the instructions to
process information
Von Neumann architecture
Von Neumann architecture
 This describes a design architecture for an electronic
digital computer with parts consisting of a processing unit
containing an arithmetic logic unit and processor registers,
a control unit containing an instruction register and
program counter, a memory to store both data and
instructions, external mass storage, and input and output
mechanisms. The meaning has evolved to be any stored-
program computer in which an instruction fetch and a data
operation cannot occur at the same time because they share
a common bus.
The Computer System
 Computer system consists of
– central processing unit (CPU)
– primary storage
– secondary storage
– input devices
– output devices
 Communications devices.
The System Unit
 What are common components inside the system unit?

 Processor
power supply drive bays
 Memory
 Adapter cards
 Sound card processor

 Video card
 Ports ports memory

 Drive bays
 Power supply

sound card
video card
The System Unit
 What is the motherboard?

 Main circuit
board in system
unit
 Contains adapter
cards, processor
chips, and
memory chips
 Also called
system board
 The CPU
– manipulates raw data into more useful form and controls
the other parts of the computer system.
 Primary storage
– temporarily stores data and program instructions during
processing.
 Secondary storage
– devices store data and programs when they are not being
used in processing.
 Input devices
– convert data and instructions into electronic form for input
into the computer.
 Output devices
– convert electronic data produced by the computer system
and display them in a form that people can understand.
 Communication devices
– provide connections between the computer and
communications networks.
 Buses
– are circuitry paths for transmitting data and signals
among the parts of the computer system.
The CPU and Primary Storage
 The CPU is the part of the computer system where
the manipulation of symbols, numbers, and letters
occurs, and it controls the other parts of the
computer system.

The CPU
Processor
 What is the central processing unit (CPU)?

 Interpretsand carries Processor


Control
Control Arithmetic
Arithmetic
out basic instructions Unit
Unit Logic
Logic Unit
Unit (ALU)
(ALU)
that operate a computer
Instructions
 Control unit directs and Data
coordinates operations in Information

computer
 Arithmetic logic unit
Input Output
Devices
Data Memory Information
Devices
(ALU) performs
arithmetic, comparison,
Instructions
and logical operations Data
Information
 Also called the processor
Storage
Devices
Processor
 What is a machine cycle?
 Four operations of the CPU comprise a machine cycle

Step 1. Fetch
Obtain program instruction
or data item from memory

Memory
Step 2.
Step 4. Store Decode
Write result to memory Translate
instruction into
Processor commands
ALU Control Unit
Step 3. Execute
Carry out command
The CPU and Primary Storage
Central Processing Unit (CPU) Primary Storage

Arithmetic Logic Unit I


(ALU)
22 + 11 = 33 8
Control Unit # U

Data Bus
Address
Bus
Control
Bus
 Three kinds of busses linked between the CPU,
primary storage and the other devices in the
computer system:
– Data bus
• Pass information in bi-directional.
– Address bus
• Transmits signals for locating a given address in primary
storage, indicating where data should be placed.
– Control bus
• Transmits signal specifying whether to read or write data to or
from primary storage address, input device or output device.
 The characteristics of the CPU and primary
storage are very important in determining a
computer’s speed and capabilities
The Arithmetic-Logic Unit and
Control Unit
 An arithmetic logic unit (ALU) and control unit
is one of the core components of all central
processing units.
 The ALU performs the computer’s principal
logical and arithmetic operations.
 It adds, subtracts, multiples, and divides,
determining whether a number is positive,
negative, or zero.
 ALU must be able to determine when one quantity
is greater than or less than another and when two
quantities are equal.
 The control unit coordinates and controls the other
parts of the computer system.
 It reads a stored program, one instruction at a time
and directs other components of the computer
system to perform the program’s required tasks.
Processor
Which processor should you select?
 The faster the processor, the more expensive the computer
Intel Processor Desired Clock Speed

Itanium or Xeon 1.3 GHz and up

3.0 GHz and up


Pentium family
2.4 GHz to 3.0 GHz

Up to 2.4 GHz

Celeron 2.2 GHz and up


Primary Storage
 Primary storage is a category of computer storage, often
called main memory.
 Has three functions:
– Stores all or part of the program that is being executed.
– Stores the operating system programs that manage the operation of
the computer.
– Holds data that the program is using.
 Data and program are placed in primary storage before
processing, between processing steps and after processing
has ended prior to being returned to secondary storage or
released as output.
Memory
 How is memory measured?
 By number of bytes available for storage

Term Abbreviation Approximate Size

Kilobyte KB or K 1 thousand bytes


Megabyte MB 1 million bytes
Gigabyte GB 1 billion bytes
Terabyte TB 1 trillion bytes
 Modern primary storage devices include:
– Random access memory (RAM)
• is used for short-term storage of data or program instructions.
RAM is volatile. Its contents will be lost when the computer’s
electric supply is disrupted by a power outage or when the
computer turned off.
– Read-only memory (ROM)
• can only be read from. It cannot be written to. ROM chips
come from the manufacturer with programs already burned in,
or stored. ROM is used in general-purpose computers to store
important or frequently used programs, such as computing
routine for calculating the square roots of numbers.
Memory
 What is random access memory (RAM)?

Memory chips that can be


read from and written
to by processor
Most RAM is
Also called
volatile, it is lost
main memory
when computer’s
or primary
power is
storage
turned off

The more RAM a


computer has, the
faster it responds
Memory
How do program instructions transfer in and out of
RAM? RAM
Step 1. When you start the computer, certain
operating system files are loaded into RAM from
Operating system Operating system the hard disk. The operating system displays the
instructions interface user interface on the screen.

Step 2. When you start a Web browser, the


program’s instructions are loaded into RAM from
Web browser Web browser the hard disk. The Web browser window is
instructions window displayed on the screen.

Step 3. When you start a word processing


program, the program’s instructions are loaded
Word processing Word processing into RAM from the hard disk. The word
program instructions program window processing program, along with the Web Browser
and certain operating system instructions are in
RAM. The word processing program window is
displayed on the screen.
RAM

Step 4. When you quit a program, such as the


Web browser, its program instructions are
removed from RAM. The Web browser is no
longer displayed on the screen.

Web browser program Web browser


instructions are window is no longer
removed from RAM displayed on
desktop
Memory
 What are two basic types of RAM chips?

Do not have to
Most
be re-energized
common
as often as
type
DRAM
Static
RAM
Dynamic Faster and
Must be (SRAM)
RAM more reliable
re-energized (DRAM) than DRAM
constantly
chips

• Newer Type: Magnetoresistive RAM (MRAM)


Memory
 What
Memory chipsisthat
read-only
store memory (ROM)?
Nonvolatile memory, it is not
permanent data lost when computer’s
and instructions power is turned off
EEPROM
Three types: (electrically
erasable programmable
read-only memory)—
Firmware— Type of PROM
Manufactured with containing microcode
permanently written PROM
programmer
data, instructions, (programmable can erase
or information read-only
memory)—
Blank ROM
chip onto which
a programmer
can write permanently
Storage, Input, and Output
Technology
 Storage, input and output devices are called
peripheral devices because they are outside the
main computer system unit.
Secondary Storage Technology

 Secondary storage is used for relatively long


term storage of data outside the CPU.
 Secondary storage is nonvolatile and retains data
even when the computer is turned off.
 The most technologies are magnetic disk, optical
disk and magnetic tape.
Storage
 What is storage?
– Holds data, instructions, and information for future use
 Storage medium is physical material used for storage
 Also called secondary
storage
Storage
 How does volatility compare?
 Storage medium is nonvolatile—contents retained when
power is off
 Memory is volatile—holds data and instructions
temporarily ON OFF
Nonvolatile Volatile

Screen Display Display appears Display


disappears

Memory Data and Data and


(most RAM) instructions instructions erased
(chips on motherboard) available to user

Storage Medium Contents Contents


(floppy disks, Zip disks, available to user retained
hard disks, CDs)
Magnetic disk

 There are two kinds of magnetic disk:


– floppy disks
– hard disks
 Magnetic Disks permit direct access to individual
records so that data stored on the disk can be
directly accessed regardless of the order in which
the data were originally recorded.
 Disk storage is often referred to as a direct access
storage device (DASD).
shutter
Magnetic Disks
shell
liner
 What is a floppy disk?

– Portable, inexpensive storage magnetic


coating
medium (also called diskette)
Thin, circular, flexible film metal hub
enclosed flexible thin film
in 3.5” wide plastic shell

• What is a floppy disk


drive?
– Device that reads from and
writes to floppy disk
• One floppy drive, named drive A
– Also called secondary storage
Magnetic
 What Disks
is a hard disk?
hard disk installed
in system unit

– High-capacity storage
– Consists of several
inflexible, circular
platters that store items
electronically
– Components enclosed in
airtight, sealed case for
protection
Magnetic Disks
What are tracks and
sectors?

Track Sector
is narrow stores up to
recording 512 bytes
band of data
that forms
full
circle on
disk

Formatting prepares disk for use and marks bad


sectors as unusable
Magnetic Disks
 How does a hard disk work?

Step 3.
When software requests a
disk access, read/write
heads determine current
Step 2. or new location of data.
Small motor spins
platters while
computer is running.

Step 4.
Head actuator positions
read/write head arms over
Step 1. correct location on platters
Circuit board controls to read or write data.
movement of head actuator
and a small motor.
Optical Disk

 Also called compact disks or laser optical disks,


used laser technology to store data at densities
many times greater than those of magnetic disks.
 The most common optical disk system used with
PCs called CD-ROM (compact disk read only
memory).
 CD-ROM is read-only storage.
Optical Discs
 What are optical discs? Push the button to
slide out the tray.

 Flat, round, portable


metal discs made of
metal, plastic, and
lacquer Insert the disc,
 Can be read only or label side up.
read/write
 Most PCs include an
Push the same button
optical disc drive to close the tray.
Optical Discs
How does a laser read data on an optical disc?

disc label

lens lens Step 3.


pit land
Step 2. Reflected light is
If light strikes deflected to a
0 a pit, it scatters. 1 light-sensing diode,
If light strikes a which sends digital
land, it is signals of 1 to
Step 1. prism reflected back prism computer. Absence
toward diode. of reflected light is
Laser diode light- light- read as digital
shines a light sensing sensing signal of 0.
beam toward diode diode
disc. laser laser
diode diode
Optical Discs
 How is data stored on an optical disc?

 Typically stored in
single track
 Track divided
into evenly
sized sectors
that store
items
single track
spirals to edge
of disc

disc sectors
 WORM (write once/read memory) or CD-R
(compact disk-recordable) optical disk systems
allow users to record data only once on an optical
disk.
 New CD-RW (CD-Rewritable) technology has
been developed to allow users to create rewritable
optical disks.
 Digital-video disks (DVDs) also called digital
versatile disks are optical disks the same size as
CD-ROMs but of even higher capacity (minimum
of 4.7 gigabytes of data).
Optical Discs
 What is a CD-ROM?
 Compact disc read-only memory
 Cannot erase or modify contents
 Typically holds 650 MB to 1 GB
 Commonly used to distribute multimedia and complex software
Optical Discs
 What are CD-Rs and CD-RWs?
Must have
CD recorder
or CD-R drive
CD-R (compact disc-recordable)
— disc you can write on once
c

Cannot erase
disc’s contents
CD-RW (compact disc-rewritable)
— erasable disc you can write on
ce

multiple times Must have


CD-RW software
and CD-RW drive
Optical Discs
What is a DVD-ROM (digital
versatile disc-ROM or digital
video disc-ROM)?
 High capacity disc capable of
storing 4.7 GB to 17 GB
 Must have DVD-ROM drive or
DVD player to read DVD-ROM
 Stores databases, music,
complex software, and movies
Optical Discs
 How does a DVD-ROM store data?
 Two layers of pits are used, lower layer is
semitransparent so laser can read through
 Some are double-sided
 Blu-Ray discs currently have a storage capacity of
up to 27 GB
Magnetic Tape
 Magnetic tape is an older storage technology that
still used for secondary storage of large volumes
of information.
 The principle advantages
– its inexpensiveness, its relative stability and its ability
to store very large quantities of information.
 The disadvantages
– its sequentially stored data and its relative slowness
compared to the speed of secondary storage media.
Tape
 What is tape?
– Magnetically coated plastic ribbon
capable of storing large amounts
of data at low cost
– Primarily used for backup
PC Cards

 What is a PC Card?
 Adds capabilities to computer
 Credit-card-sized device commonly
used in notebook computers
Input and Output Devices
 Input devices
– Input devices gather data and convert them into electronic
form for use by the computer.
– Keyboard
• The principal method of data entry for entering text and numerical
data into a computer
– Pointing Devices
• A computer mouse is handheld device with point-and-click
capabilities that is usually connected to the computer by a cable.
• Touch screens allows users to enter limited amounts of data by
touching the surface of a sensitized video display monitor with
finger or a pointer.
 Source Data Automation
– Captures data in computer-readable form at the time
and place they are created.
– Optical Character Recognition (OCR) devices
translate specially designed mark, characters, and codes
into digital form.
– Magnetic ink character recognition (MICR)
technology is used primarily in check processing for the
banking industry, which the bottom of typical check
contains characters identifying the bank, checking
account, and check number that are preprinted using a
special magnetic ink.
– A MICR reader translates these characters into digital form
for the computer.
– Handwriting-recognition devices such as pen-based
tablets, notebooks, and notepad are promising new input
technologies.
– These pen-based input devices convert the motion made by
an electronic stylus pressing on a touch-sensitive tablet
screen into digital form.
– Digital scanners translate image such as pictures or
documents into digital form.
– Voice input devices convert spoken words into digital form
for processing by the computer.
– Sensors are devices collect data directly from the
environment for input into a computer system.
What Is Input?
 What is input?
 Data or instructions entered into memory of computer
 Input device is any hardware component that
allows users to enter data and instructions
What Is Input?
 What are the two types of input?

 Data
 Unprocessed text,
numbers, images,
audio, and video
 Instructions
 Programs
 Commands
 User responses
The Keyboard
 How is the keyboard
divided?
 Typing area
 Numeric keypad
 Function keys, special
keys that issue
commands
Pointing Devices
 What is a mouse?
 Pointing device that fits under palm of hand
 Pointing device controls mouse buttons
wheel
movement of pointer, also button
called mouse pointer

 Mechanical mouse
ball
has rubber or metal
ball on underside

mouse pad
Other Pointing Devices
 What is a trackball?
 Stationary pointing device
with a ball on its top or side
 To move pointer, rotate ball
with thumb, fingers, or palm
of hand
Other Pointing Devices
What are a touchpad and a
pointing stick?

 Touchpad is small, flat,


rectangular pointing device
sensitive to pressure and motion
 Pointing stick is pointing device
shaped like pencil eraser
positioned between keys on
keyboard
Other Pointing Devices
 What are a joystick and a wheel?

 Joystick is vertical
lever mounted
on a base
 Wheel is
steering-wheel-type
input device
 Pedal simulates
car brakes and
accelerator
Other Pointing Devices
 What is a light pen?
 Handheld input device
that can detect light
 Press light pen against
screen surface and then
press button on pen
Other Pointing Devices
 What is a touch screen?

 Often used with kiosks


 Touch areas of screen with
finger
Keyboard and Pointing Devices
 What is a stylus and a digital pen?
 Looks like a ballpoint pen, but uses pressure to write
text and draw lines
 Used with graphics tablets, flat electronic boards
Voice Input
 How does voice recognition work?
Step 1. A user dictates text into a microphone. Step 2. An analog-to-digital converter (ADC) translates
sound waves into digital measurements computer can
process. Measurements include pitch, volume, silences, and
phonemes. Phonemes are sound units such as aw and guh.

10010111010110101100001101

Step 4. To narrow a list down, software presents user with


Step 3. Software compares
a list of choices or uses a natural language component to
spoken measurements with those
predict most likely match. User may correct any selection
in its database to find a match or
made by software.
list of possible matches.
Natural Language Engine
Matches
Voice Input
What is a MIDI (musical instrument
digital interface)?
 External device, such as electronic piano
keyboard, to input music and sound
effects
Digital Cameras
 How does a digital camera work?
Step 3. CCD generates an analog
Step 1. Point to the image to Step 2. Image is focused on a signal that represents the image.
photograph and take picture. chip called a charge-coupled
Light passes into the lens of the device (CCD).
camera. Step 4. Analog signal is converted
to digital signal by analog-to-
digital converter (ADC).

Step 5. Digital signal processor


(DSP) adjusts quality of image and
usually stores digital image on
miniature mobile storage media in
the camera.

Step 6. Images are transferred to a


Step 7. Using software
computer’s hard disk by plugging one
supplied with the
end of the cable into a camera and the
camera, images are
other end into a computer; or images
viewed on screen,
are copied to hard disk from storage
incorporated into
media used in the camera.
documents, edited, and
printed.
Digital Cameras
 What is resolution?
 Sharpness and clarity of image
 The higher the resolution, the better the image
quality, but the more expensive the camera
 Pixel (picture element)
is single point in
electronic image
 Greater the number of
pixels, the better the
image quality
Video Input
 What is video input?
 Process of entering full-motion images
into computer
 Video capture card is
adapter card that converts
analog video signal into
digital signal that
computer can use
 Digital video (DV)
camera records video as
digital signals
Video Input
 What are a PC video camera and a Web cam?

 PC video camera — DV camera used to capture video


c c

and still images, and to make


video telephone calls on Internet
 Also called PC camera
 Web cam — video camera
c c

whose output displays on


a Web page
Scanners and Reading Devices
Flatbed

 What is a scanner?

 Light-sensing device that


Pen or
reads printed text and Handheld

graphics
 Used for image processing,
converting paper documents Sheet-fed

into electronic images

Drum
Scanners and Reading Devices
How does a flatbed
scanner work?
Step 1. Document to be scanned is
placed face down on the glass window.
Step 2. Bright light moves underneath
scanned document.
Step 3. Image of the document is
reflected into a series of mirrors.

Step 4. Light is
converted to analog
electrical current that
is converted to
digital signal by an
analog-to-digital
Step 6. Users can print image,
converter (ADC).
e-mail it, include it in a document,
or place it on a Web page.
Step 5. Digital information is sent to
memory in the computer to be used by
illustration, desktop publishing, or
other software; or it is stored on disk.
Scanners and Reading Devices
 What is an optical reader?

 Device that uses light source to read characters, marks,


and codes and then converts them into digital data
 Optical character recognition
(OCR) reads characters in
OCR font
 Optical mark recognition
(OMR) reads hand-drawn pencil
marks, such as small circles
Scanners and Reading Devices
 What is a bar code reader?
 Uses laser beams to read bar codes
Scanners and Reading Devices
What is a magnetic-ink character recognition
(MICR) reader?
 Can read text printed with magnetized ink
 Banking industry almost exclusively uses MICR
for check processing
Biometric Input
 What is biometrics?
 Authenticates person’s identity
by verifying personal
characteristic
 Fingerprint scanner captures
curves and indentations of
fingerprint
 Hand geometry system measures
shape and size of person’s hand
Biometric Input
 What are examples of biometric technology?

 Voice verification system compares live


speech with stored voice pattern
 Signature verification system recognizes
shape of signature
 Iris recognition system reads
patterns in blood vessels in back
of eye
 Biometric data is sometimes stored
on smart card, which stores
personal data on microprocessor
embedded in card
 Output Devices
– Display data after they have been processed.
– Cathode Ray Tube (CRT)
• The most popular form of information output.
• It works much like a television picture tube, with an electronic gun
shooting a beam of electrons to illuminate the pixels on the screen.
– Printers
• Produce a printed hard copy of information output.
• Include impact printers ( dot-matrix printer), and non-impact
printers (laser, inkjet, and thermal transfer printers).
– Plotters
• To created high-quality graphics documents with multicolored
pens to draw computer output.
• Slower than printers but are useful for outputting large-size
charts, maps or drawing.
– Voice output devices
• Converts digital output data into intelligible speech.
– Speakers
• To deliver an audio output such as music, that is connected to
the computer.
What is
 What is output?
Output?
 Data that has been processed into a useful form,
 Output device is any hardware component that can convey
information to user

p. 300 Fig. 6-1 Next


Display Devices

 What is a display device?

 Output device that visually conveys information


 Information on display device sometimes
called soft copy
 Monitor houses display device as separate
peripheral

p. 302
CRT Monitors
 What is a CRT monitor?
 Contains cathode-ray
tube (CRT)
 Screen coated with tiny
dots of phosphor material
 Each dot consists of a red,
blue, and green phosphor
 Common sizes are 15, 17,
19, 21, and 22 inches
 Viewable size is diagonal
measurement of actual
viewing area
CRT Monitors
How does video travel from the processor to a CRT
monitor?
 Video card (also called a graphics card) converts digital
output from computer into analog video signal
Step 5. Electron guns
Step 1. The fire the three color signals
processor sends Step 3. The to the front of the CRT.
digital video data analog signal is
to the video card. sent through a
cable to the CRT Step 4. The
monitor. CRT monitor
separates the
analog signal
into red, green,
and blue signals.
Step 6. An image is
displayed on the screen when
the electrons hit phosphor
Step 2. The video card’s dots on the back of the screen.
digital-to-analog converter
(DAC) converts the digital
Printers
 What is a printer? portrait

 Output device that


produces text and
graphics on paper
 Result is hard copy, or
printout
 Two orientations: portrait
and landscape
landscape
Speakers and Headsets
 What is an audio output device?
 Computer component that produces music, speech, or
other sounds
 Speakers and headsets are common devices
Speakers and Headsets
 What is voice output?

 Computer talks to you through speakers on computer


 Internet telephony allows you to have conversation
over Web
Software
Software
 recall:
– hardware refers to the physical components of
computers
– software refers to the programs that execute on the
hardware
 a software program is a sequence of instructions
for the computer (more specifically, for the CPU)
to carry out in order to complete some task
– e.g., word processing (Microsoft Word, Corel
WordPerfect)
– e.g., image processing (Adobe Photoshop, Macromedia
Flash)
– e.g., Web browsing (Internet Explorer, Mozilla 94
Firefox)
System Software
– Refers to programs that make the computer usable
and accessible to the developers and programmers of
applications software.
– Examples of system software:
– Operating systems
– Language translator
– Linker
– Loader
– Preprocessors
Operating system
 An organized collection of system programs which
serve as the interface between the user or application
and the computer.
 It manages the hardware resources:
– CPU management to facilitate sharing execution
time of processes
– Memory management to allocate memory
resources dynamically
– I/O management to handle reading and writing
devices
96
Disk Operating Systems (DOS)
 Disk Operating System (DOS) is a generic term
describing any operating system that is loaded
from disk devices when the system is started or
rebooted.
 It is not a user friendly OS since users need to
memorize commands and issue it by typing line
by line. This known as command line interface.
Very few end users use DOS nowadays.
97
Microsoft Windows
 A graphical user interface (GUI) originally
running on DOS (Windows 3.x) that allows
multitasking or the ability to run several
programs at the same time.
 Windows 95 / Windows NT that no longer
runs on DOS
 About 75% of the world’s PCs use the
Windows operating system. The present
versions in use are Windows 98, Windows
Me and Windows 2000.
98
Other operating systems

 IBM OS/2
 Macintosh OS
 SCO Unix
 Linux
 Other Proprietary OS

4. 99
Application Software
– programs that are developed to solve some specific
problems.
– A set of instructions designed to perform a specific task
such as word processing, accounting, cataloguing, library
management, animation, etc.
– There are two types of application software:
– application program to solve special classes of problems
– Application programs that you can write to solve your own
problems.
– Examples of application software:
– word processing
– database programs
– spreadsheets
– graphic programs
General purpose office software
 Word processing: Example, MS Word
 Spreadsheets: Example, Excel
 Database management systems: Example,
MS Access, Oracle
 Presentation/Graphics: Example, Power
Point, Corel

4. 101
special purpose software

 Desktop publishing software: Example,


Microsoft Publisher
 Imaging and drawing: Example, Corel
Draw, Photo Shop
 File management: Example: CDS/ISIS,
INMAGIC
 Library management software:
Example: Athena, GLAS, Innopac,
Library Solutions
4. 102
Programming Languages

 Programming Language is an agreed upon


format of symbols that allow a programmer to
instruct a computer to perform certain
predefined tasks.
 Provide features to support the data processing
activities, which include declaring variables,
evaluating numeric expressions, assigning
values to variables, reading and writing data to
devices, looping and making decisions.
 a. Machine Languages
– Is the natural language of a computer.
– Does not need to translate and is ready for immediate
execution.
– Machine language instruction is a binary string of 0s
and 1s.
• 010 1 1000 0001 0000 1100 0000 0001 0000
– Are machine-dependent - each computer type has its
own machine language.
– Programs written in machine languages are not portable
because programs written in for one type of computer
cannot be run on another type
 Assembly Languages
– Consists of English-like abbreviations.
– Easier to understand.
• L 1, GROSSPAY
• S 1, TAX
• ST 1, NETPAY
– Program written in assembly languages cannot be directly processed
by a computer.
– Must use language translators, called assemblers, to convert them to
machine code.
– Disadvantages:
• In general, each assembly language instruction corresponds to one
machine language instruction. Therefore, the programs written in them
are lengthy.
– Because of variations in assembly languages, programs written using
them are not portable.
 High-Level languages
– Instructions are quite English-like, and a single
instruction can be written to correspond to many
operations at the machine level.
– For example, the assembly language program can be
written in high-level languages as follows:
• Netpay = gross pay – tax
– Are easier to learn than machine or assembly
languages.
– Have to be converted to machine languages before
they can be executed using compilers, system
software that translates a source program into an
almost executable object program
 For example:
– COBOL – developed in the 1960s for business
transactions.
– FORTRAN – developed for mathematic calculations.
– Pascal - is a structured high-level language.
– C – is designed to support only procedure-oriented
programming. Popular language for developing system
applications such as operating system and compilers.
– Java – is an object-oriented language.
– C++ - is extension of C programming language that
support object oriented programming and procedure-
oriented approach.
some future trends in software
development
 More user friendly
 Bigger in size because of more
sophistication
 More customized
 More Web enabled
 More open
 More sophisticated programming languages
4. 108
Data and Computers
Computers are multimedia devices, dealing with a vast
array of information categories
Computers store, present, and help us modify
 Numbers
 Text
 Audio
 Images and graphics
 Video

1
Data and Computers
Data compression
Reduction in the amount of space needed to store a
piece of data
Compression ratio
The size of the compressed data divided by the size
of the original data
A data compression techniques can be
lossless, which means the data can be retrieved without
any loss of the original information
lossy, which means some information may be lost in the
process of compaction

2
Analog and Digital Information
Computers are finite!
How do we represent an infinite world?

We represent enough of the world to satisfy our


computational needs and our senses of sight and
sound

3
Analog and Digital Information
Information can be represented in one of two ways:
analog or digital

Analog data
A continuous representation, analogous to the actual
information it represents

Digital data
A discrete representation, breaking the information up
into separate elements

4
Analog and Digital Information
Thermometer
is an
analog device

A mercury
thermometer
continually
rises in
direct
proportion to
the
temperature

5
Analog and Digital Information
Computers cannot work well with analog data, so we
digitize the data

Digitize
Breaking data into pieces and representing those
pieces separately

Why do we use binary to represent digitized data?

6
Electronic Signals
Important facts about electronic signals
 An analog signal continually fluctuates in voltage
up and down
 A digital signal has only a high or low state,
corresponding to the two binary digits
 All electronic signals (both analog and digital)
degrade as they move down a line
 The voltage of the signal fluctuates due to
environmental effects

7
Electronic Signals (Cont’d)
Periodically, a digital signal is reclocked to regain its
original shape

An analog and a digital signal

Degradation of analog and digital signals


8
Binary Representations
One bit can be either 0 or 1
One bit can represent two things (Why?)
Two bits can represent four things (Why?)
How many things can three bits represent?

How many things can four bits represent?

How many things can eight bits represent?

9
Binary Representations Counting with
binary bits

10
Binary Representations
How many things can  bits represent?

Why?

What happens every time you increase the number of bits


by one?

11
Representing Negative Values
Signed-magnitude number representation
The sign represents the ordering, and the digits
represent the magnitude of the number

12
Representing Negative Values
There is a problem with the sign-magnitude
representation: Can you guess why?

There is a plus zero and minus zero, which causes


unnecessary complexity

Solution:
Keep all numbers as integer values, with half of
them representing negative numbers
13
Representing Negative Values
Using two decimal digits,
let 1 through 49 represent 1 through 49
let 50 through 99 represent -50 through -1

14
Representing Negative Values
To perform addition, add the numbers and discard any
carry
Now you try it

48 (signed-magnitude)
-1
47

How does it work in


the new scheme?

15
Representing Negative Values
A-B=A+(-B)
Add the negative of the second to the first

Try
4 -4 -4
-3 +3 + -3

16
Representing Negative Values
Formula to compute the negative representation of a
number

This representation is called the ten’s complement

17
Representing Negative Values
Two’s Complement
(Vertical line is easier to read)

18
Representing Negative Values
Addition and subtraction are the same as in 10’s
complement arithmetic

-127 10000001
+ 1 00000001
-126 10000010
Do you notice something interesting about the left-most
bit?

19
Number Overflow
What happen if the computed value won't fit?
Overflow
If each value is stored using eight bits, adding 127 to
3 overflows
1111111
+ 0000011
10000010

Problems occur when mapping an infinite world


onto a finite machine!
20
Representing Real Numbers
Real numbers
A number with a whole part and a fractional part
104.32, 0.999999, 357.0, and 3.14159

Positions to the right of the decimal point are the


tenths position: 10-1, 10-2 , 10-3 …

21
Representing Real Numbers
Same rules apply in binary as in decimal
Decimal point is actually the radix point
Positions to the right of the radix point in binary are
2-1 (one half),
2-2 (one quarter),
2-3 (one eighth)

22
Representing Real Numbers
A real value in base 10 can be defined by the following
formula

The representation is called floating point because the


number of digits is fixed but the radix point floats

23
Representing Real Numbers

A binary floating-point value is defined by the


formula
sign * mantissa * 2exp
24
Representing Real Numbers
Scientific notation
A form of floating-point representation in which the
decimal point is kept to the right of the leftmost
digit

12001.32708 is 1.200132708E+4 in scientific notation


What is 123.332 in scientific notation?
What is 0.0034 in scientific notation?

25
Representing Text
What must be provided to represent text?

There are finite number of characters to represent,


so list them all and assign each a binary string

Character set
A list of characters and the codes used to represent
each one

Computer manufacturers agreed to standardize

26
The ASCII Character Set
ASCII stands for American Standard Code for
Information Interchange
ASCII originally used seven bits to represent each
character, allowing for 128 unique characters
Later extended ASCII evolved so that all eight bits were
used
How many characters could be represented?

27
The ASCII Character Set

28
The ASCII Character Set
The first 32 characters in the ASCII character
chart do not have a simple character
representation to print to the screen

What do you think they are used for?

29
The Unicode Character Set
Extended ASCII is not enough for international use
Unicode uses 16 bits per character
How many characters can UNICODE represent?
Unicode is a superset of ASCII
The first 256 characters correspond exactly to the
extended ASCII character set

30
The Unicode Character Set

A few characters in the Unicode character set 31


Text Compression
Assigning 16 bits to each character in a document uses
too much file space

We need ways to store and transmit text efficiently

Text compression techniques


keyword encoding
run-length encoding
Huffman encoding

32
Keyword Encoding
Replace frequently used words with a single character

33
Keyword Encoding
Given the following paragraph,
We hold these truths to be self-evident, that all men are
created equal, that they are endowed by their Creator
with certain unalienable Rights, that among these are
Life, Liberty and the pursuit of Happiness. ム That to
secure these rights, Governments are instituted among
Men, deriving their just powers from the consent of the
governed, ム That whenever any Form of Government
becomes destructive of these ends, it is the Right of the
People to alter or to abolish it, and to institute new
Government, laying its foundation on such principles
and organizing its powers in such form, as to them shall
seem most likely to effect their Safety and Happiness.

34
Keyword Encoding
The encoded paragraph is
We hold # truths to be self-evident, $ all men are created
equal, $ ~y are endowed by ~ir Creator with certain
unalienable Rights, $ among # are Life, Liberty + ~
pursuit of Happiness. — $ to secure # rights,
Governments are instituted among Men, deriving ~ir
just powers from ~ consent of ~ governed, — $ whenever
any Form of Government becomes destructive of # ends,
it is ~ Right of ~ People to alter or to abolish it, + to
institute new Government, laying its foundation on such
principles + organizing its powers in such form, ^ to ~m
shall seem most likely to effect ~ir Safety + Happiness.

35
Keyword Encoding
What did we save?
Original paragraph
656 characters
Encoded paragraph
596 characters
Characters saved
60 characters
Compression ratio
596/656 = 0.9085
Could we use this substitution chart for all text?
36
Run-Length Encoding
A single character may be repeated over and over again
in a long sequence
Replace a repeated sequence with
 a flag character
 repeated character
 number of repetitions
*n8
 * is the flag character
 n is the repeated character
 8 is the number of times n is repeated

37
Run-Length Encoding
Original text
bbbbbbbbjjjkllqqqqqq+++++
Encoded text
*b8jjjkll*q6*+5 (Why isn't l encoded? J?)
The compression ratio is 15/25 or .6

Encoded text
*x4*p4l*k7
Original text
xxxxpppplkkkkkkk

This type of repetition doesn’t occur in English text; can you think of a
situation where it might occur?

38
Huffman Encoding
Why should the character “X" and "z" take up the same
number of bits as "e" or " "?

Huffman codes use variable-length bit strings to


represent each character
More frequently used letters have shorter strings to
represent them

39
Huffman Encoding
ballboard would be
1010001001001010110001111011

compression ratio
28/56
Encode roadbed

40
Huffman Encoding
In Huffman encoding no character's bit string is the
prefix of any other character's bit string

To decode
look for match left to right, bit by bit
record letter when a match is found
begin where you left off,going left to right

41
Huffman
Try it! Encoding

Decode
1011111001010

42
Huffman Encoding
Technique for determining codes guarantees the prefix
property of the codes

Two types of codes


 general, based on use of letters in English (Spanish, ….)
 specialized, based on text itself or specific types of text

43
Representing Audio
Information

We perceive sound when a series of air compressions vibrate a


membrane in our ear, which sends signals to our brain

44
Representing Audio
Information

A stereo sends an electrical signal to a speaker to produce


sound
This signal is an analog representation of the sound wave
The voltage in the signal varies in direct proportion to the
sound wave
45
Representing Audio
Information
Digitize the signal by sampling
 periodically measure the voltage
 record the numeric value

How often should we sample?

A sampling rate of about 40,000 times per second is


enough to create a reasonable sound reproduction

46
Representing Audio Information

A CD player reading
binary information

47
Representing Audio Information

Some data
is lost, but a
reasonable
sound is
reproduced

Sampling an audio signal


48
Representing Audio Information

CDs store audio information digitally


On the surface of the CD are microscopic pits that
represent binary digits
A low intensity laser is pointed as the disc The laser light
reflects
strongly if the surface is smooth and poorly if the
surface is pitted

49
Audio Formats
Audio Formats
 WAV, AU, AIFF, VQF, and MP3

MP3 (MPEG-2, audio layer 3 file) is dominant


 analyzes the frequency spread and discards information
that can’t be heard by humans
 bit stream is compressed using a form of Huffman
encoding to achieve additional compression

Is this a lossy or lossless compression (or both)?

50
Representing Images and
Graphics
Color
Perception of the frequencies of light that reach the
retinas of our eyes

Retinas have three types of color photoreceptor cone


cells that correspond to the colors of red, green, and
blue

51
Representing Images and
Graphics
Color is expressed as an RGB (red-green-blue) value--
three numbers that indicate the relative contribution
of each of these three primary colors

An RGB value of (255, 255, 0) maximizes the


contribution of red and green, and minimizes the
contribution of blue, which results in a bright yellow

52
Number Systems
Number Systems
 Number categories
– Many categories: natural, negative, rational, irrational and many
others important to mathematics but irrelevant to the understanding
of computing
 Number – unit belonging to an abstract mathematical
system and subject to specified laws of succession,
addition and multiplication
– Natural number is the number 0 or any other number obtained
adding repeatedly 1 to this number.
– A negative number is less than 0 and it is opposite in sign to a
positive number.
– An integer is any of positive or negative natural numbers
– A rational number is an integer or the quotient of any two integer
numbers
• is a value that can be expressed as a fraction
Number Systems …
 The base of number system represents the number
of digits that are used in the system. The digits
always begin with 0 and continue through one less
than the base
 Examples:
– There are two digits in base two (0 and 1)
– There are eight digits in base 8 (0 through 7)
– There are 10 digits in base 10 (0 through 9)
 The base determines also what the position of the
digits mean
Positional Notation
 It is a system of expressing numbers in which the digits are arranged in
succession and, the position of each digit has a place value and the number is
equal to the sum of the products of each digit by its place value
 Example:
– Consider the number 954:
• 9 * 102 + 5 * 101 + 4 * 100 = 954
– Polynomial representation - formal way of representing numbers, where X is the
base of the number:
• 9 * X2 + 5 * X1 + 4 * X0
 Formal representation – consider that the base of representation is B and the
number has n digits, where di represents the digit in the ith position.
– dn * Bn-1 + dn-1 * Bn-2 + …+ d2B +d1
– 642 is:
63 * 102 + 42 * 10 + 21 * 10 0
Other bases
What if 642 has the base of 13?

+ 6 x 13² = 6 x 169 = 1014


+ 4 x 13¹ = 4 x 13 = 52
+ 2 x 13º = 2 x 1 = 2
= 1068 in base 10

642 in base 13 is equivalent to 1068 in base 10


Binary, Octal and Hexadecimal
 Decimal base has 10 digits (0, 1, 2, 3, 4, 5, 6, 7, 8,
9)
 Binary is base 2 and has two digits (0 and 1)
 Octal is base 8 and has 8 digits (0, 1, 2, 3, 4, 5, 6,
7)
 Hexadecimal is base 16 and has 16 digits (0, 1, 2,
3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)
Converting Octal to Decimal
 What is the decimal equivalent of octal number
642?

6 x 8² = 6 x 64 = 384
+ 4 x 8¹ = 4 x 8 = 32
+ 2 x 8º = 2 x 1 = 2
= 418 in base 10

• Remember that octal base has only 8 digits


(0, 1, 2, 3, 4, 5, 6, 7)
Converting Hexadecimal do Decimal
 What is the decimal equivalent of the hexadecimal
number DEF?

D x 16² = 13 x 256 = 3328


+ E x 16¹ = 14 x 16 = 224
+ F x 16º = 15 x 1 = 15
= 3567 in base 10

• Remember that hexadecimal base has 16 digits (0,


1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)
Converting Binary to Decimal

• What is the equivalent decimal of the binary


10110 number?
1 x 24 = 1 x 16 = 16
+ 0 x 23 = 0x8 =0
+ 1 x 22 = 1x4 =4
+ 1 x 21 = 1x2 =2
+ 0 x 20 = 0x1 =0
= 22 in base 10
 Remember that binary base has only 2 digits (0, 1)
Review Question 1
What is octal number 11 in decimal representation?
A. 7
B. 8
C. 9
D. I don’t know …
Review Question 2
What is the decimal representation of binary number
1110?
A. 8
B. 14
C. 16
D. I don’t know …
Review Question 3
What is decimal representation of hexadecimal
number FF?
A. 10
B. 255
C. 256
D. I don’t know …
Arithmetic in Binary
 The rules of arithmetic are analogous in other basis as in
decimal base
Should read 1+1=0 with a carry of Addition
1 similar to base 10 where 9 + 1 =
0 with a carry of 1 = 10 1 1 0 0
+ + + +
1 0 1 0
10 1 1 0

-1 can be stated as 1 with a borrow Subtraction


of 1. Leading 1 we consider to be
the sign, so 11 means -1 1 1 0 0
- - - -
1 0 1 0
0 1 11 0
Addition in Binary
 Base 2: 1+1 operation - the rightmost digit reverts to 0
and there is a carry into the next position to the left

111 Carry Values


0101
+1011
10000
 We can check if the answer is correct by converting the
both operands in base 10, adding them and comparing the
result
Subtracting in Binary
 The rules of the decimal base applies to binary as well. To
be able to calculus 0-1, we have to “borrow one” from the
next left digit.
 More precisely, we have to borrow one power of the base

12
0202
1010
-0111
0011
 You can check if the result is correct by converting the
operands in decimal and making the calculus.
Review Question 4
 Add 4 bit number 0100 with 0111. The answer is:
A. 1001
B. 1011
C. 1110
D. I don’t know …
Review Question 5
 Subtract 4 bit number 0100 from 1111. The
answer is:
A. 1001
B. 1011
C. 1110
D. I don’t know …
Power of two Number Systems
 Binary and octal numbers
have a very special relation Binary Octal Decimal
between them: given a binary 000 0 0
number, can be read in octal 001 1 1
and given an octal number 010 2 2
can be read in binary (i.e. 011 3 3
have 753 in octal, in binary 100 4 4
you have 111 101 011 by 101 5 5
replacing each digit by its 110 6 6
binary representation) 111 7 7
1000 10 8
 Table represents counting in
1001 11 9
binary with octal and decimal
1010 12 10
representation
Converting Binary to Octal
 Start at the rightmost binary digit and mark the digits in groups of
three
 Convert each group individually

10101011 10 101 011


2 5 3
10101011 is 253 in base 8
• The reason that binary can be immediately converted in
octal and vice-versa is because 8 is power of 2
• There is a similar relationship between binary and
hexadecimal
Converting Binary to Hexadecimal
 Start at the rightmost binary digit and mark the digits in
groups of four
 Convert each group individually

10101011 1010 1011


A B
10101011 is AB in base 16
Converting Decimal to Other Bases
 Involves dividing by the base into which you
convert the number
 Algorithm:
– Dividing the number by the base you get a quotient and
a reminder
– While the quotient is not zero:
• Divide the decimal number by the new base
• Make the remainder the next digit to the left in the answer
• Replace the original dividend with the quotient
 The base 10 number 3567 is what number in base
16?
Converting Decimal to Hexadecimal
 3567 in decimal is DEF in hexadecimal

3567 16
32 D E F
36 222 16
32 16
47 62 13
32 48
15 14
Review Question 6
Convert number 11001111 to hexadecimal. The
answer is:
A. CF
B. BF
C. FC
D. I don’t know …
Review Question 7
Convert decimal number 375 to its octal
representation. The answer is
A. 567
B. 765
C. 556
D. I don’t know …
Review Question 8
Convert decimal number 37 to its binary
representation. The answer is:
A. 101001
B. 100101
C. 111000
D. I don’t know …
Fractions
 Representation and conversion of fractional numbers is
more difficult because there is not necessarily an exact
relationship between fractional numbers in different
number bases.
 Fractional numbers that can be represented exactly in one
number base, may be impossible to represent exactly in
another
 Example:
– The decimal fraction 1/3 is not represent-able as a decimal value in
base 10: 0.333333310…; this can be represented exactly in base 3
as 0.13
– The decimal fraction 1/10 (or 0.110) cannot be represented exactly
in binary form. The binary equivalent begins: 0.0001100110012…
Fractions …
 The strength of each digit is B times the strength of its right neighbor
(where B is the base for a given number).
 If we move the number point to the right, the value of the number will
be multiplied by the base:
– 139010 is 10 times as large as 139.010
– The 1002 is twice as big as 102
 The opposite is also true – if we move the number point to the left one
place, then the value is divided by the base
 A given number .D1D2D3 …Dn will be represented as:
– D1 * B-1 + D2 * B-2 + D3 * B-3 + .. + DnB-n
– 0.2589 = 2 * (1/10) + 5 * (1/100) + 8 * (1/1000) + 9 * (1/10000)
– 0.1010112 = (½) + (1/8) + (1/32) + (1/64)
Fractional Conversion Methods
 The intuitive method:
– Determine the appropriate weights for each digit, multiply each digit
by its weight and then add the values
• Example:
• convert 0.122013 to base 10 = (1/3) + 2 * (1/9) + 2 * (1/27) + (1/243) =
0.63374
– Convert the number in a natural number (and record what was the
multiplier) and then divide the result by the multiplier
• Example:
• convert 0.1100112 to base 10 – shifting the binary point six places to the
right and converting, we have: 32 + 16 +2 +1 = 51; shifting the point back
is the equivalent of 26 or 64, so we can obtain the final number by
dividing 51 to 64 = 0.796875
 Variation of the division method shown earlier: we multiply
the fraction by the base value, repeatedly, and record, then
drop the values that move to the left of the point.
– This is repeated until the level of accuracy is obtained or until the
value being multiplied is zero
Fractions Base Conversion
0.828125 *
2 0.110101
1.656250 *
The 1 is saved as 2
result then dropped 1.312500 *
and the process 2
repeated 0.625000 *
2
1.250000 *
2
0.500000 *
2
1.000000
Fraction Conversions between Bases
power of two
 The conversion between bases where one base is
an integer power of the other can be performed for
fractions by grouping the digits in the smaller base
as before
 For fractions, the grouping must be done from the
left to right; the method is otherwise identical
 Example:
– Convert 0.101112 to base 8: 0.101_110 = 0.568
– Convert 0.1110101 to base 16: 0.1110_1010 = 0.EA16
Review Question 9
Convert binary number 0.11 to its decimal value.
The answer is:
A. 0.1
B. 0.5
C. 0.75
D. I don’t know …
Review Question 10
Convert decimal number 0.33 in it binary
representation. Use maximum 8 bit precision after
the point. The result is:
A. 0.01010100
B. 0.11001100
C. 0.11111111
D. I don’t know …
Review Question 11
Consider binary number 0.01010100. Compute its
decimal value. The answer is:
A. 0.33
B. 0.328125
C. 0.5
D. I don’t know …
Boolean Algebra

1
What is an Algebra?
What is an Algebra? (e.g. algebra of integers)
set of elements (e.g. 0,1,2,..)
set of operations (e.g. +, -, *,..)
postulates/axioms (e.g. 0 + x = x,..)

 Boolean Algebra named after George Boole


(1815-1864) who used it to study human logical
reasoning – calculus of proposition.
 simply a way of comparing individual bits.
 Uses operators to determine how the bits are
compared.

2
Boolean Algebra Introduction
Boolean algebra forms the basis of logic circuit design.
Consider very simple but common example: if (A is true)
and (B is false) then print “the solution is found”. In this
case, two Boolean expressions (A is true) and (B is false)
are related by a connective „and‟. How do we define
these?

3
Boolean operators
 Events : true or false
 Connectives : a OR b; a AND b, NOT a
 The operators used most often are AND and OR.
– The AND operation
• if and only if all inputs are on, the output will be on.
• The output will be off if any of the inputs are off.
– The OR operation
• If any input is on, the output will be on.
• Example: Either “it has rained” OR “someone splashed
water”, “must be tall” AND “good vision”.
• It's easy to see all of the combinations by using what are
called truth tables
4
Truth Tables
Truth tables show the result of combining boolean expressions of a logic
function by listing all possible values the function can attain

a b a AND b a b a OR b a NOT a
F F F F F F F T
F T F F T T T F
T F F T F T
T T T T T T

5
Truth Table: The AND operations
• the output will be on (or 1) if and only if all inputs are on (or 1).
• The output will be off (or 0) if any of the inputs are off (or 0)

TRUTH TABLE
The AND Gate
AND OPERATIONS
A B C=A.B A
0 0 0 C=A.B
B
0 1 0
1 0 0
1 1 1

6
Truth Table: The OR operations
• the output will be on (or 1) if ANY of inputs are on (or 1).
• The output will be off (or 0) if ALL inputs are off (or 0)

TRUTH TABLE
The OR Gate
OR OPERATIONS
A B C=A+B A
0 0 0 C=A.B
B
0 1 1
1 0 1
1 1 1

7
Truth Table: the inverter or NOT operation
• has only one input and one output
• The output will be in opposite state to the input
• If input is 0, output is 1; If input is 1, output is 0;

TRUTH TABLE
The NOT Gate
The NOT
Operations
A C= A A C= A
0 1
1 0

8
Truth Table: The NAND operations
• Has the same logic as AND operation, but with an inverted output.
• the output will be OFF (or 0) if and only if all inputs are ON (or 1),.
• The output will be ON (or 1) if any of the inputs are OFF (or 0)

TRUTH TABLE
The NAND Gate
NAND OPERATIONS
A B C= A.B A
C= A.B
0 0 1 B
0 1 1
1 0 1
1 1 0

9
Truth Table: The NOR operation
• Inverts the OR operation
• if any input is ON (or 1), the output will be OFF (or 0)

TRUTH TABLE
The NOR Gate
NOR OPERATIONS

A B C=A+B A
C= A+B
0 0 1 B
0 1 0
1 0 0
1 1 0

10
Summary of 2-input logic gates

11
Truth Table: The Exclusive-OR or XOR operation

• the output will be ON (or 1) if the inputs are DIFFERENT.

TRUTH TABLE
The XOR Gate
XOR OPERATIONS

A B C=A + B A
C= A + B
0 0 0 B
0 1 1
1 0 1
1 1 0

12
common logic functions and their
equivalent Boolean notation.

A.B + A.B or A + B
13
Example
For all possible combinations of A and B, draw the truth table for
C = A.B + A

A B A.B A A.B+A
0 0 0 1 1
0 1 0 1 1
1 0 0 0 0
1 1 1 0 1

14
Overview of
Communication Systems
and Networks

CSC 101: Introduction To Computer


Science
Communications Components
 Basic components of a
communication system
 Communication technologies
 Communication devices
 Communication channels
 Communication software
A Communications Model
Communication Technology
Applications

voice mail Twitter

instant
e-mail chat rooms
messaging

newsgroups telephony videoconferencing

collaboration groupware global positioning


system (GPS)
Communication Technologies -
Applications
 Different technologies allowing us to communicate
 Examples: Voice mail, fax, email, instant message, chat rooms, news groups,
telephony, GPS, and more
 Voice mail: Similar to answering machine but digitized
 Fax: Sending hardcopy of text or photographs between computers using fax
modem
 Email: electronic mail – sending text, files, images between different computer
networks - must have email software
 More than 1.3 billion people send 244 billion messages monthly!
 Chat rooms: Allows communications in real time when connected to the Internet
 Telephony: Talking to other people over the Internet (also called VoIP)
 Sends digitized audio signals over the Internet
 Requires Internet telephone software
 Groupware: Software application allowing a group of people to communicate
with each other (exchange data)
 Address book, appointment book, schedules, etc.
 GPS: consists of receivers connected to satellite systems
 Determining the geographical location of the receiver
 Used for cars, advertising, hiking, tracking, etc.
Communication Devices
 Any type of hardware capable of transmitting data, instructions, and
information between devices
 Functioning as receiver, transmitter, adaptor, converter
 Basic characteristics: How fast, how far, how much data!
 Examples: Dial-up modems, ISDN, DSL modems, network interface cards
 Dial-up modem: uses standard phone lines
 Converts digital information into analog
 Consists of a modulator and a demodulator
 Can be external, internal, wireless
 ISDN and DSL Modem: Allows digital communication between networks and
computers
 Requires a digital modem
 Digital is better than analog – why?
 Cable modem: a modem that transmits and receives data over the cable
television (CATV) network
 Also called broadband modem (carrying multiple signals)
 The incoming signal is split
 Requires a cable modem
 Network interface cards: Adaptor cards residing in the computer to transmit
and receiver data over the network (NIC)
 Operate with different network technologies (e.g., Ethernet)
Communication Software
 Examples of applications (Layer 7) take advantage of the
transport (Layer 4) services of TCP and UDP
 Hypertext Transfer Protocol (HTTP): A client/server
application that uses TCP for transport to retrieve HTML pages.
 Domain Name Service (DNS): A name-to-address translation
application that uses both TCP and UDP transport.
 Telnet: A virtual terminal application that uses TCP for
transport.
 File Transport Protocol (FTP): A file transfer application that
uses TCP for transport.
 Trivial File Transfer Protocol (TFTP): A file transfer
application that uses UDP for transport.
 Network Time Protocol (NTP): An application that
synchronizes time with a time source and uses UDP for
transport.
 Border Gateway Protocol (BGP): An exterior gateway routing
protocol that uses TCP for transport. BGP is used to exchange
routing information for the Internet and is the protocol used
between service providers.
Communication Channels
 A channel is a path between two communication
devices
 Channel capacity: How much data can be passed
through the channel (bit/sec)
 Also called channel bandwidth
 The smaller the pipe the slower data transfer!
 Consists of one or more transmission media
 Materials carrying the signal
 Two types:
 Physical: wire cable T1
nice lines T1
 Wireless: Air destination lines
network
server T3
lines

T1
lines
Physical Transmission Media
 A tangible media
 Examples: Twisted-pair cable, coaxial cable, Fiber-optics,
etc.
 Twisted-pair cable:
 One or more twisted wires bundled together (why?)
 Made of copper
 Coax-Cable:
 Consists of single copper wire surrounded by three layers of
insulating and metal materials
 Typically used for cable TV
 Fiber-optics:
 Strands of glass or plastic used to transmit light
 Very high capacity, low noise, small size, less suitable to
natural disturbances
Physical Transmission Media

twisted-pair cable twisted-pair wire


woven or
braided metal copper wire

plastic outer insulating


coating material

optical fiber
core

glass cladding

protective
coating
Wireless Transmission Media
 Broadcast Radio
 Distribute signals through the air
over long distance
 Uses an antenna
 Typically for stationary locations
 Can be short range
 Cellular Radio
 A form of broadcast radio used for
mobile communication
 High frequency radio waves to
transmit voice or data
 Utilizes frequency-reuse
Wireless Transmission Media
 Microwaves
 Radio waves providing high speed
transmission
 They are point-to-point (can’t be
obstructed)
 Used for satellite communication
 Infrared (IR)
 Wireless transmission media that sends
signals using infrared light- waves - Such
as?
Physical Transmission Media

Wireless channel capacity:

100 Mbps is how many bits per sec?

Which is bigger:
10,000 Mbps, 0.01Tbps or 10Gbps?
Networks

 Collection of computers and devices connected together


 Used to transfer information or files, share resources, etc.
 What is the largest network?
 Characterized based on their geographical coverage, speed,
capacities
 Networks are categorized based on the following characteristics:
 Network coverage: LAN, MAN, WAN
 Network topologies: how the computers are connected
together
 Network technologies
 Network architecture
Network coverage
 Local Area Networks:
 Used for small networks (school, home, office)
 Examples and configurations:
 Wireless LAN or Switched LAN
 ATM LAN, Frame Ethernet LAN
 Peer-2-PEER: connecting several computers together (<10)
 Client/Server: The serves shares its resources between
different clients
 Metropolitan Area Network
Backbone network connecting all LANs
 Can cover a city or the entire country
 Wide Area Network
 Typically between cities and countries
 Technology:
 Circuit Switch, Packet Switch, Frame Relay, ATM

 Examples:
 Internet P2P: Networks with the same network software can be
connected together (Napster)
LAN v.s WAN
LAN - Local Area Network a group of
computers connected within a building
or a campus (Example of LAN may
consist of computers located on a
single floor or a building or it might link
all the computers in a small company.

WAN - A network consisting


of computers of LAN's
connected across a distance
WAN can cover small to large
distances, using different
topologies such as telephone
lines, fiber optic cabling,
satellite transmissions and
microwave transmissions.
Introduction to Computer Networks

Network Topology
The network topology
defines the way in
which computers,
printers, and other
devices are
connected. A network
topology describes
the layout of the wire
and devices as well
as the paths used by
data transmissions.
Network Topologies
 BUS networks: Single central cable connected a number of
devices
 Easy and cheap
 Popular for LANs
 RING networks: a number of computers are connected on a
closed loop
 Covers large distances
 Primarily used for LANs and WANs
 STAR networks: connecting all devices to a central unit
 All computers are connected to a central device called hub
 All data must pass through the hub
 What is the problem with this?
 Susceptible to failure
Introduction to Computer Networks

Bus Topology
Commonly referred to
as a linear bus, all the
devices on a bus
topology are
connected by one
single cable.
Introduction to Computer Networks

Star & Tree Topology


The star topology is the most
commonly used architecture in
Ethernet LANs.
When installed, the star
topology resembles spokes in
a bicycle wheel.
Larger networks use the
extended star topology also
called tree topology. When
used with network devices that
filter frames or packets, like
bridges, switches, and routers,
this topology significantly
reduces the traffic on the wires
by sending packets only to the
wires of the destination host.
Introduction to Computer Networks

Ring Topology
A frame travels around the ring,
stopping at each node. If a node
wants to transmit data, it adds the
data as well as the destination
address to the frame.
The frame then continues around
the ring until it finds the
destination node, which takes the
data out of the frame.
Single ring – All the devices on
the network share a single cable
Dual ring – The dual ring topology
allows data to be sent in both
directions.
Introduction to Computer Networks

Mesh Topology
The mesh topology
connects all devices
(nodes) to each other
for redundancy and
fault tolerance.
It is used in WANs to
interconnect LANs and
for mission critical
networks like those
used by banks and
financial institutions.
Implementing the mesh
topology is expensive
and difficult.
Network Topologies
personal personal personal
computer computer computer

personal personal
computer computer
personal computer

personal computer

personal computer
host
personal computer computer

printer
file server
Network Architecture
 Refers to how the computer or devices are designed in a network
 Basic types:
 Centralized – using mainframes
 Peer-2-Peer:
 Each computer (peer) has equal responsibilities, capacities, sharing
hardware, data, with the other computers on the peer-to-peer network
 Good for small businesses and home networks

 Simple and inexpensive

 Client/Server:
 All clients must request service from the server

 The server is also called a host

 Different servers perform different tasks: File server, network server, etc.

clie clie clie


nt nt nt

laser serv
printer er
P2P vs Client-Server
Peers make a portion of their resources, such
as processing power, disk storage or network
bandwidth, directly available to other network
participants, without the need for central
coordination by servers or stable hosts

Peer-to-Peer
Examples
Introduction to Computer Networks

Computers: Clients and Servers


In a client/server
network arrangement,
network services are
located in a dedicated
computer whose only
function is to respond
to the requests of
clients.

The server contains the


file, print, application,
security, and other
services in a central
computer that is
continuously available
to respond to client
requests.
Network Technologies
 Personal area network (PAN)
A low range computer network

 PANs can be used for communication among the personal
devices themselves
 Wired with computer buses such as USB and FireWire.
 Wireless personal area network (WPAN)
 Uses network technologies such as IrDA, Bluetooth, UWB,
Z-Wave and ZigBee
 Internet Mobile Protocols
 Supporting multimedia Internet traffic
 IGMP & MBONE for multicasting
 RTP, RTCP, & RSVP (used to handle multimedia on the
Internet)
 VoIP

Project
RTP: Real-time Transport Protocol Topic
Network Technologies
 Zigbee
 High level communication protocols using small, low-power digital radios based on
the IEEE 802.15.4
 Wireless mesh networking proprietary standard
 Bluetooth
 Uses radio frequency
 Typically used for close distances (short range- 33 feet or so)
 Transmits at 1Mbps
 Used for handheld computers to communicate with the desktop
 IrDA
 Infrared (IR) light waves
 Transfers at a rate of 115 Kbps to 4 Mbps
 Requires light-of-sight transmission
 RFID
 Radio frequency identification
 Uses tags which are places in items
 Example: merchandises, toll-tags, courtesy calls, sensors!
 WAP
 Wireless application protocol
 Data rate of 9.6-153 kbps depending on the service type
 Used for smart phones and PDAs to access the Internet (email, web, etc)
Project
Topic
Network Example:
Telephone Networks
 Called the Public Switched Telephone Network (PSTN)
 World-wide and voice oriented (handles voice and data)
 Data/voice can be transferred within the PSTN using different technologies (data
transfer rate bps)
 Dial-up lines:
 Analog signals passing through telephone lines Switching Technologies:
 Requires modems (56 kbps transfer rate) Technologies:
 ISDN lines: •Circuit Switching
 Integrated Services Digital Network
 Digital transmission over the telephone lines
•Packet Switching
 Can carry (multiplex) several signals on a single line •Message Switching
 DSL •Burst Switching
 Digital subscribe line
 ADSL (asymmetric DSL)
 receiver operated at 8.4 Mbps, transmit at 640 kbps
 T-Carrier lines: carries several signals over a single line: T1,T3
 Frame Relay
 ATM:
 Asynchronous Transfer Mode
 Fast and high capacity transmitting technology
 Packet technology
Project
Topic
Network Example:
Optical Networks
 Fiber-to-the-x
 Broadband network architecture
that uses optical fiber to replace
copper
 Used for last mile
telecommunications
 Examples: Fiber-to-the-home
(FTTH); Fiber-to-the-building
(FTTB); Fiber-to-the premises
(FTTP)
 Fiber Distribution Network (reaching
different customers)
 Active optical networks (AONs)
 Passive optical networks (PONs)

Project
Topic
Network Example
 Smart Grid
Delivering electricity from suppliers to

consumers using digital technology to
save energy
 Storage Area Networks
 Computational Grid Networks

Project
http://rekuwait.wordpress.com/2009/06/18/smart-electric-grid/ Topic
Network Example:
Telephone Networks
Network Examples
Cellular Network Examples
 0G
 Single, powerful base station covering a wide area,
and each telephone would effectively monopolize a
channel over that whole area while in use (developed
in 40’s)
 No frequency use or handoff (basis of modern cell
phone technology)
 1G
 Fully automatic cellular networks
 introduced in the early to mid 1980s
 2G
 Introduced in 1991 in Finland on the GSM standard
 Offered the first data service with person-to-person
SMS text messaging
Cellular Network Examples
 3G:
 Faster than PCS; Used for multimedia and
graphics
 Compared to 2G and 2.5G services, 3G
allows simultaneous use of speech and
data services and higher data rates (up to
14.4 Mbit/s on the downlink and 5.8 Mbit/s.
 4G:
 Fourth generation of cellular wireless;
 providing a comprehensive and secure IP
based service to users "Anytime,
Anywhere" at high data rates
Applications of Network
E-mail
Searchable Data (Web Sites)
E-Commerce
News Groups
Internet Telephony (VoIP)
Video Conferencing
Chat Groups
Instant Messengers
Internet Radio
Introduction to the Internet
and Web
What is Internet ?
• It is the largest network in the world that connects hundreds of
thousands of individual networks all over the world.
• The popular term for the Internet is the “information highway”.
• It is a Global network of computers, (servers or clients) to
exchange information.
• It is a "network of networks" that includes millions of private
and public, academic, business, and government networks
(local or Global), linked by copper wires, wireless
connections, and other technologies.
• Rather than moving through geographical space, it moves your
ideas and information through cyberspace – the space of
electronic movement of ideas and information.
The Internet: Then and Now
• The Internet was created by the Advanced Research
Projects Agency (ARPA) and the U.S. Department of
Defense for scientific and military communications.
• The Internet is a network of interconnected networks.
Even if part of its infrastructure was destroyed, data
could flow through the remaining networks.
• The Internet uses high-speed data lines, called
backbones, to carry data. Smaller networks connect to
the backbone, enabling any user on any network to
exchange data with any other user.
• ARPANET, NSFnet, Internet
• Internetworking: the process of connecting separate
networks
Some Common Terms
• The Internet is a network of computers spanning the
globe. It is also called the World Wide Web.

• An Internet Browser is a software program that enables


you to view Web pages on your computer. Browsers
connect computers to the Internet, and allow people to
“surf the Web.”

• Internet Explorer is one of the browsers most commonly


used. There are other browsers available as well, including
Netscape.
• A site or area on the World Wide Web that is
accessed by its own Internet address is called a Web
site.

• A Web Page is like a page in a book. Websites often


have several pages that you can access by clicking on
links. A Web site can be a collection of related Web
pages.

• Each Web site contains a home page (this is the


original starting page) and may also contain
additional pages.

• Different computers will have different home pages.


You can set your own webpage.
Internet
• No one owns it
• It has no formal management organization.
• As it was originally developed by the Department
of defense, this lack of centralization made it less
vulnerable to wartime or terrorist attacks.
• To access the Internet, an existing network need to
pay a small registration fee and agree to certain
standards based on the TCP/IP (Transmission
Control Protocol/Internet Protocol) .
The uses of the Internet
• Send e-mail messages.
• Send (upload) or receive (down load) files between computers.
• Participate in discussion groups, such as mailing lists and
newsgroups.
• Surfing the web.
• Download programs and files
• E-Mail
• Voice and Video Conferencing
• E-Commerce
• File Sharing
• Information browsing
• Search the web addresses for access through search engine
• Chatting and many more…
Disadvantages of
Internet
• Theft of personal information such as name, address, credit card
number etc.
• Virus threats nothing but a program which disrupts the normal
functioning of your system.
• Spamming refers to receiving unwanted e-mails in bulk, which
provide no purpose and needlessly obstruct the entire system.
• Pornography This is perhaps the biggest threat related to children‟s
healthy mental life. A very serious issue concerning the Internet.

Though, internet can also create havoc, destruction and its


misuse can be very fatal,
the advantages of it outweigh its disadvantages.
Intranet
What is Intranet ?
• Internal company or private network that uses Internet
standards (HTML, HTTP & TCP/IP protocols) & software.
– Provide employees with easy access to
corporate information
– Used to deploy corporate applications
• Examples – policies and procedures manuals;
human resource forms; product catalogs
– Security is a concern
• Security measures include – public key security,
encryption, digital certificates, firewalls
• Accessed only by authorized persons, especially members
or employees of the organization
Intranet Security
Two levels of Security required:

• Internal
It can be imposed by Public Key Security & Encryption
Key.

• External
Through Firewall.
What is Firewall ?
• Security device located between firm‟s internal network
(intranet) & external network (internet).

• Regulates access into & out of a company‟s network based


on a set of rules.

Note : needs to be upgraded from time to time to check latest


potential security problems.
Applications of Intranet
• Sharing of company policies/rules & regulations
• Access employee database
• Distribution of circulars/Office Orders
• Access product & customer data
• Sharing of information of common interest
• Launching of personal/departmental home pages
• Submission of reports
• Corporate telephone directories
Disadvantages
Extranet
What is Extranet ?
• Extranet is an Intranet for outside authorized users using same
internet technology.
• Inter-organizational information system.
• enable outsiders to work together with company‟s employees.
• open to selected suppliers, customers & other business partners
• An extension of an intranet to selected outside
business partners, such as suppliers, distributors, and
key customers
– Provide business partners with easy access to corporate
information and easy collaboration
• Security
– Critical to prevent unwanted entry into internal systems
– Virtual private networks (VPNs) are often used to add
security to Internet communication
Extranets (continued)
• Extranet configurations
– One company sets up a Extranet for its dealers,
customers, or suppliers
– Companies within an industry set up a collaborative
Extranet for mutual benefit
– Several companies collaborate over an Extranet for joint
venture
• Benefits include –
– Lower communication costs; better communication;
improved order entry and customer service;
improvement in business effectiveness
Examples..
• Dealers/distributors have access to
product files such as :-
1. product specification,
2. pictures,
3. images, etc.
to answer the queries of the customer.
Components of
extranets ..
Some basic infrastructure components such
as the internet Including :-
• TCP/IP protocols,
• E-mail,
• Web-browsers,
• External business partners &
• Tele-commuting employees place order,
check status & send E-mail.
Benefits of Extranet
• Improved quality.
• lower travel costs.
• lower administrative & other overhead costs.
• reduction in paperwork.
• delivery of accurate information on time.
• improved customer service.
• better communication.
• overall improvement in business
effectiveness.
Disadvantages
• The suppliers & customer who don‟t
have technical knowledge feel problem.
• Faceless contact.
• Information can be misused by other competitors.
• Fraud may be possible.
• Technical Employees are required.
What is Web?
• The Web (World Wide Web) consists of information
organized into Web pages containing text and graphic
images.
• It contains hypertext links, or highlighted keywords
and images that lead to related information.
• A collection of linked Web pages that has a common
theme or focus is called a Web site.
• The main page that all of the pages on a particular
Web site are organized around and link back to is
called the site‟s home page.
How to access the Internet?
• Many schools and businesses have direct
access to the Internet using special high-
speed communication lines and equipment.
• Students and employees can access through
the organization‟s local area networks
(LAN) or through their own personal
computers.
• Another way to access the Internet is
through Internet Service Provider (ISP).
How to access the Internet?
• To access the Internet, an existing network need to
pay a small registration fee and agree to certain
standards based on the TCP/IP (Transmission
Control Protocol/Internet Protocol) reference
model.
• Each organization pays for its own networks and
its own telephone bills, but those costs usually
exist independent of the internet.
• The regional Internet companies route and forward
all traffic, and the cost is still only that of a local
telephone call.
Internet Service Provider (ISP)

• A commercial organization with permanent


connection to the Internet that sells
temporary connections to subscribers.
• Examples:
• Prodigy, America Online, Microsoft
network, AT&T Networks.
How to access the Web?
• Once you have your Internet connection, then
you need special software called a browser to
access the Web.
• Web browsers are used to connect you to
remote computers, open and transfer files,
display text and images.
• Web browsers are specialized programs.
• Examples of Web browser: Netscape
Navigator (Navigator) and Internet Explorer.
Client/Server Structure of the Web

• Web is a collection of files that reside on computers,


called Web servers, that are located all over the world
and are connected to each other through the Internet.
• When you use your Internet connection to become
part of the Web, your computer becomes a Web client
in a worldwide client/server network.
• A Web browser is the software that you run on your
computer to make it work as a web client.
Hypertext Markup Language
(HTML)
• The public files on the web servers are ordinary
text files, much like the files used by word-
processing software.
• To allow Web browser software to read them,
the text must be formatted according to a
generally accepted standard.
• The standard used on the web is Hypertext
markup language (HTML).
Hypertext Markup Language (HTML)

• HTML uses codes, or tags, to tell the Web browser


software how to display the text contained in the
document.
• For example, a Web browser reading the following line of
text:
<B> A Review of the Book<I>Wind Instruments of
the 18th Century</I></B>
• recognizes the <B> and </B> tags as instructions to
display the entire line of text in bold and the <I> and </I>
tags as instructions to display the text enclosed by those
tags in italics.
Obtaining an Internet Network
Address
• IP network addresses must be unique, or the
Internet will not be stable
• The Internet Network Information Centre
(InterNIC) was originally responsible for
issuing Internet network addresses
• Today, the Internet Assigned Number
Authority (IANA) issues network addresses to
Information Service Providers (ISPs)
• ISPs split networks up into subnets and sell
them on to their customers
Domain Name System (DNS)
• IP addresses are used to identify hosts on a
TCP/IP network
• Example: 134.220.1.9
• Numbers are not „friendly‟ – people prefer names
• DNS is a protocol used to map IP addresses to
textual names
• E.g. www.wlv.ac.uk maps to 134.220.1.9
Addresses on the Web:IP Addressing
• Each computer on the internet does have a
unique identification number, called an IP
(Internet Protocol) address.
• The IP addressing system currently in use on
the Internet uses a four-part number.
• Each part of the address is a number ranging
from 0 to 255, and each part is separated from
the previous part by period,
• For example, 106.29.242.17
IP Addressing
• The combination of the four IP address parts
provides 4.2 billion possible addresses (256 x
256 x 256 x 256).
• This number seemed adequate until 1998.
• Members of various Internet task forces are
working to develop an alternate addressing
system that will accommodate the projected
growth.
• However, all of their working solutions require
extensive hardware and software changes
throughout the Internet.
Domain Name Addressing
• Most web browsers do not use the IP address t locate
Web sites and individual pages.
• They use domain name addressing.
• A domain name is a unique name associated with a
specific IP address by a program that runs on an
Internet host computer.
• This program, which coordinates the IP addresses and
domain names for all computers attached to it, is called
DNS (Domain Name System ) software.
• The host computer that runs this software is called a
domain name server.
Domain Name Addressing
• Domain names can include any number of parts separated by
periods, however most domain names currently in use have only
three or four parts.
• Domain names follow hierarchical model that you can follow
from top to bottom if you read the name from the right to the
left.
• For example, the domain name gsb.uchicago.edu is the computer
connected to the Internet at the Graduate School of Business
(gsb), which is an academic unit of the University of Chicago
(uchicago), which is an educational institution (edu).
• No other computer on the Internet has the same domain name.
Uniform Resource Locators
• The IP address and the domain name each identify a particular
computer on the Internet.
• However, they do not indicate where a Web page‟s HTML
document resides on that computer.
• To identify a Web pages exact location, Web browsers rely on
Uniform Resource Locator (URL).
• URL is a four-part addressing scheme that tells the Web
browser:
 What transfer protocol to use for transporting the file
 The domain name of the computer on which the file resides
 The pathname of the folder or directory on the computer on
which the file resides
 The name of the file
Hypertext Transfer Protocol (HTTP)

Request
The Web page
WWW server
Internet
Browser app (TCP/IP)

• HTTP is the protocol used to access resources on the


World Wide Web
• A browser application is used to send a request to the
WWW server for a resource, e.g. a web page, graphics file,
audio file, etc.
• The server responds by sending the resource (a file) to the
client and closing the connection
Parts of a Web Address
• A web address is typically composed of four parts:
• For example, the address http://www.google.ca is made
up of the following areas:
• http://
This Web server uses Hypertext Transfer Protocol (HTTP).
This is the most common protocol on the Internet.
• www
This site is on the World Wide Web.
• google
The Web server and site maintainer.
• ca
This tells us it is a site in Canada.
• Endings of web pages tells us a bit about the page. Some
common endings to web addresses are:

• com (commercial)
• edu (educational institution)
• gov (government)
• net (network)
• org (organization)

• You might also see addresses that add a country code as the
last part of the address such as:
• ca (Canada)
• uk (United Kingdom)
• fr (France)
• us (United States of America)
• au (Australia)
Uniform Resource Locator (URL)
• URL is the standard for specifying the whereabouts of a resource
(such as a web page) on the Internet
• A URL has four parts:

protocol pathname
http://www.ui.edu.ng/computerscience/index.htm

Domain name filename

http => Hypertext Transfer Protocol


File Transfer Protocol (FTP)
ftp://ftp.demon.co.uk/pub/
• Protocol for copying files between client and an FTP
server
• Uses a TCP connection for reliable transfer of files
with error-checking
• Most browsers support FTP, or you can use a
dedicated FTP client program, e.g WS_FTP
• Trivial File Transfer Protocol (TFTP) is a lightweight
version for small memory devices
Internet Email Addresses
[email protected]

Local part @ Domain name of mail server

• The Local part is the name of a special file


stored on the mail server called the user‟s
mailbox
• The Domain name is resolved using DNS
• The mail server is also known as a mail
exchanger
HTTP
• The transfer protocol is the set of rules that the
computers use to move files from one computer to
another on the Internet.
• The most common transfer protocol used on the
Internet is the Hypertext Transfer Protocol
(HTTP).
• Two other protocols that you can use on the
Internet are the File Transfer Protocol (FTP) and
the Telnet Protocol
Internet Services – Web Services
• Delivery of software components via a web
site rather than through traditional means
(disks, CDs)
• .NET – Microsoft‟s new platform for XML Web
services. Integrates web sites and programs to
deliver applications.
Internet Services – World Wide Web
• An application that uses the Internet transport
functions
• A system with universally accepted standards for
storing, retrieving, formatting, and displaying
information via a client/server architecture
• Based on HTML - standard hypertext language
used in Web
• Handles text, hypermedia, graphics, and sound
The World Wide Web (continued)
• Home Page - a text and graphical screen display; first,
introductory page in a web site
• Web Site - all the pages of a company or individual
• Hyperlinks - ways to link and navigate around the pages
on a web site
• Webmaster - the person in charge of a Web site
• Uniform Resource Locator (URL) - points to the
address of a specific resource on the Web
• Hypertext Transport Protocol (HTTP) -
communications standard used to transfer pages across the
WWW portion of the Internet
The World Wide Web (continued)
• Browsers – graphical software that enables WWW users to request
and view web documents
• Offline Browsers – software that retrieves pages from Web sites
automatically at predetermined times
• @
• Search Engines - programs that return a list of Web sites or pages
that match some user-selected criteria
• Metasearch Engines - automatically enter search queries into a
number of other search engines and return the results
• To be included in a search engine‟s database
– Web Crawlers
– Registration
How to Search the Internet
Two basic ways
1. if you know the address of the web page
(example: www.ui.edu.ng)

2. Using a search engine like Google to find


the address. This is called a keyword
search
Search the Internet
• If you don‟t know the address of the webpage, but
want to learn more about a topic or find a particular
website, you will need to do a search.

• There are several handy search engines out there


that will locate information for you. Two of the
mostly commonly used are:
www.google.com
www.yahoo.com
Search Tools
• A number of search tools have been developed and
available to you on certain Web sites that provide
search services to help you find information.
• Examples:
 Yahoo  www.yahoo.com
 Google  www.google.com
 Excite  www.excite.com
 Lycos  www.lycos.com
 AltaVista  www/alta-vista.com
 MSN WebSearch  www.search.msn.com
How to find information on the Web?
• You can find information by two basic means.
• Search by Topic and Search by keywords.
• Some search services offer both methods, others only
one.
• Most search engines offer both.
 Search by Topic
You can navigate through topic lists
 Search by keywords
You can navigate by entering a keyword or phase into
a search text box.
UNDERSTANDING PROBLEMS AND
HOW TO SOLVE THEM BY USING
COMPUTERS
INTRODUCTION TO PROBLEM SOLVING

•Introduction to Problem Solving


•Understanding problems
•Data processing
•Writing an algorithm
CONTINUE..
Tool to solve problem :
 Software development method (SDM)
 Specification of needs
 Problem analysis

 Design and algorithmic representation

 Implementation

 Testing and verification

 Documentation
CONTINUE..
 What is problem solving?
 Problem solving is the process of transforming
the description of a problem into a solution of
that problem by using our knowledge of the
problem domain and by relying on our ability to
select and use appropriate problem-solving
strategies, techniques and tools.

 Computers can be used to help us solving


problems
SOFTWARE DEVELOPMENT METHOD
1. Specification of needs/requirements
specification
2. Problem analysis
3. Design and algorithmic representation
4. Implementation
5. Testing and verification
6. Documentation
SPECIFICATION OF NEEDS
 To understand exactly:
 what the problem is
 what is needed to solve it
 what the solution should provide
 if there are constraints and special
conditions.
PROBLEM ANALYSIS
 Inthe analysis phase, we should
identify the following:
 Inputs to the problem, their form and the
input media to be used
 Outputs expected from the problem,
their form and the output media to be
used
 Special constraints or conditions (if any)
 Formulas or equations to be used
DESIGN AND ALGORITHMIC
REPRESENTATION
 An algorithm is a sequence of a finite
number of steps arranged in a specific
logical order which, when executed,
produces the solution for a problem.
 An algorithm must satisfy these
requirements:
 It must have an input
 It must have an output
 It should not be ambiguous-it must be clear
on what to do and how many to executed
(there should not be different interpretations
to it)
 Every step in algorithm must be clear as what it is
supposed to do
DESIGN AND ALGORITHMIC
REPRESENTATION CONT…
 It must be general (it can be used for different
inputs)
 It must be correct and it must solve the
problem for which it is designed
 It must execute and terminate in a finite
amount of time
 It must be efficient enough so that it can
solve the intended problem using the resource
currently available on the computer
 Analgorithm can be represented using
pseudocodes or flowcharts.
PSEUDOCODES
A pseudocode is a semiformal, English-
like language with limited vocabulary
that can be used to design and describe
algorithms.
 Criteria of a good pseudocode:
 Easy to understand, precise and clear
 Gives the correct solution in all cases
 Eventually ends
FLOWCHARTS
 Flowcharts is a graph used to depict or show a
step by step solution using symbols which
represent a task.
 The symbols used consist of geometrical shapes
that are connected by flow lines.
 It is an alternative to pseudocoding; whereas a
pseudocode description is verbal, a flowchart is
graphical in nature.
SYMBOLS

Terminal symbol - indicates the beginning and


end points of an algorithm.

Process symbol - shows an instruction other than


input, output or selection.

Input-output symbol - shows an input or an output


operation.

Disk storage I/O symbol - indicates input from or


output to disk storage.

Printer output symbol - shows hardcopy printer


output.
SYMBOLS CONT…

Selection symbol - shows a selection process


for two-way selection.

Off-page connector - provides continuation of a


logical path on another page.

On-page connector - provides continuation


of logical path at another point in the same
page.

Flow lines - indicate the logical sequence of


execution steps in the algorithm.
EXAMPLE 1:
 Write a pseudo code and a flowchart to determine
a student’s final grade and indicate whether it is
passing or failing. The final grade is calculated as
the average of four marks.
EXAMPLE 1:
Pseudocode:
 Input a set of 4 marks
 Calculate their average by summing and
dividing by 4
 if average is below 50
Print “FAIL”
else
Print “PASS”
EXAMPLE 1:
 DetailedAlgorithm
 Step 1: Input M1,M2,M3,M4
Step 2: GRADE 
(M1+M2+M3+M4)/4
Step 3: if (GRADE < 50) then
Print “FAIL”
else
Print “PASS”
endif
EXAMPLE 1: FLOWCHART

START
Step 1: Input M1,M2,M3,M4
Step 2: GRADE  (M1+M2+M3+M4)/4
Input
M1,M2,M3,M4
Step 3: if (GRADE <50) then
Print “FAIL”
else
GRADE(M1+M2+M3+M4)/4 Print “PASS”
endif
N IS Y
GRADE<5
0

PRINT PRINT
“PASS” “FAIL”

STOP
EXAMPLE 2
 Write an algorithm and draw a flowchart to
convert the length in feet to centimeter.
Pseudocode:
 Input the length in feet (Lft)
 Calculate the length in cm (Lcm) by multiplying
LFT with 30
 Print length in cm (LCM)
EXAMPLE 2
Algorithm Flowchart
 Step 1: Input Lft
START
 Step 2: Lcm  Lft x 30
 Step 3: Print Lcm Input
Lft

Lcm  Lft x 30

Print
Lcm

STOP
EXAMPLE 3
Write an algorithm and draw a
flowchart that will read the two sides
of a rectangle and calculate its area.
Pseudocode
 Input the width (W) and Length (L) of a
rectangle
 Calculate the area (A) by multiplying L
with W
 Print A
EXAMPLE 3

Algorithm START
 Step 1: Input W,L
 Step 2: AL x W Input
W, L
 Step 3: Print A
ALxW

Print
A

STOP
EXAMPLE 4
 Write an algorithm and draw a flowchart
that will calculate the roots of a quadratic
equation ax2  bx  c  0

 Hint: d = sqrt ( b2  4ac ), and the roots are:


x1 = (–b + d)/2a and x2 = (–b – d)/2a
EXAMPLE 4
Pseudocode:
 Input the coefficients (a, b, c) of the quadratic
equation
 Calculate d
 Calculate x1
 Calculate x2
 Print x1 and x2
EXAMPLE 4
START

 Algorithm:
Input
 Step 1: Input a, b, c a, b, c
 Step 2: d  sqrt ( b  b  4  a  c )
 Step 3: x1  (–b + d) / (2 x a) d  sqrt(b x b – 4 x a x c)

 Step 4: x2  (–b – d) / (2 x a) x1 (–b + d) / (2 x a)


 Step 5: Print x1, x2
X2  (–b – d) / (2 x a)

Print
x1 ,x2

STOP
CONTROL STRUCTURE
 In order to tackle a problem, we need
 a correct algorithm
 to apply the algorithm at the 'good' moment
 to decide which algorithm to apply (sometimes there are
more than one, depending on conditions)
 to know if a certain operation must be repeated

In short: we need a suitable Control Structure


 In 1966, two researchers, C. Bohn and G.
Jacopini, demonstrated that any algorithm can
be described using only 3 control structures:
sequence, selection and repetition.
SEQUENCE CONSTRUCT

 Single steps or actions


in the program logic
 Statements executed Initialize A
in the order of appear- Variables

ance, with control


passing
unconditionally from
one statement to the Increment B
next. Counter
 The program executes
Statement A followed
by Statement B.
SELECTION CONSTRUCT

A decision point in a procedure in which


the outcome of a stated condition
determines which of two actions will be
taken.

 Testsa condition and executes one of the


two alternative instruction sets based on
the results of the test.
SELECTION STRUCTURE
 The expression A>B is a logical expression
 it describes a condition we want to test
 if A>B is true (if A is greater than B)
we take the action on left
 print the value of A
 if A>B is false (if A is not greater than
B) we take the action on right
 print the value of B
SELECTION STRUCTURE

Y N
is
A>B

Print Print
A B
SELECTION CONSTRUCT
CONTINUED

IF Hours is greater than Y N


40 Hours > 40

THEN
Compute Overtime Compute Compute
©
Pay Overtime Regular
Cop
yrig
ELSE ht
2000
Compute Regular Pay by
the
ENDIF Tru
stee
s of
Indi
ITERATION CONSTRUCT
 The logic pattern in programming in which
certain actions are repeated whenever a specified
condition occurs.

 The cycle repeats until such time as the specified


condition no longer occurs

©
Cop
yrig
ht
2000
by
the
Tru
stee
s of
Indi
REPETITION/ITERATION STRUCTURE
 Specifies a block of one or more statements that
are repeatedly executed until a condition is
satisfied.
 The keyword used is while.
 Format:
while condition
loop-body Example 1: print statements “hello
world “ 2 times
end_while
Begin
set number equal to 1
while number is less than 3
print hello world
add 1 to number
end_while
end
IMPLEMENTATION
 The process of implementing an algorithm by
writing a computer program using a
programming language (for example, using
Python language)
 The output of the program must be the solution
of the intended problem
 The program must not do anything that it is not
supposed to do
 (Think of those many viruses, buffer overflows,
trojan horses, etc. that we experience almost daily. All
these result from programs doing more than they were
intended to do)
CONTINUE..
 Testing and verification
 Program verification
 Is the process of ensuring that a program meets user
requirements
o Program testing
• Is the process of executing a program to demonstrate its
correctness

 Documentation
 Document what the program do

 Should have the following elements:


 A concise requirements specifications
 Descriptions of problem inputs, expected outputs,
constraints, and applicable formula
 A psedocode/flowchart for its algorithm
 A source program listing

 Example - Comments in the program


PROBLEM SOLVING - EXAMPLE
 Consider for each of the following as
requirements specifications for a problem.
Complete the analysis and design steps of the
software development. Indicate clearly the
problem inputs, outputs, constraints and
formulas.
EXAMPLE 1
 Problem
Your summer job requires you to study some
maps that give distances in kilometers and some
that use miles. You and your coworkers prefer to
deal in metric measurements.
 Analysis
 Convert one system to another (convert miles to
kilometers)
 Problem input – distance in miles
 Problem output – distance in kilometers
 Relevant formula to convert miles to km
 1 mile = 1.609km
CONTINUE..
 Design
 Algorithm
 Get the distance in miles
 Convert the distance to kilometers

 Display the distance in kilometers


EXAMPLE 2
 Problem
You need to create a converter that can convert the
temperature from degrees Fahrenheit to degrees
Celsius.
 Analysis
 Convert temperature from Fahrenheit to Celsius
 Program input – temperature in Fahrenheit
 Program output – temperature in Celsius
 Relevant formula – Celsius =5/9 (Fahrenheit – 32)
 Design
 Algorithm
 Get the input in Fahrenheit
 Convert the temperature to Celsius
 Display the temperature in Celsius
EXERCISE 1-SEQUENCE STRUCTURE
 Problem
Get the radius of a circle. Compute and display
the circle’s area and circumference.
PI=3.14159

Do the rest :
EXERCISE 2 – SEQUENCE STRUCTURE
 Problem
An employee earns N 500.00 per hour for the
first 40 hours and N800.00 per hour for each
hour over 40. Design a program to calculate the
daily wage of this employee
EXERCISE 3 – REPETITION STRUCTURE
 Problem
Design a program that can print the statement “ I
love programming “ 5 times.
EXERCISE 4-SEQUENCE AND REPETITION
 Problem
Design a program that reads 5 numbers and
computes and outputs their arithmetic average.

You might also like