module1 introduction to computer and programming

23
1 2 nd Semester 2004 Module1 Module1 Introduction to Introduction to Computer and Programming Computer and Programming ออออออออ อออออออออออ Aphirak Jansang [email protected] http://www.cpe.ku.ac.th/~aphirak Computer Engineering Department Kasetsart University, Bangkok THAILAND

Upload: reuben-bishop

Post on 30-Dec-2015

27 views

Category:

Documents


1 download

DESCRIPTION

Module1 Introduction to Computer and Programming. อภิรักษ์ จันทร์สร้าง Aphirak Jansang [email protected] http://www.cpe.ku.ac.th/~aphirak Computer Engineering Department Kasetsart University, Bangkok THAILAND. Outline. Introduction to Computer How to run program? Programming Languages. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Module1 Introduction to  Computer and Programming

1

2nd Semester 2004

Module1Module1Introduction to Introduction to

Computer and ProgrammingComputer and Programming

อภิ�รั�กษ์� จั�นทรั�สรั�างAphirak Jansang

[email protected]://www.cpe.ku.ac.th/~aphirak

Computer Engineering DepartmentKasetsart University, Bangkok THAILAND

Page 2: Module1 Introduction to  Computer and Programming

2

1st Semester 2005

Outline

Introduction to Computer How to run program? Programming Languages

Page 3: Module1 Introduction to  Computer and Programming

3

1st Semester 2005

Do you know?

How many computers in THAILANDTHAILAND?

*http://www.nso.go.th/eng/indicators/core_e.htm*http://www.nso.go.th/eng/indicators/core_e.htm

1998 1999 2000 2001 2002

Page 4: Module1 Introduction to  Computer and Programming

4

1st Semester 2005

How can we classify computers?

Personal Computer Desktop Computer Notebook PDA – Personal Digital Assistant

Supercomputer Mainframe High Computation Power

Page 5: Module1 Introduction to  Computer and Programming

5

1st Semester 2005

Computer Components

Input Devices Output Devices Computing & Processing Unit

Page 6: Module1 Introduction to  Computer and Programming

6

1st Semester 2005

CPU

MainMemory

Input Devices

HD

Secondary Memory

Output Devices

Computer Components

Page 7: Module1 Introduction to  Computer and Programming

7

1st Semester 2005

Computer Memory

1.Main Memory 2.Secondary Memory

Page 8: Module1 Introduction to  Computer and Programming

8

1st Semester 2005

1. Main Memory

Can be devided into 2 Categories RAM (Random Access Memory) ROM (Read Only Memory)

Memory Cell -> Byte -> Bit 1 Byte = 8 bits

Page 9: Module1 Introduction to  Computer and Programming

9

1st Semester 2005

2. Secondary Memory

Floppy disk Hard disk CDROM DVDROMEtc…

1 Kbyte = 210 = 1024 bytes1 Mbyte = 220 = 1,048,576 bytes

1 Gbyte = 230 = 1,073,741,824 bytes

Page 10: Module1 Introduction to  Computer and Programming

10

1st Semester 2005

Main Memory VS Secondary Memory

Main MemoryMuch fasterMore

expensiveVolatile

Secondary MemorySlowerLess expensivePermanent

Page 11: Module1 Introduction to  Computer and Programming

11

1st Semester 2005

Do you know ASIMO?

*http://world.honda.com/ASIMO/*http://world.honda.com/ASIMO/

Page 12: Module1 Introduction to  Computer and Programming

12

1st Semester 2005

Outline

Introduction to Computer How to run program? Programming Languages Introduction to Pascal Language

Page 13: Module1 Introduction to  Computer and Programming

13

1st Semester 2005

How to run program? After boot Process

May be Windows XP (Operating System: OS) has been loaded into Main Memory

User tell OS to load program P1 OS Load program P1 from Secondary

Memory into Main Memory OS run program from Main Memory

Page 14: Module1 Introduction to  Computer and Programming

14

1st Semester 2005

Outline

Introduction to Computer How to run program? Programming Languages

Page 15: Module1 Introduction to  Computer and Programming

15

1st Semester 2005

Programming Languages

Machine Language Assembly Language High-Level Language

Page 16: Module1 Introduction to  Computer and Programming

16

1st Semester 2005

High-level VS Assembly VS Machine Language

High-level LanguageSUM := A * 2 + ALPHA/3;

Assembly LanguageMULL3 A, #2, R6

DIVL3 #3, ALPHA, R7ADDL3 R6, R7, SUM

Machine Language0001100001100011001111 10011000111

Page 17: Module1 Introduction to  Computer and Programming

17

1st Semester 2005

High-Level Languages

Procedural Language Fortran Cobol Basic C Pascal

Object-Oriented Language C++ Java C#C#

Functional Language Lisp

Logic Language Prolog

Page 18: Module1 Introduction to  Computer and Programming

18

1st Semester 2005

How to execute program from non-machine language?

Interpretation Method Translation Method

Page 19: Module1 Introduction to  Computer and Programming

19

1st Semester 2005

Interpretation Method Process

InterpreterInterpreter(on computer)(on computer)

OutputSource ProgramSource ProgramSource Program

Input

Page 20: Module1 Introduction to  Computer and Programming

20

1st Semester 2005

Translation Method Process

TranslatorTranslator(on computer)(on computer)

File *.exe

Source ProgramSource ProgramSource Program

Input

Page 21: Module1 Introduction to  Computer and Programming

21

1st Semester 2005

Translators

Assembler (assembly) Compiler (High-level language)

Page 22: Module1 Introduction to  Computer and Programming

22

1st Semester 2005

Quiz1 Quiz1

What will happen What will happen to you when to you when

our world have our world have no computers?no computers?

Page 23: Module1 Introduction to  Computer and Programming

23

1st Semester 2005

Summary

Computer Basic Programming Language

Interpreter Method Translator Method