Chapter 1

Introduction to computers

Objectives of this Chapter:
To Understand/ To know/
• • • • • • • • • • What Is Computer? Computer’s Component categories of computer data storage in computer What is CPU? Kinds of memories kinds of Computer Software Kinds of Machine Language What happens when you write a program? What is the use of compiler?

What is a Computer?
• Computer is an electronic machine that can receive, store or process data according to a set of instructions (computer program) and output information.
input Process output

data

information

What is a computer?
• A machine –electronic components (hardware) –receives controlled instructions (software) –stored within its memory.

What is a computer?
Consist of basic components:
• • • • • input devices output devices system unit storage devices communication devices

Components of a Computer System .

Categories of computers Categories Personal computers (desktops) Mobile computers / devices Embedded computers Servers Mainframes Supercomputers Size Be placed on a table Portable and fits by hand-carrying Small and embedded into devices Small cupboard Half a room to a room full A room full of equipments .

Categories of computers Embedded computers Mainframes Source: Google Images .

Categories of computers Supercomputers Source: Google Images .

• 8 bits = a byte 1/0 .Data representation • • • • • Digital form Two states: on and off Digit 0 = off Digit 1 = on Digit 0 and 1 is known as Bit (short for binary digit).

Binary coding scheme • Represents 256 different individual characters • Two most popular coding schemes: – American Standard Code for Information Interchange (ASCII) – Extended Binary Coded Decimal Interchange Code (EBCDIC) .

Binary coding scheme Symbol A B 1 2 # & ASCII 0100 0001 0100 0010 0011 0001 0011 0010 0010 0011 0010 0110 EBCDIC 1100 0001 1100 0010 1111 0001 1111 0010 0111 1011 0101 0000 .

.

.

What happens? j j ASCII to Binary conversion 01101010 .

1 or 0 7 6 5 2 128 2 64 2 32 2 16 4 2 8 3 2 1 2 4 2 2 1 0 2 Total=256 .

Example 0 7 1 6 0 5 0 4 0 3 0 2 0 1 1 0 2 0 2 64 2 0 2 0 2 0 2 0 2 0 2 1 Total: 64+1= 65 Refer to Table of ASCII Characters – the character is A .

Input / Output Devices • Input is data or instructions that user or other sources gives command to the computer on how they should operate • Output is the useful outcome after the computer has completed its operation .

Sample input .

Sample output .

System Unit Source: Google Images .

CPU) interprets and manages most of the computers operation.System Unit • Contains all the electrical components that the computer uses to process data. • Processor (central processing unit. Source: Google Images .

• During the process. current instruction and data are stored temporarily inside the CPU’s special high-speed memory locations called registers. . and  performing arithmetic and logical operations on data (arithmetic and logic unit).Computer Hardware Central Processing Unit (CPU) • 2 roles of CPU  coordinating all computer operations (control unit).

.Processor • Two parts: – control unit: directs and coordinate most operations in the computer – arithmetic logic unit (ALU): performs arithmetic and comparison.

Source: Google Images .Memory • A temporary storage unit • 3 things it stores: – Operating system and other system software of the computer and its devices – Application programs with tasks – Data being processed by programs and its results.

volatile (temporary) and nonvolatile (permanent) • Volatile memory loses its contents when power is turned off • Non-volatile memory does not lose its content .Memory • 2 kinds of memory .

Memory • Computer memory can be divided into two categories  main memory  secondary memory There are 2 types of main Provides semi-permanent memory data storage capability  RAM – temporary storage and volatile (contents is gone when the computer is switch off)  ROM – stores information permanently and NOT volatile .

Memory • Transfer of data from storage to memory .

Memory • Each bytes resides temporarily in memory has an address. Source: Google Images . This address is a unique number that identifies the location of the memory.

… Computer Hardware Memory • Memory  an ordered sequence of storage locations or memory cells. each of which has a unique memory address • Memory cell  an individual storage location in memory • Assigning a new data to a memory cell will destroy its previous content • 1 byte == 8 bits .

. pictures • Save data. music. it is known as reading. instructions or information from memory to storage medium. that process is known as writing.Storage • Stores data. • To recall data from a medium to memory. assignment. instructions and information to be used in the future • Eg. movies.

Storage Source: Google Images .

Computer Software • Instruction that instructs the computer what to do and how to execute • There are Three (3) categories of computer software  System Software  Application Software  Computer Languages .

Software • System software . Divided into 2: – operating system – utility programs Source: Google Images .control and maintain the operations of the computer and its devices.

• Conveying program output to output devices • Booting a computer  loading the OS from disk into memory – Managing allocation of memory. i. e. – Communicating with the computer user • Collecting input from input devices.… Computer Software Operating System • System Software = Operating System (OS)  software that controls interaction of user and computer hardware and that manages allocation of computer resources. of processor time and of other resources for various tasks – Accessing data from secondary storage – Writing data to secondary storage .

… Computer Software Application Software • Application software  used for a specific task such as word processing. . accounting. or database management. • i. Mozilla etc.e – Microsoft Word – Microsoft Excel – Microsoft Access – Web browser. Opera.

… Computer Software Computer Languages • Three (3) types of computer languages  Machine language • Binary number codes (0 and 1) understood by a specific CPU  Assembly language • Mnemonic codes that correspond to machine language instructions  High-level language • Machine-independent programming language that combines algebraic expressions and English symbols • Compiler is used to translate a high-level language program into machine language .

… Computer Software Machine Language vs. Assembly Memory Addresses Machine Language Assembly Language Language Instructions Instructions 00000000 00000000 CLA 00000001 00000010 00000011 00000100 00010101 00010110 00110101 01110111 ADD A ADD B STA A HLT .

High-Level Languages Language Application Area FORTRAN COBOL LISP C Prolog Ada Smalltalk C++ Java Scientific Programming Business Data Processing Artificial Intelligence Systems programming Artificial Intelligence Real-time distributed systems Graphical user interface. Object oriented (OO) programming Supports OO programming OO & Support web programming .

HTML. C#. Phyton. PHP.Writing programs • Programmers . Pascal . Visual Basic. Java.write programs to instruct the computer what to do • Various languages – C++.

Writing programs • What happens when you write a program? .

Translating and Running a HighLevel Programming Language .Entering.

Entering. If there is error do some correction Do correction . Translating and Running a HighLevel Programming Language Save the file Do some testing by entering the data. Check for logic error.usually for syntax error Do editing If not satisfy with the result do some editing .

Example: Write program(source file)…. ..

.Save file…. .

Compile…. .

2. If there is error then fix your program .

Fix the error. save file and compile again Successfully compile Fixed .2.

2. If the compilation succeed then time to execute program .

2. Test the executable file by entering input .

• ____________ translate _____________ language program into _________________ • What is relationship between memory cell. 2 output devices and 2 secondary storage.REVISION • Computer programs are___________of computer component while a disk drive is a ____________. • List 2 function of CPU • List 2 input devices. bytes and bits? .

Sign up to vote on this title
UsefulNot useful