Anda di halaman 1dari 16

Fall 2016 Introduction to Computer Technology

A SIMPLE COMPUTER SYSTEM

TABLE OF CONTENTS
Introduction ............................................................................................................................. 2
Some Background ................................................................................................................... 2
Early Systems .......................................................................................................................... 2
A Better Way ........................................................................................................................... 2
Basic Concepts ........................................................................................................................ 3
What Is A PC? ......................................................................................................................... 3
The Computer .......................................................................................................................... 3
Components Of A Computing System .................................................................................... 4
A Closer Look ......................................................................................................................... 4
What Is A Computer? .............................................................................................................. 4
Components Of A Computer ................................................................................................... 4
Functionality Of Different Components .................................................................................. 5
Central Processing Unit ........................................................................................................... 5
Input / Output .......................................................................................................................... 5
Block Diagram Of A Computer .............................................................................................. 5
An Example Of How A Computer Functions ......................................................................... 6
Block Diagram Of A Computer .............................................................................................. 6
Memory Speed And Access Time ........................................................................................... 7
Memory And Performance ...................................................................................................... 7
The Difference Between Memory And Storage ...................................................................... 7
Cache Memory ........................................................................................................................ 8
How Does A Computer Work? ............................................................................................... 9
Summary Of The Operation Of A Computer .......................................................................... 9
Basic Terminologies ................................................................................................................ 9
Functional Units Of A Computer .......................................................................................... 10
Central Processing Unit ......................................................................................................... 10
Processor Instructions ............................................................................................................ 11
The CPU ................................................................................................................................ 12
Registers ................................................................................................................................ 12
Stages Of The Execution Of An Instruction.......................................................................... 13
Main Memory ........................................................................................................................ 13
Input Unit............................................................................................................................... 13
Output Unit ............................................................................................................................ 14
Input Devices ......................................................................................................................... 14
Output Devices ...................................................................................................................... 14
Secondary Storage Devices ................................................................................................... 14
Bus Structures ........................................................................................................................ 15
Single Bus Organization ........................................................................................................ 15
Devices .................................................................................................................................. 15
Summary Of The Operation Of A Computer ........................................................................ 16
Classification Of Computers ................................................................................................. 16

Notes By: ERAM ABBASI Page 1 of 16


Fall 2016 Introduction to Computer Technology

A Simple Computer System


Introduction
 In these notes, you will study the basic components of a computer
 How do these components work?
 How can we evaluate and improve their performance?
 How are they connected and how do they communicate with each other?

Notes:
The computer has become a part of our daily life. Most of the jobs which were earlier
performed manually make use of computers now. The computer is mainly used for
information storage, retrieval and efficient processing. In these notes, we will look at a
digital computer and understand its working.

Some Background

Early Systems
 Computing systems were developed to solve numerical problems
 However
 Purpose designed hardware used to solve particular problems
 Therefore
 When the problem was changed the hardware needed to be changed

A better way
 Modern systems are more general because they are programmable
 that is, able to undertake a sequence of operations according to some predefined
program
 Therefore, there needs to be a combination of hardware and software

Notes By: ERAM ABBASI Page 2 of 16


Fall 2016 Introduction to Computer Technology

Basic Concepts
What is a PC?
 PC is the abbreviation for the words Personal Computer.

 The term PC or computer is used to represent all of the hardware components of


a computer system.
Hardware is any part of the PC that may be seen and touched.

 A PC collects, processes, outputs and stores information.

 A PC is made up of a system unit and various peripherals. A peripheral is any


piece of hardware attached to the system unit. The most common peripherals
are a keyboard, a mouse, and a monitor.

PC

System Unit Peripherals

– Input devices provide a way of communicating with a PC. These devices


allow for the entry of information and commands.
– The Central Processing Unit (CPU) is the main chip in a PC and is
contained within the system unit. This chip is used to communicate with
input, output, and storage devices.
– A storage device is used to hold information. The PC uses information
stored on these devices to perform tasks.
– An output device allows the PC to communicate with the user.

