![Page 1: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/1.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 1
Introduction To Computers
Lecture 1
byJumail Bin Taliba
Faculty of Computer Science & Information System
![Page 2: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/2.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 2
Today’s Topics
•Computer Systems•Computing Environments•Computer Languages•System Development
![Page 3: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/3.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 3
Figure 1-1: A computer system
![Page 4: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/4.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 4
Figure 1-2: Basic hardware components
![Page 5: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/5.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 5
Computer Hardwares– Five main components
• Input devices– Allows communication to the computer
• Output devices– Allows communication to the user
• Processor (CPU)
• Main memory (primary storage)– Memory locations containing the running program
• Secondary memory (auxiliary storage)– Permanent record of data often on a disk
![Page 6: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/6.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 6
Computer Memory
• Main Memory– Long list of memory locations
• Each contains zeros and ones• Can change during program execution
– Binary Digit or Bit• A digit that can only be zero or one
– Byte• Each memory location has eight bits
– Address • Number that identifies a memory location
![Page 7: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/7.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 7
![Page 8: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/8.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 8
Larger Data Items
• Some data is too large for a single byte– Most integers and real numbers are too large
– Address refers to the first byte
– Next few consecutive bytes can store the additionalbits for larger data
![Page 9: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/9.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 9
Data or Code?
• ‘A’ may look like 01000001• 65 may look like 01000001• An instruction may look like 01000001
• How does the computer know the meaningof 01000001?– Interpretation depends on the current instruction
![Page 10: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/10.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 10
Secondary Memory
• Main memory stores instructions and data while a program is running.
• Secondary memory– Stores instructions and data permanently– A file stores data or instructions in
secondary memory
![Page 11: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/11.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 11
Secondary Memory Media
• A computer might have any of thesetypes of secondary memory– Hard disk
• Fast• Fixed in the computer and not normally removed
– Floppy disk• Slow• Easily shared with other computers
– Compact disk• Slower than hard disks• Easily shared with other computers• Can be read only or re-writable
![Page 12: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/12.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 12
The Processor
• Typically called the CPU– Central Processing Unit– Follows program instructions – Typical capabilities of CPU include:
addsubtractmultiplydividemove data from location to location
![Page 13: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/13.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 13
Figure 1-3: Types of software
![Page 14: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/14.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 14
Figure 1-4: Software
![Page 15: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/15.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 15
Figure 1-5: Personal computing environment
![Page 16: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/16.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 16
Figure 1-6: Time-sharing Environment
![Page 17: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/17.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 17
Figure 1-7: Client-server environment
![Page 18: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/18.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 18
Figure 1-8: Types of computer languages
![Page 19: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/19.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 19
Machine Language: the only language understood by a computer
LUAS = PANJANG * LEBAR IF LUAS > 50
GOTO BESAR ELSE
GOTO KECIL
0101 1000 0001 00000101 1011 0001 00000101 0000 0001 0000
MOVE #$1,D1MOVE #$8,D0ADD D0,D1
Assembly/Symbolic language
High-level language
Example:
![Page 20: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/20.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 20
Figure 1-9: Building a C program
![Page 21: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/21.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 21
Figure 1-10: Executing programs
![Page 22: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/22.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 22
Figure 1-11: Process of system development
Building programs•Edit•Compile•Link•Run
![Page 23: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/23.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 23
Figure 1-11: Process of system development
Understand the problem:•Input•Output•Process
Algorithm is the stepsto solve problems
Develop the solution (Algorithm):•Structure chart•Pseudocode•Flowchart
Converting design to computer codes. e.g: Flowchart -> C program
![Page 24: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/24.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 24
Testing and Debugging
• Bug– A mistake in a program
• Debugging– Eliminating mistakes in programs– Term used when a moth caused a failed relay
on the Harvard Mark 1 computer. Grace Hopper and other programmers taped the moth in logbook stating: “First actual case of a bug being found.”
![Page 25: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/25.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 25
Program Errors
• Syntax error– Violation of the grammar rules of the language– Discovered by the compiler
• Error messages may not always show correct location of errors
• Run-time error– Error detected by the computer at run-time
• Logic error– Error in the program’s algorithm– Most difficult to diagnose– Computer does not recognize it.
![Page 26: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/26.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 26
Program Errors (cont.)
Syntax error example
x = 2;y = 3z = x + y;
This line consists an error. Each statement must be endedwith a semi-colon ‘;’
![Page 27: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/27.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 27
Program Errors (cont.)
Run-time error example
x = 0;y = 3/x;
This line produces an error, because thedivision by zero. Thiserror is only discoveredwhen the program runs.
![Page 28: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/28.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 28
Program Errors (cont.)
Logic error example
Enter a number >> 10Enter another number >> 25
The total of those two numbers is 15
This is a logic error. The total should be 35 not 15.
![Page 29: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/29.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 29
Program Design
• Structure Chart• Pseudo-code• Flowchart
![Page 30: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/30.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 30
Structure ChartRepresents a program as a collection of sub-programs (modules)
Example:
![Page 31: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/31.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 31
Describe an algorithm in English-like statements
Example: Algorithm for multiplying two numbers
1. Get the first number, let say A2. Get the second number, let say B3. Calculate the result let say C, C= A * B4. Display the result, C
Pseudo code
![Page 32: Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers](https://reader035.vdocuments.us/reader035/viewer/2022081421/56649da75503460f94a93eaf/html5/thumbnails/32.jpg)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 |Last Updated: July 2005 Slide 32
Represents an algorithm in graphical symbols
Example: Algorithm for multiplying two numbers
Start
Stop
Get AGet B
Display theResult C
Calculate ResutC=A*B
Flowchart