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:
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
Basic Concepts
What is a PC?
PC is the abbreviation for the words Personal Computer.
PC
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.
What is a PC?
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
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.
Input/Output interface is the component which interacts with the user (that is,
us).
Input / Output
Comprises of
Input devices
Keyboard
Mouse
Output devices
Monitor
Printer
Bi-directional devices
Hard disk drives
Floppy disk drives
CPU
Input
MEMORY Output
I/O
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.
Input
CPU 1
Output
CPU 4
I/O
Memory
Data access 3
from hard disk 2
Hard Disk is not possible
Hard Disk
35% of a
6% of an year
hour
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:
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.
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:
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.
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.
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.
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:
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.
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
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
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.
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:
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.