The Computer
 A fast electronic machine
 Digital Computer
 Analog Computer
 The digital computer accepts digitized input information
 Processes using instructions are stored in the main memory

Notes:
A computer is a fast electronic machine. The digital computer works on the principle of
counting and deals with discrete numbers. An analog computer works on the principle of
measurement and deals with continuous quantities (like speed, voltage etc.) In the following
pages, when we use the term computer, we will be referring to digital computers.

The job to be executed has to be explained to the computer in a language which it can
understand.
The sequence of instructions to be carried out by the computer is stored in its main memory.

Notes By: ERAM ABBASI Page 3 of 16


Fall 2016 Introduction to Computer Technology

What is a PC?

Components of a Computing System


 Software - a sequence of instructions
 System Software
 Application Software
 Hardware
 Electronic devices
 To receive, store and process information and to output results
 Firmware : a software implemented in the hardware

Notes:
Software is a term used for a program. A program is a sequence of instructions to be
executed in order to perform a given task. Software can be categorized into System
Software or Application Software. Hardware consists of electronic devices that carry out the
instructions.

A Closer Look
What is a computer?
 At a basic level, any computer consists of a large number of electronic circuits

 At a higher level, computer can be thought of as having three components:


 CPU
 Memory
 Input/Output interface

 These three components are connected by a Bus which carries data from one
component to the other

Components of a Computer
 Input devices provide a way of communicating with a PC. These devices allow
for the entry of information and commands.

 The Central Processing Unit (CPU) is the main unit in a PC and is contained
within the system unit. This unit is used to communicate with input, output and
storage devices. It is the place where all the instructions given to the computer
are actually carried out.

 A storage device is used to hold information.

 An output device allows the PC to communicate with the user.

Notes By: ERAM ABBASI Page 4 of 16


Fall 2016 Introduction to Computer Technology

Functionality of different components


 CPU is the place where all the instructions given to the computer are actually
carried out

 Memory is a storage place: the instructions for solving a computational problem


will be stored here, along with the input. The CPU, after carrying out the
instructions, will also store the output in the memory

 Input/Output interface is the component which interacts with the user (that is,
us).

Central Processing Unit


 Contains:
 Control Unit
 Arithmetic Logic Unit
 Registers
 General purpose registers
 Special purpose registers
 When combined in a single chip
 Microprocessor unit (MPU)

Input / Output
 Comprises of
 Input devices
 Keyboard
 Mouse

 Output devices
 Monitor
 Printer

 Bi-directional devices
 Hard disk drives
 Floppy disk drives

Block diagram of a computer

CPU

Input

MEMORY Output

I/O

Notes By: ERAM ABBASI Page 5 of 16


Fall 2016 Introduction to Computer Technology

An example of how a computer functions


 Suppose you want to execute a program to add two numbers on the computer
 Here is how it happens:
 You feed in the program and the two numbers to the computer through I/O interface
 The I/O interface reads it, and stores it in Memory (using the Bus)
 Then the I/O interface sends a signal to the CPU saying that some new instructions
have been read and they are to be executed (again using the Bus)
 The CPU now reads the instructions one by one from the Memory and executes
them
 During the execution it stores all the intermediate results in the Memory
 Once the execution is over, the CPU writes the output in the Memory, and then
sends a signal to the I/O interface when the execution is over
 Now the I/O interface reads the output from the Memory and communicates it to you

Block diagram of a computer


Functional Units of a Computer

CPU

Input

MEMORY Output

I/O

Notes:
The Central Processing Unit (CPU) is the most important part of a computer. It executes the
instructions stored in memory and controls the data communication among all devices. The
main memory is a fast memory to store the program under execution and the data needed
for the execution of the program. The input and output unit communicates with the outside
world, receives the data and the program, stores it in mass storage devices, and generates
the output. A dotted line shows an interface between the I/O unit and memory for direct
memory access (DMA) for direct transfer of data.

