Download Overview - Computing Science

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Falcon (programming language) wikipedia , lookup

Functional programming wikipedia , lookup

Computer cluster wikipedia , lookup

Programming language wikipedia , lookup

Stream processing wikipedia , lookup

Object-oriented programming wikipedia , lookup

Supercomputer architecture wikipedia , lookup

Assembly language wikipedia , lookup

Go (programming language) wikipedia , lookup

Abstraction (computer science) wikipedia , lookup

ILLIAC IV wikipedia , lookup

Reactive programming wikipedia , lookup

Structured programming wikipedia , lookup

Parallel computing wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

Transcript
Introduction and Overview
Winter 2013
COMP 2130 Introduction to Computer
Systems
Computing Science
Thompson Rivers University


Instructor:
Office hour:
Dr. Mahnhoon Lee @ HL 424
11:30-12:20 @ Mon, Tue, Wed, Fri
and by appointment
[email protected]
http://cs.tru.ca/~mlee/comp2130/

E-mail:
Course web page:

Prerequisites for this course:




COMP 1230 with minimum ‘C’, and
COMP 1380 with minimum ‘C’
This course is a prerequisite for


COMP 3270 Computer Networks
COMP 3410 Operating Systems
TRU-COMP2130
Introduction
2
Rise of Questions




What is a computer system?
What is an operating system?
Which [programming] language is most powerful?
What are the benefits to take this course “Introduction to Computer
Systems”?



Most universities teach assembly languages, computer architecture and
hardware components.
You are in a computing science program, and computing science is not
much about the development of hardware components.
Then what?
TRU-COMP2130
Introduction
3
Objectives






Understand the fundamentals of computer architecture
Experience programming through the powerful C programming
language (using GCC - GNU compiler), probably a new programming
language to you
Experience programming through IA32 assembly language, another
new programming language to you
Experience reliable programming through the understanding of
critical relationship between programming and computer architecture
Experience efficient programming through code optimization
Why is one programming language, e.g., Java, not enough in
computing science?
TRU-COMP2130
Introduction
4
Course Contents

C programming language







Assembly language
Introduction to computer systems






Bit and Boolean operations
Use of pointers
Use of struct data structure
Dynamic memory management
...
The fundamentals of computer architecture
How does a computer system work?
How is computer architecture related to programming?
Code optimization
...
Use of Linux
TRU-COMP2130
Introduction
5
Lecture










Introduction to computer systems
Introduction to C programming language
Data representations
C: advanced topics
Introduction to assembly language – IA32 (Intel Architecture 32)
Compiling, linking, loading, and executing
Dynamic memory management
Code optimization
Memory hierarchy, locality, caching
Virtual memory (if time permits)
TRU-COMP2130
Introduction
6

The better knowledge of computer systems, the better programing.
Computer System
C Programming Language
Computer architecture
CPU (Central Processing Unit)
IA32 assembly language
Introduction to C language
Physical main memory
MMU (Memory Management Unit)
Virtual memory space
Memory hierarchy
Cache
Dynamic memory management
Compiling, linking, loading,
executing
Better coding – locality
Reliable programming; Efficient programming (code optimization)
TRU-COMP2130
Introduction
7
Seminar




Use of Linux
C programming exercises
Exercise questions about computer architecture and programming
Explanation of assignments
TRU-COMP2130
Introduction
8
Textbooks


Bryant and O’Hallaron, Computer Systems: A Programmer’s
Perspective, 2/E, Prentice Hall, 2011
ISBN 10: 0-13-610804-0
Kernighan and Ritchie, The C Programming Language, Prentice Hall,
1988, ISBN 10: 0-13-110362-8
TRU-COMP2130
Introduction
9
Evaluation

Quizzes
Programming Assignments
Programming Exam
Final test

In order to pass the course, students must achieve







25%
10%
25%
40%
minimum of 50% on overall quizzes,
minimum of 50% on the programming exam,
minimum of 50% on overall programming assignments, and
minimum of 50% on the final written exam
TRU-COMP2130
Introduction
10
Questions?



Anything that you want to know more?
Any comment?
Any question?
TRU-COMP2130
Introduction
11
Something Additional

Research opportunity

Web data mining


Computational intelligence



Examples: Summly on iPhones, SiteSeer
How to handle categorical data?
Participation opportunity is open.
ACM International Collegiate Programming Contest (ICPC) ?




Regional contest in Pacific Northwest
Registration: September
Competition date: early November this year at SFU
I am currently recruiting students who are good at Java programming and
completed COMP 2230.
TRU-COMP2130
Introduction
12
Loosing Habits and Winning Habits

Loosing habits?
Winning habits?

What kind of habits do you have?

TRU-COMP2130
Overview
13
Overview – Why C?

Why C?




Pros and cons





Most system programs are written in C, not even C++, for fast execution.
The kernels of most operating systems are written in C.
A lot of projects use C.
Fast execution
-\
Easy memory management
- > Good for system programming
Bit operation
-/
But a bit complex concepts of pointer, type conversion and memory
allocation
How is C different from Java?
TRU-COMP2130
Overview
14

General purpose programming language popularity index


From lang-index.sourceforge.net
Published at March 2012
Java
C
Objective-C
Basic
C++
C#
Delphi
D
Pascal
Ada
Fortran
Go
Haskell
Erlang
Smalltalk
ML
Forth
Scala
Eiffel
Caml/F#
0.00%
TRU-COMP2130
5.00%
10.00%
15.00%
Overview
20.00%
25.00%
30.00%
15

Programming language populatiry


From langpop.com
Published at April 13, 2011
TRU-COMP2130
Overview
16

How is C different from Java?
C
Java
Procedural
No class
Common data: global variables
Abstract data type: struct, union
Object oriented
Class
Common data: instance variables
Abstract data type: class
Micro approach
Individual utility libraries
Macro approach
Utilities include language itself
Reference type variable
No reference, but objects include the
concept
Call by value; call by reference
Call by value; call by reference for
objects
Compiling
One file at a time, and linking
Compiling
Cross-reference
TRU-COMP2130
Overview
17
Overview – How a Computer Works

How does a computer system look like?

Model from the view of functions: von Neumann architecture
Similar to



What happens when you turn on a computer system?
Can a computer system understand a program written in C or Java?
How does a program run in a computer system?
TRU-COMP2130
Overview
18
Overview – How a Computer Works

What happens when you turn on a computer?



Power on, then?
-> Electric signal
-> CPU will start executing instructions from a particularly fixed address.




BIOS
MBR
OS
CPU reads one instruction from memory at a time and executes the
instruction. This cycle, called instruction cycle, repeats forever.


Fetch and
Execution
TRU-COMP2130
Overview
19
Overview – How a Computer Works


Can a computer understand a program written in C or Java?
How does a program run in a computer?




A program is a collection of data and codes.
Compile and link
Load and execute
Multi-programming?
TRU-COMP2130
Overview
20
Overview – How a Computer Works

What hardware components do we need to run programs in a computer
system?

Four major components:



CPU
Main memory
I/O devices





TRU-COMP2130
Keyboard
Mouse
Monitor
Hard disk
System buses
Overview
21
Overview – How a Computer Works




User programs write data into the main memory and read data from
the main memory. It is very important to protect OS codes and data
stored in the main memory from user programs.
What does this mean?
Why is this very important for Operating Systems?
How to protect?

By using hardware supports and interrupts

The architectures of computer systems have very close relations with
OSes and programs.

We will study

CPU, main memory, interrupts, instructions, and ...
TRU-COMP2130
Overview
22