Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

CS310

Foundations of Computer Science

Ngo Lam Trung


Dept. of Computer Engineering

NLT, SoICT, 2018


Course administration
❑ Instructor: Ngo Lam Trung
505 B1, SoICT, HUST
❑ Text: See syllabus
❑ Email: trungnl@soict.hust.edu.vn
❑ Slides: pdf
❑ Schedule: as in timetable

NLT, SoICT, 2018


Grading information
❑ Grading criteria
Attendance/Attitude 10%
Group presentation 20%
Mid-term exam 30%
Final exam 40%

❑ CoC
No music/video/surfing in class
No copy ‘n paste from unreferenced sources

NLT, SoICT, 2018


Course content
❑ Chapter 1: Introduction
❑ Chapter 2: Algorithmic Foundations of Computer Science
❑ Chapter 3: System Software and Virtual Machines
❑ Chapter 4: High-Level Language Programming
❑ Chapter 5: The Building Blocks: Binary Numbers,
Boolean Logic, and Gates
❑ Chapter 6: Computer Systems Organization

NLT, SoICT, 2018


Chapter 1: Introduction

NLT, SoICT, 2018


Why this course?
❑ What are the four industrial revolution?
❑ What are the enablers of each revolution?

NLT, SoICT, 2018


What is computer science?
❑ Computer science is the study of computers.
❑ Computer science is the study of how to write computer
programs.
❑ Computer science is the study of the uses and
applications of computers and software.

➔No, these are all misconception!

NLT, SoICT, 2018


What is computer science?
❑ Computer science is the study of computers.
Computer is the tool, but computer science is not about tools.

❑ Computer science is the study of how to write computer


programs.
Computer program is important, but it is only a part of the big
picture. A good program can only be achieved with a good
algorithm, given a correct input, and produce expected output.
Program is a means, not the end of the problem.

❑ Computer science is the study of the uses and


applications of computers and software.
This is not the job of computer scientist. Computer scientist is
responsible for specifying, designing, building, and testing
software packages as well as computer systems.

NLT, SoICT, 2018


So, what is CS?
❑ The Gibbs and Tucker definition:
Computer science the study of algorithms, including
1. Their formal and mathematical properties
2. Their hardware realizations
3. Their linguistic realizations
4. Their applications

Gibbs, N. E., and Tucker, A. B. “A Model Curriculum for a Liberal Arts Degree in
Computer Science,” Comm. of the ACM, vol. 29, no. 3 (March 1986).

NLT, SoICT, 2018


More detailed explanation
❑ Studying the behavior of algorithms to determine if they
are correct and efficient (their formal and mathematical
properties)
❑ Designing and building computer systems that are able
to execute algorithms (their hardware realizations)
❑ Designing programming languages and translating
algorithms into these languages so that they can be
executed by the hardware (their linguistic realizations)
❑ Identifying important problems and designing correct and
efficient software packages to solve these problems
(their applications)

NLT, SoICT, 2018


The center of CS: Algorithm
❑ A procedure for solving a mathematical problem in a
finite number of steps that frequently involves repetition
of an operation; broadly: a step-by-step method for
accomplishing some task.
❑ Common understanding: an algorithm is an ordered
sequence of instructions that is guaranteed to solve a
specific problem.
❑ Example:
How to solve 2nd degree equation
How to turn on your TV and tune to VTV3
Euclid algorithm to find GCD of two integers

NLT, SoICT, 2018


Representation of algorithm
❑ Most basic form

STEP 1: Do something STEP 1: Press the On/Off button


STEP 2: Do something STEP 2: Wait until the TV switch on
STEP 3: Do something STEP 3: Press the button “3”
..
..
..
STEP N: Stop, you are finished

NLT, SoICT, 2018


Is this an algorithm?

NLT, SoICT, 2018


Operations in algorithm
❑ All algorithm can be divided into basic operations
including
Sequential operation
Conditional operation
Iterative operation

NLT, SoICT, 2018