Notes By: ERAM ABBASI Page 6 of 16


Fall 2016 Introduction to Computer Technology

Memory speed and access time

Data access from Hard Disk Data access from Memory

Input
CPU 1
Output
CPU 4
I/O
Memory
Data access 3
from hard disk 2
Hard Disk is not possible
Hard Disk

Memory and Performance


In an average computer, it takes the CPU approximately 200ns (nanoseconds) to access
RAM compared to 12,000,000ns to access the hard drive. To put this into perspective, this
is equivalent to what's normally a 3 1/2 minute task taking 4 1/2 months to complete!
Data access from Memory Data access from Hard Disk
(3.5 minutes per hour) (4.5 months per year)

35% of a
6% of an year
hour

The difference between Memory and Storage


• Computer's hard disk. = File cabinet Provides
storage for all the files and information you need in
your office.
• Memory in the computer = The desk Holds the
information and data you need to have handy while
you're working. When you come in to work, you take
out the files you need from storage and put them on
your desk for easy access while you work on them.

Notes By: ERAM ABBASI Page 7 of 16


Fall 2016 Introduction to Computer Technology

Cache Memory
 There is a wide difference in the speeds of the CPU and the main memory
 It is not possible to get information required by the CPU from the main memory
in one clock cycle. The CPU has to be idle
 To avoid this, high speed caches are used to store data and instructions
(transferred from the main memory)
 The CPU has to access the main memory when data is not found in the cache
 When the data is not found in the cache, it is called a cache miss otherwise a
cache hit occurs

Notes:
In general, there is a wide difference in the speeds of the CPU and the main memory,
making it almost impossible to get information required by the CPU from main memory in
one clock cycle.

Caches are fast memories between the CPU and memory. If a memory request is made from
the CPU, it is first searched in the cache. If the copy of data is also present in the cache, it is
read from there, otherwise a request is sent to the main memory.

If the cache requires tc time for accessing one word, and memory requires tm time for
accessing one word, the time required to fetch a word for the CPU will be tc if it is found in
the cache (cache hit), and tc+ tm if a cache miss occurs. Since in general, tc <tm, the speed
up is quite significant.

Cache Memory
 Cache memory is a relatively small amount of high speed memory that resides
very close to the CPU.

 Cache memory is designed to supply the CPU with the most frequently
requested data and instructions

 LEVELS OF CACHE
 Level 1 (L1) Cache (Primary Cache)
 Level 2 (L2) Cache (Secondary Cache)

 It can take as long as 195ns for main memory to satisfy a memory request from
the CPU. External cache can satisfy a memory request from the CPU in as little
as 45ns.

Notes By: ERAM ABBASI Page 8 of 16


Fall 2016 Introduction to Computer Technology

How does a computer work?

 Uses the principle of a switch


 A switch can have either of two states:
o ON
o OFF
 An instruction generates a sequence of electric signals to control several
switches in the processor

Notes:
A computer is an electronic device. Though the input given to it through the input unit is in
the form of a sequence of characters, internally it has to be converted to electric signals. The
electric signals understood by a computer are basically an on or off of a switch, i.e., at any
given instant any internal line can only have either of the two values. These states can
represent any binary state such as 0 and 1 or true and false. An instruction on execution
basically determines the states (0 or 1) of internal lines.

Summary of the operation of a computer


 Accepts information as programs and data through the input unit and stores it in
memory
 Information stored in memory is fetched, under program control, into the
arithmetic and logic unit, where it is processed
 Processed information leaves the computer through an output unit
 All activities inside the machine are directed by the control unit

Basic terminologies
 Program: a sequence of instructions to perform a task
 Stored Program: a program image stored in the main memory
 Data: information such as numbers and characters coded numerically
 Bit: a binary digit which can either have a value of 0 or 1 (representing two
states of a switch)
 High Level Language Program: a program written in a language easily
