Download presentation
Presentation is loading. Please wait.
Published byGeorgina Carpenter Modified over 9 years ago
1
Tools make jobs easier to do -A computer is a tool used by many professions A computer can do many different jobs because they are programmable - Machine specifically designed to follow instructions What is a computer?
2
Computer Systems: Hardware and Software Hardware – physical components a computer is made of –System of devices –Major components »CPU »RAM »Secondary storage »Input devices »Output devices
3
Main functions: control, arithmetic operations, logical operations Arithmetic Logic Unit (ALU) Control unit manages the instruction-execution cycle (coordinates the activities of other devices) FETCH – DECODE – EXECUTE Central Processing Unit
4
(fast access) storage device for preserving binary data and instructions memory is divided into units or words each is usually a standard size or fixed- length each memory word has a unique address for random access Main Memory
5
Random Access Memory (RAM) –readable –writable –usually volatile (e.g., Dynamic RAM or DRAM) –general storage Read Only Memory (ROM) –readable –permanent –nonvolatile –special-purpose storage for data and instructions Main Memory
6
Input/Output –exchanging data and instructions between the user and the computer Secondary Storage –auxiliary storage for data and instructions I/O Subsystem
7
backup or alternative storage in place of (volatile) RAM cheaper, mass storage for long term use secondary memory devices (and media) are distinguished by their capacities, speed, and cost Secondary Storage
8
A program is a list of instructions that direct the computer’s process in order to perform a task the computer system executes binary-encoded machine language programs designed for that type of processor Programs are developed and written using symbolic programming languages which are easier to comprehend and use. What is a program?
9
What is programming? Art and a science –Every program is carefully designed –Also a scientific or engineering side » rarely work right first time » require experimentation, correction and redesigning »Demands discipline
10
Programming Language Generations 1 st – Machine Language (binary) 2 nd – Assembly language (symbolic/ 1 to 1) 3 rd – High level Language (English-like/1 to many) –Examples: Cobol, Pascal, Basic, C/C++, Ada, …. 4 th - Automatic Code Generation
11
High-Level Programming Languages are more abstract are more concise are portable to other processors must be translated to the machine language of the host processor interpreters--translate and execute one instruction at a time compilers--translate the entire program to executable form
12
Source to Execution: Figure 1-5 C++ programs are typed into the computer and saved to file source code Process of translation –Preprocessing (looking for # symbols) –Compiling object code –Linking executable code –Executing IDE – integrated development environments
13
Algorithms Problem: Compute amount earned on an investment Algorithm: –Get data –Compute amount –Output amount -Get data Get principal Get APR Get number years -Compute amount Compute interest rate Compute days Compute amount -Output amount
14
Algorithms Algorithms may be expressed using a variety of methods and techniques A flowchart pseudocode
15
Language Elements Keywords Programmer-defined symbols (identifiers) Operators Punctuation Syntax Lines and Statements Variables (Memory locations)
16
A Sample Program
17
Input, Processing, Output Three primary activities of a program Input –cin >> hours; Process –pay = hours * rate; Output –cout << “You earned $ “ << pay;
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.