640 likes | 661 Views
Chapter 1: Overview of a computer system. CSC118 Fundamental of Algorithm Development. Zanariah Idrus Senior Lecturer|Computer Science Department|UiTM Kedah. What is computer?.
E N D
Chapter 1: Overview of a computer system CSC118 Fundamental of Algorithm Development Zanariah Idrus Senior Lecturer|Computer Science Department|UiTM Kedah
What is computer? • Is an electronic device, operating under the control of instructionsstored in its own memory, that can accept data, process the data according to specified rules, produceresults, and store the results for the future use.
What is computer? • Data vs Information??
The components of a computer • Known as hardware. • These component include: • Input Devices • Output Devices • System Unit • Storage Devices • Communications Devices
Input Output Devices • Input device – allows to enter data and instructions into a computer. • Output devices – conveys information to one or more people
System Unit • contains electronics components of the computer that are used to process data. • Motherboard is a circuit board that contains circuitry of a system unit • 2 main component on the motherboard – processor and memory
Storage Devices • records (writes) and/or retrieves (reads) items to and from storage media. Often function as a source of input because transfer items from storage to memory.
Communication Devices • enables computer to send (transmit) and retrieve data, instructions and information to and from one or more computers.
Excercise 1: Match with correct device Portable media player speakers scanner printer CD/DVD drive mouse External Hard disk Web cam monitor Memory card Digital camera keyboard microphone modem USB flash drive Hard disk drive Card reader/ writer
Computer Software • Also called a program, is a series of instructions that tells the computer what to do and how to do. • With a graphical user interface (GUI), we can interact with the software using text, graphics and visual images such as icons. • 2 categories of software:- • System Software • Application Software
System Software • consists of programs that control or maintain the operations of the computer and its devices. • Provides the services between the user, the application software and the computer’s hardware. • 2 types: • Operating system. • Utility program
System Software • Operating system– set of a programs that coordinates all the activities among computer hardware devices. Example Windows Vista, Windows XP and Mac OS X.
System Software • Utility program– allows a user to perform maintenance-type tasks usually related to managing a computer, its devices, or its programs. For example utility programs to transfer digital photos to a CD or DVD. • Examples of utility programs : • File viewer • Backup utility • File compression • Disk scanner • Disk defragment • Uninstaller • Antivirus utility • Screen saver
Application Software • Consists of programs designed to make users more productive and/or assist them with personal tasks. • A widely used is a Web browser. Other popular includes word processing software, spreadsheet software, database software and presentation graphics software.
Microsoft PowerPoint Windows Media Player Facebook Windows Ms Excel Exercise 2: Find the category of software Anti virus software Printers installer Paint program
Categories of Computers • Personal Computers (PC) • fits on desk • Mobile Computers and Mobile Devices • Fits on lap or in hand • Game Consoles • Small box or handheld device • Servers • Small cabinet • Mainframes • Partial room to a full room of equipment • Supercomputers • Full room of equipment • Embedded Computers • Miniature
laptop Smart Phone PDA Desktop Notebook Tablet PC Handheld computer Sony’s PS 3 Nuclear Energy research Online banking UiTM network Exercise 3: Name the correct categories of computers
Volatile Types of Memory Data/information lose when power is turn off. Temporary means for holding data, instruction or information currently being processed. Example: 1. Random Access Memory (RAM) - Consist of memory chips that can be read from and write to by the processor and other devices. The processor (CPU) interprets and executes a program’s instructions while the program is in RAM. 2. Cache – Sit between RAM and processor. Cache speeds up processing time because it stores frequently used instructions and data. Non-volatile Memory The contents of memory retained although the computer’s power is turned off. Permanent means to hold data, instruction, information that is currently being processed. Example: 1. Read Only Memory (ROM) - data on most ROM chips cannot be modified. 2. Flash Memory - Can be erased electronically and rewritten. 3. CMOS (complementary metal-oxide semiconductor) - store a computer’s startup information such as calendar, date and time.
Byte and Addressable Memory • Each byte stored in unique location called an address, similar to seats in a concert hall.
Memory Size • 1 byte = 8 bits = 1 character • To simplify memory and storage definitions, computer users often round a kilobyte down to 1,000. • For example if a memory chip can store 100 KB, it can hold approximately 100,000 bytes (characters).
Memory Access Time • Access time is the amount of time the processor to read data, instructions, and information from memory
Storage Device • Two storage types ; • Primary storage (main memory) • The content of main memory is temporary • RAM, ROM • Secondary storage (storage device) • the storage device is a place to hold data, instructions, and information permanently for future use. • hard-disk, floppy disk, pen-drive, CDs, DVDs
Computer Hardware Block Diagram The diagram shows the interrelationship among the major components of a computer. ( ) indicates the movement of data from one component to another ( - ->) indicates the control flow, which contol unit controls all the processes and components
Peopleware • A term first coined by Peter G. Neuman in 1977 • peopleware refers to the role people play in technology and the development of hardware or software. It can include various aspects of the process such as human interaction, programming, productivity, teamwork, and other factors. source: https://www.computerhope.com/jargon/p/peopware.htm
Peopleware • People involved in computer environment are information technology (IT) professionals and computer’s user or known as end-user. • IT professionals are those who work in computer field. • They may be system analyst, programmer, hardware engineers, web designer and so on. A programmer is a person who writes a program. • End-user is a person who uses a computer to do their job. • For example, bank clients are end-user for auto teller machine. A counter clerk in supermarket is an end-user for point-of-sales system.
Memory Processor ALU Control Unit What is a Machine Cycle? • Four operations of the CPU comprise a machine cycle Step 1. FetchObtain program instruction or data item from memory Step 2. DecodeTranslate instruction into commands Step 4. StoreWrite result to memory Step 3. ExecuteCarry out command
Data Representation How do computers represent data? • Most computers aredigital • Recognize only two discrete states: on or off • Use a binary system to recognize two states • Use Number system with two unique digits: 0 and 1, called bits (short for binary digits)
Data Representation What is a byte? • Eight bits grouped together as a unit • Provides enough different combinations of 0s and 1s to represent 256 individual characters • Numbers • Uppercase and lowercase letters • Punctuation marks
ASCII Symbol EBCDIC 00110000 0 11110000 00110001 1 11110001 00110010 2 11110010 00110011 3 11110011 Data Representation What are two popular coding systems to represent data? • ASCII—AmericanStandardCodeforInformationInterchange • EBCDIC—ExtendedBinaryCoded DecimalInterchangeCode
Step 1.The user presses the capital letter T (SHIFT+T key) on the keyboard. Step 2.An electronic signal for the capital letter T is sent to the system unit. T Step 4.After processing, the binary code for the capital letter T is converted to an image, and displayed on the output device. Data Representation How is a letter converted to binary form and back? Step 3.The system unit converts the scan code for the capital letter T to its ASCII binary code (01010100) and stores it in memory for processing.
Low-Level Programming Languages • Is the only language that computer can directly understand. • Uses a series of binary digits (1s and • 0s) with a combination of numbers and letters • that represent binary digits. • Example… Low-Level • Instructions made up of symbolic instruction codes, meaningful abbreviations and codes. • Source program contains code to be converted to machine language • Uses assembler to translate to machine code • Example….
High-Level Programming Language Procedural Language (3GL) High-Level Programming Language Visual Programming Language (5GL) Object-Oriented Programming Language Non-Procedural Language (4GL)
Procedural Language • Uses series of English-like words to write instructions. • Most widely used are BASIC, COBOL, and C. • Uses compiler to translate to machine code.
Object-Oriented Programming Language (OOP) What is an object-oriented programming (OOP) language? Used to implement object-oriented design Major benefit is ability to reuse existing objects Event-driven—checks for and responds to set of events Java, C++, C#, and Visual Basic are complete object-oriented languages Object is item that contains data and procedures that act on data Event is action to which program responds
Example of C++ //This program displays a status based on the mark #include <iostream.h> #include <conio.h> void main() { int mark; cout << “Enter the mark : ”; cin >> mark; if (mark>=50) cout << “PASSED” <<endl; getch(); }
Non-Procedural Language • Nonprocedural language that allows access to data in database • Popular 4GL is SQL, query language that allows users to manage data in relational DBMS
Visual Programming Languages • Provides visual or graphical interface for creating source code • Often used in RAD (rapid application Development)environment Available in Visual Studio 2005, Delphi and PowerBuilder
Other Available Programming Languages ADA ALGOL APL BASIC FORTH FORTRAN HYPERTALK LISP LOGO MODULA-2 PASCAL PILOT PL/1 PROLOG SMALLTALK Main Menu
Elements of Computer Program • Identifiers: Variable, Constant (ie: x, y, z, sum, var, temp) 2. Data Types: int, float, char (ie: int x, float y, char name) 3. Statement: cout (ie: cout<<“Key in number ”), cin (ie: cin>>number) 4.1. Assignment (ie:sum=x+y, x=y, sum=0) 4.2. Expression: Arithmetic (ie: x+y), Logical (ie: x && y), Relational (ie: x<y) • Control Structure – • -Sequential • -Conditional (if, switch case) • -Repetition/Iteration (while do, do while, for)