understood by human beings
 Object Code: a program in digital signals that is understood and executed by a
computer
 Compiler: converts high-level-language programs (Source Programs) to object
code specific to a processor
Notes:
A program contains a sequence of instructions and its initialized data to perform a task. A
stored program is a concept where a program is kept in memory and made available all the
time to the processor.

Notes By: ERAM ABBASI Page 9 of 16


Fall 2016 Introduction to Computer Technology

Functional units of a computer


 Central Processing Unit (CPU) : executes instructions and thereby executes a
program
 Arithmetic and Logic Unit (ALU)
 Registers
 Control Unit (CU)

 Storage Devices: stores programs and related data


 Primary Storage : RAM / ROM
 Secondary Storage: Hard disk, CD, Floppy

 I/O Units: to input, output programs and data


 Input devices : keyboard, mouse, joystick etc.
 Output devices: video display, printer etc.

Notes:
The function of the Central Processing Unit (CPU) is to execute instructions. It contains
several parts. The CPU registers are high speed storage devices used in the CPU operations.
The Arithmetic and Logic Unit (ALU) is used to perform arithmetic and logic operations
such as addition or subtraction on stored data. The Control Unit is responsible for the
execution of instructions by controlling data movement from the registers to the ALU and
vice versa and the ALU’s performance of an operation. It then controls the fetching of the
next instruction.

Take an example of an instruction such as ADD R1,R2 where R1 and R2 are registers. The
instruction itself is coded as some number which can be represented in terms of 1s and 0s.
The control unit initiates the fetch instruction from memory to processor. After fetching, it
controls the movement of data from register R1 to the ALU, register R2 to the ALU, and
initiates the addition in ALU. It then controls the movement of ALU output to register R1
and initiates the fetch of the next instruction.
The I/O unit of a computer typically contains devices external to the processor and memory.
These include storage devices to keep programs, data, documents etc. on disk, tape or CD
ROM. The keyboard is the most familiar device through which characters are typed into the
computer. A display is the output device which can display characters/graphics under a
program control.

Central Processing Unit


 Executes a sequence of instructions in order to execute a program
 Instruction: instructs the CPU on what operation is to be performed
 Instruction typically has two parts
 Operation (What should be done ?)
 Operand (Where can values for an operation be found?)
 An operand can be a value, an address in memory or the name of a register
Notes:
A program contains a sequence of instructions. An instruction specifies the operation to be
performed by the CPU and the operands on which the operation is to be performed. The
operand can be a value, an address in memory or the name of a register.

Notes By: ERAM ABBASI Page 10 of 16


Fall 2016 Introduction to Computer Technology

Each processor has its own architecture (set of registers, ALU etc.) and therefore
instructions are specific to a processor. Thus an instruction for 80486 processor will be
different from an instruction for a DEC Alpha processor for carrying out a similar operation.

Processor Instructions
 Examples:
Add R1, R2
Load R1, Loc
Jmp 5000
Halt

Notes:
The instructions may correspond to the following:

Add R1, R2 :
Add the contents of register R2 to the contents of register R1.

Load R1, LOC :


Load data from memory location (LOC) into register R1. LOC is the symbolic name for a
memory location. In actual practice, this will be a number giving the address.

Jmp 5000:
Execute the instruction stored at memory location 5000. After most instruction executions,
the next instruction executed is the one immediately following the current instruction being
executed. JMP instruction is an exception to that.

Halt:
Stop the instruction execution activity on the processor. The processor stops completely and
does not fetch any further instructions.

Notes By: ERAM ABBASI Page 11 of 16


Fall 2016 Introduction to Computer Technology

The CPU
Memory
(RAM)
CU ALU

Registers
Cache
Memory

Registers
 Temporary storage areas
 Also called “Memory Pads”
 Used for storing data temporarily loaded from memory
 Two types:
 General purpose
 Special purpose
 Memory Address Register (MAR)
 Memory Data Register (MDR)
 Program Counter (PC)
 Instruction Register (IR)
