A.Abhari CPS125 1
Topic 1: Introduction to Computers
Computer Hardware• Computer components• Connecting ComputersComputer Software • Operating System (OS)• Running a High-level LanguageProblem Solving with Computers • Software Development Method
A.Abhari CPS125 2
Computer components
•Central Processing Unit
•Memory
•Input/output devices
•Secondary storage
A.Abhari CPS125 3
Computer Components
A.Abhari CPS125 4
CPU
A.Abhari CPS125 5
CPU
• Arithmetic/logic unit (ALU) Performs arithmetic operations (+,-,...) and
logical operations (<, >, ...)• Control unit (CU) Decodes machine instructions and tells other components the required operations• Registers store current instruction and values
A.Abhari CPS125 6
Memory
• A collection of cells
• Each cell has an address and a value
• Random Access Memory (RAM)
Cells can be accessed randomly
• Ram is volatile
• All data stored in binary format
• Bit, byte and word are the unit of data
A.Abhari CPS125 7
CPU-Memory Interaction
0 LDA 14
1 ADD 15
2 STA 14
3 HLT
…. ……
14 10
15 7
14 17
15 7
Assume a is stored in 14and b is stored in 15
a= a + b
Result
Program
Fetch-execute cycle
A.Abhari CPS125 8
Input/output Devices
• Text-based and GUI-based interaction• Scanners, Touch screens• Monitor, printer, speakers
Secondary Storage •Floppy disk , CD (680 MB), DVD (4.717 GB), •Tape, Hard disk•File, Directory, Subdirectory, Folder
A.Abhari CPS125 9
Hard Disk Drive Basics
A.Abhari CPS125 10
Connecting Computers
• Local Area Network (LAN)
• Wide Area Network (WAN)
• Internet
• World Wide Web (WWW)
A.Abhari CPS125 11
Computer SoftwareOperating System (OS)
• Part of OS is stored on Read Only Memory (ROM)
• OS is responsible for directing all computer operations and resources
• Command line interface (Unix)
• Graphical user interface (Windows)
A.Abhari CPS125 12
Computer Software
• Application Software ( Word, Excel, etc.)
Computer Languages
• Low level languages (machine language)• High level language (C, Java, Fortran, …)
A.Abhari CPS125 13
Running a High-level Language
• Generating a source file (editor) => tst.c• Translating to machine code (compiler)
=>tst.obj• Linking the object file with other object files
(linker) =>tst.exe• Copying the executable file into memory
(loader)Integrated Development environment (IDE)
combines all of these steps
A.Abhari CPS125 14
Problem Solving with Computers (Software Development Method)
1- Specify the problem requirement2- Analyze the problem (input, output,
additional requirements). Modeling the problem (abstraction)
3- Design the algorithm to solve the problem (top-down design or divide and conquer)4- Implement the algorithm=> changing the
algorithm to a programming language
A.Abhari CPS125 15
Problem Solving with Computers (Software Development Method)
5- Test and verify the complete program, running the program several times with different data sets
6- Maintain and update the program, removing undetected errors
** Failure is part of the process **