Download presentation
Presentation is loading. Please wait.
Published byValentine Elliott Modified over 9 years ago
2
1 204111 Computers and Programming ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem http://www.cpe.ku.ac.th/~anan anan@cpe.ku.ac.th
3
2 Outline Intro to computer Computer components How can we load and run program? Programming languages Problem solving and programming Programming strategy
4
3 Categories of Computers Microcomputer Personal Computer, Desktop computer Notebook, Laptop, Palmtop Use by one person at a time Minicomputer Faster speed Many users at the same time Mainframe -> Supercomputer High computation power
5
4 Categories of Computers Workstation CAD Workstation Unix Workstation Server Client /Server (Networks)
6
5 Computer Components
7
6 CPU Main Memory HD Computer Components Secondary Memory Input Devices Output Devices
8
7 Computer Memory 1. Main Memory 2. Secondary Memory
9
8 1. Main Memory Store information 100 -34.9 A 23 W 000 001 002 003... 999 Memory Cell Memory Address
10
9 1. Main Memory Memory Cell Byte Bit 1 Byte = 8 bits Can be divided into 2 Categories RAM (Random Access Memory) ROM (Read Only Memory)
11
10 2. Secondary Memory (Storage) Floppy disk Hard disk CD-ROM Tape Information called “ file ” (data file, output file, program file) 1 Kbyte = 2 10 = 1024 bytes 1 Mbyte = 2 20 = 1,048,576 bytes 1 Gbyte = 2 30 = 1,073,741,824 bytes
12
11 Main VS. Secondary Memory Main Memory Much faster More expensive Volatile (RAM) Secondary Memory Slower Less expensive Permanent
13
12 CPU Main Memory HD Computer Components Secondary Memory Input Devices Output Devices
14
13 Central Processor Unit (CPU) Retrieve information from memory Calculate Put back results to memory Intel / AMD (Pentium / Athlon)
15
14 How can we load and run program? Boot process Load OS into Memory Tell user to load and run Program “ p1 ” User start using program HW OS Secondary Storage p1 USER
16
15 Programming Language Machine Language Assembly Language High-Level Language CPU can execute only the machine language
17
16 How can a non-machine language program be executed? 2 methods Interpretation Translation
18
17 The interpretation Process Source Program Input Data Interpreter (on computer) Output
19
18 Translation Process Translation Phase Link Phase Execute Phase Source Program Translator Object Program Library Linker Execute Program Output CPUInput Data
20
19 Translators Assembler (assembly) Compiler (High-level language)
21
20 High-Level Languages Procedural Language Fortran Cobol Basic C Pascal Object-Oriented Language C++ Functional Language Lisp Logic Language Prolog
22
21 Problem Solving and Programming Solve Problems Combine art and science Art Transform a description (word to equation) Difficult (problem is not clear, input, output) Science Knowledge of problems Equation and formula
23
22 Programming Strategy Don ’ t rush to key in the computer Think carefully about the problem Try to solve by hand Plan your program Test by hand if possible Start programming Program Compilation Testing / Debug Documentation Maintenance
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.