lebanese university faculty of sciences computer science bs … · 2019-11-06 · lebanese...
TRANSCRIPT
I1100Introduction to Computer Science
Semester: 1 Academic Year: 2015/2016
Credits: 3 (30 hours)Dr. Antoun Yaacoub
Lebanese UniversityFaculty of Sciences
Computer Science BS Degree
I1100- Introduction to Computer ScienceSchedule
Monday Tuesday Wednesday Thursday Friday
08h00-09h40 I1100
09h50-11h30
11h50-13h30 I11001 week over 2
14h00-15h40
2
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
I1100- Introduction to Computer ScienceGrading
Mid-term exam 30 pts
Final Exam 70 pts
Total 100 pts
3
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
Dr. Antoun Yaacoub
4
Office 3rd floorDean’s Office
Office 304
Email [email protected]
Web site www.antoun.mewww.fsciences.ul.edu.lb/antoun.yaacoub
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
Aim• Introducing fundamental topics in Informatics
• Developing a basic understanding of Information Theory
• Emphasizing its use in the modeling of nature and technology
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
5
Syllabus1. Introduction to Computer Science
2. Computer architecture
3. Operating system
4. Software
5. Databases
6. Introduction to networks
7. Internet
8. Computer Science and Society
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
6
Introduction to Computer Science1 lecture
7
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
Introduction to Computer ScienceOutline of this lecture1. Definitions
a. Turing Model
b. Von Neumann Model
2. Computer Components
a. Hardware
b. Data
c. Software
3. History
a. Mechanical Machines (before 1930)
b. The birth of electronic computers (1930-1950)
c. Computer Generations (1950-present)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
8
Definitions• Computer Science = Computing Science = Informatics
• Informatics = information + automatic
• Informatics = automation of information treatment by a system
• Computer = Computational device
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
9
Example of a computational device• Show the steps that your perform if you want
the result of the sum between 2 and 3.
• Press on 2 (input the data 2)
• Press on + (compute the sum operation)
• Press on 3 (input the data 3)
• Press on = (output the final result)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
10
Data Processor• Computer = Data processor ?
• Computer acts as a black box that1. accepts input data,
2. process the data
3. and creates output data.
• This model is too general, in the sense that a pocket calculator becomes also a computer !
• What if we need to compute 6 ∗ 𝑒5 − (20! +𝜋
4) ?
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
11
ComputerInput data Output data
Turing Model Universal computational device introduced by Alain
Turing in 1937.
The Turing model is a better model for a general-purpose model.
It adds an extra element: the program
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
12
Turing Model
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
13
PROGRAM
a sequence of instructions that
tells the computer what to do with
data
Turing Model• In the Turing model, the output data depends on the combination of two
factors: the input data and the program.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
14
ComputerInput data Output data
Program
Turing Model
• With the same input data, we can generate different outputs if we change the program.
• With the same program, we can generate different outputs if we change the input data.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
15
ComputerInput data Output data
Program
Examples
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
16
Computer3, 12, 8, 22Input data
3, 8, 12, 22Output data
SortProgram
Computer14, 6, 8, 12Input data
6, 8, 12, 14Output data
SortProgram
Examples
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
17
Computer3, 12, 8, 22Input data
3, 8, 12, 22Output data
SortProgram
Computer3, 12, 8, 22Input data
45Output data
AddProgram
Computer3, 12, 8, 22Input data
3Output data
Find SmallestProgram
Turing Model• Universal Turing Machine = machine that can do any
computation if the appropriate program is provided
• Universal Turing Machine = capable of computing anything that is computable
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
18
Von Neumann Model
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
19
Input data Output data
Program
• John Von Neumann proposed that programs should also be stored in the memory of a computer.
Computer
Four Subsystems• Computers built on the Von Neumann model divide the computer hardware
into four subsystems:
Memory
Arithmetic logic unit
Control unit
Input/output
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
20
Computer
Inputdata
Outputdata
Input/output
Memory
Arithmetic Logic Unit (ALU)
Control Unit
Four SubsystemsMemory
• Memory is the storage area.
• This is where programs and data are stored during processing.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
21
Four SubsystemsArithmetic Logic Unit (ALU)
• ALU is where calculation operation take place.
• For a computer to act as a data processor, it must be able to do:
a. Arithmetic operations on data
b. Logical operations on data
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
22
Four SubsystemsControl Unit
• The control unit controls the operations of the
memory,
ALU,
and the input/output subsystem.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
23
Four SubsystemsInput / Output
• The input subsystem accepts input data from outside the computer.
• The output subsystem sends the results of processing to the outside world.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
24
Programs in Von Neumann Model
• A program is made of a finite number of instructions.
• Instructions are executed one after another.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
25
Computer Components• A computer is made up of three components:
a. Computer hardware
b. Data
c. Computer software
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
26
Computer ComponentsHardware
• Computer hardware has 4 basic components under the Von Neumann model.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
27
Computer ComponentsData
• Different types of data:
numbers,
text,
image,
video,
audio
…
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
28
Computer ComponentsSoftware
• Programs are stored in the computer’s memory.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
29
Program
Data
Memory
Computer ComponentsSoftware
• Programs consist of a sequence of instructions.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
30
Program
1. Input the first number into memory
2. Input the second number into memory
3.Add the two together and store the result in memory
4.Output the result
Computer ComponentsSoftware• A program must be composed of instructions for
reusability.
• A programmer can combine instructions to make any number of programs.
• Each program can be a different combination of different instructions.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
31
Computer ComponentsAlgorithms• A programmer must learn how to combine instructions to
do a particular task.
• A programmer must first solve the problem in a step-by-step manner, then try to find the appropriate instruction (or series of instructions) to implement those steps.
• Step-by-step solution = Algorithm
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
32
Computer History Timeline
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
33
Mechanical Machines
(before 1930)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
34
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
352400 BC Abacus
• One of the world’s oldest computing device.
• The device uses beads attached to wires in a frame to represent units, tens and thousands.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
361642 Pascaline
• Blaise Pascale invents the “Pascaline”, a mechanical adding machine
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
371671 Leibnitz Wheel
• Gottfried Leibnitz invented a more sophisticated mechanical calculator that could do multiplication and division as well as addition and substraction.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
381801 Jacquard loom
• The first machine that used the idea of storage and programming.
• Uses punched cards like a stored program.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
391823 First Mechanical Computer
• Charles Babbage invented the Difference Engine, which can do more than simple arithmetic operations.
• It could solve polynomial equations.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
401837 Analytical Engine
• Charles Babbage invented the Analytical Engine.
• 4 components: a mill (modern ALU), a store (memory), an operator (control unit), and output (input/output)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
411890 First Counting Machine
• Herman Hollerith built a programmable machine that could automatically read, count and sort data
Birth of electronic computers
(1930-1950)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
42
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
43
•Early computers in this period did not store the program in memory.
•Five computers were prominent during these years
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
441938 Z1
• Konrad Zusedesigned a general purpose machine using punch tape
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
451939 ABC
• Called ABC (Atanasoff Berry Computer)
• Designed to solve a system of linear equations
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
461943 Colossus
• Invented by Alan Turing
• Designed to break the German Enigma code
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
471944 Mark 1
• Huge computer sponsored by US Navy and IBM at Harvard University.
• Uses both electrical and mechanical components.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
481946 ENIAC
• First totally electronic computer.
• Called ENIAC (Electronic Numerical Integrator And Calculator).
• Weighted 30 tons
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
491950 EDVAC
• First computer based on Von Neumann’s model.
• Called EDVAC (Electronic Discrete Variable Automatic Computer).
Computer recent 5 generations
(1950-present)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
50
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
51
•Computers follow the Von Neumann model.
•Become faster, smaller and cheaper.
•5 generations with each witnessing major changes in hardware or software.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
521950 – 1959 First Generation
• Emergence of commercial computers.
• Used by professionals.
• Affordable only by big companies.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
531959 – 1965 Second Generation
• Size and cost reduced
• Affordable for small organizations
• FORTRAN and COBOL (programming languages) invented and made programming easier.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
541965 – 1975 Third Generation
• Invention of integrated circuit (transistors, wiring and other components on a single chip).
• Minicomputers appeared on the market.
• Software packages became available.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
551975 – 1985 Fourth Generation
• Microcomputers appeared on the market.
• Computer networks appeared.
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
56From 1985 Fifth Generation
• Appearance of laptops, pads, palmtop computers.
• Improvements in storage media: CD-ROM, DVD, …
• Usage of multimedia
• Virtual reality
Application Domain
• Finance (stock exchange, banks, ...)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
57
Application Domain
• Production (robotics, management, ...)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
58
Application Domain
• Science (weather forecast, geography, physics, mathematics, medicine, pharmacy, genetics,… )
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
59
Application Domain
• Network Supervision (electricity, oil, transport, ...)
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
60
Application Domain
• Avionics, Automotive, …
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
61
References• Foundations of Computer Science
Behrouz A. Forouzan, Firouz Mosharraf
• http://wallblog.co.uk/files/2012/06/History-of-Computers.jpg
• http://www.datesandevents.org/events-timelines/07-computer-history-timeline.htm
Intr
oduc
tion
to
Com
pute
r Sc
ienc
e (I
1100
) 20
15-2
016
62