3 types of operation
❑ Sequential operations: A sequential instruction carries
out a single well-defined task. When that task is finished,
the algorithm moves on to the next operation.
❑ Conditional operations: These are the “question-asking”
instructions of an algorithm. They ask a question, and the
next operation is selected on the basis of the answer to
that question.
❑ Iterative operations: These are the “looping” instructions
of an algorithm. They tell us not to go on to the next
instruction but, instead, to go back and repeat the
execution of a previous block of instructions.

NLT, SoICT, 2018


Example

NLT, SoICT, 2018


Formal algorithm
❑ The previous algorithm
Depends on only specific computer?
Run on only some specific language?
Applicable to some predefined input?

→formal algorithm
❑ Why formal algorithm looks so complicated?
❑ Why it is important?
❑ If we can specify an algorithm to solve a problem, then
we can automate its solution.

NLT, SoICT, 2018


Unsolvable problems
❑ Can computer solve all our problems?
❑ What are unsolvable problems?
Problem that does not have algorithm (yet)
Problem with algorithm that takes unacceptable long time to
complete

NLT, SoICT, 2018


Formal definition of algorithm
❑ Algorithm is a well-ordered collection of unambiguous
and effectively computable operations that, when
executed, produces a result and halts in a finite
amount of time.
Well-ordered: the order of operation is clear
Unambiguous: there must be only one understanding
Effectively computable: do-able
Produce a result: a result (not answer) must be presented
Finite amount: algorithm must finish after some acceptable time

NLT, SoICT, 2018


A brief history of computing
❑ Pre-1940s: mechanical calculators (Pascalite, Leibnitz’s
Wheel)

NLT, SoICT, 2018


❑ Babbage Analytic Engine

NLT, SoICT, 2018


The Birth of Computers: 1940–1950
❑ ENIAC (1946)

NLT, SoICT, 2018


ENIAC
❑ Hugh computer
❑ Contained 18,000 vacuum tubes, 100 feet long, 10 feet
high, and weighed 30 tons.
❑ Add two 10-digit numbers in about 1/5,000 of a second
❑ Multiply two numbers in 1/300 of a second

❑ Reprogram = reset 6000 switches


➔ A better architecture is required

NLT, SoICT, 2018


Von Neumann architecture
❑ Instruction is encoded as binary number
❑ Program is constructed from instruction
❑ Program is stored in memory together with data

NLT, SoICT, 2018


The modern era: 1950 - now

Generation Processor Memory I/O devices Dominant


(begun) technology innovations introduced look & fell
1 (1950s) Vacuum tube Magnetic Paper tape, Hall-size
drum magnetic tape cabinet
2 (1960s) Transistor Magnetic Drum, printer, Room-size
core text terminal mainframe
3 (1970s) SSI/MSI RAM/ROM Disk, keyboard, Desk-size
chip video monitor mini
4 (1980s) LSI/VLSI SRAM/DRAM Network, CD, Desktop/
mouse,sound laptop micro
5 (1990s) ULSI/GSI/ SDRAM, Sensor/actuator, Invisible,
WSI, SOC flash point/click embedded

[Ref. 2]

NLT, SoICT, 2018


Key to computer evolution: IC making technology

❑ Electronics technology continues to evolve


Increased capacity and performance
Reduced cost

Year Technology Relative performance/cost


1951 Vacuum tube 1
1965 Transistor 35
1975 Integrated circuit (IC) 900
1995 Very large scale IC (VLSI) 2,400,000
2005 Ultra large scale IC 6,200,000,000

[Hennesy & Patterson]


NLT, SoICT, 2018
IC making
Blank wafer
30-60 cm Patterned wafer
with defects
Processing:
Silicon Slicer x x 20-30 steps
crystal x x x
15-30 x x
ingot cm x x
x x

(100s of simple or scores


0.2 cm of complex processors)

Microchip
Good
Die or other part Part
Die die
Dicer tester Mounting tester
Usable
part
to ship
~1 cm ~1 cm

The manufacturing process for an IC part

NLT, SoICT, 2018


Video: How an IC is made

NLT, SoICT, 2018


Organization of this course

NLT, SoICT, 2018


Exercise

NLT, SoICT, 2018

You might also like