Notes:
General purpose registers are used by programmers to store data from memory during the
execution of instructions. Depending upon the processor architecture, the number and size
of these registers may vary. General purpose registers can be used in any way that the user
needs.
Special purpose registers are used exclusively for some particular purpose such as to store
addresses or to store results etc. Examples of special purpose registers are: the Program
Counter, memory Address Register, memory Data Register, the Stack Pointer and the
Instruction Register.
For example, the Program Counter (PC) may contain the address of a memory location from
where an instruction has to be fetched.

 Program Counter (PC) - an incrementing counter that keeps track of the memory
address of which instruction is to be executed next.
 Memory Address Register (MAR) - holds the address of a memory block to be read
from or written to
 Memory Data Register (MDR) - a two-way register that holds data fetched from
memory (and ready for the CPU to process) or data waiting to be stored in memory
 Instruction register (IR) - a temporary holding ground for the instruction that has just
been fetched from memory

Notes By: ERAM ABBASI Page 12 of 16


Fall 2016 Introduction to Computer Technology

Stages of the execution of an instruction


 Fetch
 Decode
 Execute
 Result Store

Notes:
The execution of an instruction consists of several phases.
In the first phase of instruction execution, fetching corresponds to the reading of an
instruction from memory.
The second phase is to decode the instruction to find out what is to be done and what
operands are required.
The next phase corresponds to reading operands from memory or a register and presenting it
to the ALU. The next stage is to perform the execution of the instruction after knowing what
operation(s) is/are to be performed and having made the operands available. The result of
the execution is to be stored in memory location or register specified in the instruction.

Main Memory
 Electronic storage of data
 Provides fast access to data at electronic speed
 The program is stored in the main memory while under execution
 Data is stored in words of fixed size each consisting of several bits
 An address is associated with each piece of data
 Two classes of main memory:
 Random Access Memory (RAM)
 Read Only Memory (ROM)

Notes:
Primary storage is a circuit operating at fast electronic speeds. A program is stored in the
main memory while under execution. It consists of a large number of semiconductor storage
cells, each capable of storing one bit of information. A sequence of bits form a word which
can be stored or retrieved in one basic operation. An address is associated with each word.
In Random Access Memory (RAM), any word can be accessed in a short fixed amount of
time called Memory Access Time. RAM can be read as well as written during the execution
of a program. In Read Only Memory (ROM), memory can only be read during the
execution of the program. One important use of ROM is to store the start-up code to load
the operating system.

Input Unit
 Input Unit takes input from external sources
 Some of the input devices are
 Keyboard
 Mouse
 Joystick
 Secondary storage devices
The input unit accepts input from the user. It is connected with one or more input devices
such as keyboards, mice, joysticks etc.

Notes By: ERAM ABBASI Page 13 of 16


Fall 2016 Introduction to Computer Technology

Output Unit
 Transmits the output from the processor to the external world
 Some of the output devices are:
 Display
 Printer
 Secondary storage devices

An output unit is needed to transmit the results of computation to the external world. It is
connected with one or more of the output devices like the printer, display, plotter etc.

Input Devices
 Keyboard : looks similar to a typewriter
 For a key, press the corresponding letter or digit which translates into a code
 through a keyboard controller
 The code goes to memory or processor under the program control
 Mouse:
 Graphic input device
 Storage Devices:
 Disks
 Tapes
 CD ROMs

Storage devices are typically capable of performing both input as well as output functions.
CD-ROM devices are, however, an exception to this and are typically used for a Read Only
storage.

Output Devices
 Printer
 Prints characters or graphics on paper
 Some common types of printers are:
 Dot matrix printers using mechanical impact heads
 Laser printers
 Ink jet printers
 Video Display
 Uses Cathode Ray Tubes (CRT)
 Can be monochrome or color
 Resolution of ray provides clarity in display

Secondary Storage Devices


 Used both for input and output
 High capacity and cheaper storage devices
 Some examples of secondary storage devices: hard disks, floppy disks,
magnetic tapes and CD-ROMs
 However certain devices are only read, such as CD-ROMs
Secondary storage devices are high capacity, cheap storage devices, used to store large
amounts of data, programs and documents. The information stored on these devices is
transferred to the main memory through the program control when needed.

Notes By: ERAM ABBASI Page 14 of 16


Fall 2016 Introduction to Computer Technology

Bus Structures
 A bus is needed for the transfer of data and control of information
 All bits of single words are transferred through a parallel mode on a bunch of
wires (one wire for each bit)
 This bunch of wires (BUS) connects several devices
Notes:
A computer consists of various devices. These devices need to communicate with each
other. For this reason there is a bus between these devices. Using a bus, each device can
communicate with the other through a parallel mode provided that every device is engaged

in only one communication. However, using this topology, the buses will be idle most of the
time because all devices do not need to communicate with other devices all the time. This
results in a very complex and expensive network.
The simplest way is to use a single bus to connect all the units. Whenever a device wants to
communicate with another device (or a bunch of devices in the broadcast mode), it gets hold
of the common bus by sending appropriate requests and loads its data on the common bus
from where other device(s) can accept the data

Single Bus Organization

Input Output CPU Memory

BUS

 At any instant, at least two units will be active for data transfer. Only one of them
can output on the bus

Notes:
The single bus organization while very simple to understand and implement, is not
sufficient.
Very often, a number of the devices need to output their data on the bus, but have to wait for
their turn. The single common bus therefore, becomes a bottleneck in fast computation. We
have to be very careful that at any given instant, at most one of the devices outputs on the
bus. We will see later in this course, how we can use multiple buses to improve the
performance and speed of computation.

Devices
 Various devices connected with the bus vary in their speeds
 A fast device will have to wait for data from a slow device
 Buffered data transfer increases efficiency
 Data transfers from a fast device to the buffer of a slow device at a high speed
 Slow devices can use data from the buffer at their own speed
 A fast device need not wait for a slow device
Notes By: ERAM ABBASI Page 15 of 16
Fall 2016 Introduction to Computer Technology

Notes:
Since various devices connected with the bus vary in their speeds, the direct transfer
between two units may not be efficient. A fast device will have to wait for the data or an
acknowledgment from the slow device. Buffered data transfer is used to increase the
efficiency in such cases. The data is transferred from a fast device to the buffer of a slow
device at high speed. The slow device can use the data from the buffer at its own speed
avoiding the delay arising from the fast device waiting for the slow device.

Summary of the operation of a computer


 Accepts information as programs and data through the input unit and stores it in
memory
 Information stored in memory is fetched, under program control, into the
arithmetic and logic unit, where it is processed
 Processed information leaves the computer through an output unit
 All activities inside the machine are directed by the control unit

Classification of Computers
 Personal Computers: Desktop computers, Notebook computers
 Workstations
 Mainframe Computers
 Minicomputers
 Supercomputers

Notes:
There is no formal classification of computers as shown above. However, the classification
can be done roughly as follows:

Personal Computers can be used generally by a single person at any time.


Desktop computers are personal computers that are small enough to be put on the table.
Notebook computers use even smaller integration and can be operated using batteries and
carried around in a small bag.
The difference between a personal computer and a workstation lies primarily in the
processing power, graphics capabilities and better resources to run powerful applications.
However, with changes in PC technology, such differences are narrowing down.

Mainframe Computers are multi-user machines on which more than one person can work
at the same time.
Minicomputers are typically miniature versions of mainframe machines running a general
purpose operating system.
Supercomputers are very large computers with many powerful processors working
concurrently to solve large problems typically, running in a batch mode.

Notes By: ERAM ABBASI Page 16 of 16

Anda mungkin juga menyukai