Title: Computer Architecture
1Computer Architecture Operating System
- Architecture Functions of the different
hardware / organizational blocks of a Computer
System. Primarily described by its Instruction
Set Architecture ISA that consists of - - CPU Processing Capability, Speed etc.
- - Memory / Main Memory.
- - Assembly Language Instruction Set of the
CPU. - - Associated Operands.
- Operating System A System Software that helps
all type of users to operate a computer System.
2The Basic Features of a Computer
- It is a general purpose, user programmable, A
program Meaningful Group of instructions
written in a specific language aimed to do a
specific task. electronic gadget capable of
doing the following tasks - Data Processing (Numeric Non Numeric) with a
high degree of accuracy at a pretty high speed. - Storage of huge amount of information with
reasonably high access speed (Information Bank). - Communication Gateway Link to the World.
3Computer Vs. Electronic Organizer
- User programmability i.e. any user can write a
program in a computer to tune/control the way
computation is done . Like do not divide if the
divisor is 0 can be achieved through programming
in a computer but such a thing cannot be achieved
in a calculator /organizer. - Connectivity to other computers and various
peripherals is readily available in any computer. - One can easily upgrade any Computer by installing
new packages / connecting more upgraded
peripherals, enhancing memory etc.
4Data Processing Activity of any Typical Computer
(done by executing some program)
- Ordinary Arithmetic Operations.
- Logical Operations like comparing two items.
- Special type of arithmetic operations like
addition of two very very large integers
(achieved through Special Application Programs)
. - Manipulating floating point numbers.
- Sorting of Data like preparation of merit list.
- Manipulating Pictures Graphics.
- Multimedia ( Audio, Video, Graphics , Video Games
etc.) Manipulations. - Ability to create, format, send receive
messages.
5The Typical Computer Organization The
Constituent Hardware Blocks
6Computer Organization Various Parts - 1
- Peripherals/ Peripheral Devices All those
Devices that lie in the Periphery of the CPU. All
Peripheral Devices are connected to the CPU by
some way and are controlled by the CPU through
some system program. - Remote Devices Those which are far away from
the current CPU/ Computer System possibly
connected through Network Not shown here .
7Input Peripheral Devices and their Functions (
Architectural Aspects)
- These are employed to feed data , program,
picture, commands to the Computer System. A few
commonly used devices are the following - Keyboard ( The earliest and still most commonly
used Input Device). To type in Commands and/or
Data Alphabets, Digits, Symbols etc. - The Mouse Commands are given by clicking its
left/right button. It works in a Graphic
Environment where user is given option to select
among several Options in a menu by moving mouse
button on to that item and clicking on that.
8Output Peripherals and their Functions- 1
- Output Peripherals are responsible for providing
some form of response/result to the user.
Commonly used Output peripheral devices are - Visual Display Unit (VDU) Screen / Monitor Is
used to display the following - Anything typed in via keyboard.
- The various menus available to the user.
- The response generated by the system to various
user commands in some way. - The result generated by running various programs/
packages.
9Output Peripherals and their Functions - 2
- 2. Printers Used to produce printed Outputs /
Hard Copy. Various types of printers - Impact Printers Where there exists a physical
printing Mechanism/ print head that strikes on
the paper ink ribbon to make an impression on
the Paper. These mostly print in Black . Examples
of such printers are Dot Matrix , Line , Band
etc. - Non Impact Printers Here there exists no
physical printing heads rather printing is done
by electronic/electrostatic mechanism that
regulate the flow of ink/toner which are electro
statically deposited on the paper. These can
print both in Monochrome (black) as well as in
Color. Commonly used printers are Inkjet, Desk
jet, Laser etc. - Graphic Printers like Dot Matrix, Inkjet, Desk
Jet, Laser can print both text as well as
pictures while Line Printer, Band Printer can
only print characters . But these are high speed
rugged compared to graphic printers .
10The Secondary Memory Functions
(InputLoadOutput Store)
- Acts as the Back up Store of the Computer System.
- Can be viewed as a Filing Cabinet for storing
Data , Program by the CPU Backbone of the File
System in any computer. - It represents the Non Volatile form of storage.
- As compared to main memory the secondary memory
represents slow, Large Capacity ( Theoretically
infinite Helps in building Virtual Memory) ,
relatively cheap medias like the following - Magnetic Medias like Fixed / Winchester Hard
Disks or Removable Media like Floppy, Tape , DAT
etc - CD /DVD ROMs ( Read only) , CD/DVD-R
(Recordable in a place once only ), CD/DVD-RW
(Rewritables) all removable. - It represents infinite capacity storage because
of the existence of removable media components.
11The Functions of Main/ Physical Memory
- Acts as the brain of the Computer System.
- Stores inputted commands, data, program as well
as intermediate final results. - CPU stores data into it and retrieves data as
well as Instructions from it . - It is composed of several locations , each
location size is normally one byte or its integer
multiple . (1 byte 8 Bits 1 Character). - It is finite sized ( typical capacity 256
Mbytes(MB) ), Electronic , Volatile and Random
Access Time taken to access any location is
identical and relatively costly. - The main memory can be viewed as a very large
sized , one dimensional matrix /array, a column
vector. Time taken to access any element/location
happens to be the same . - Some part of it is non volatile (Read Only Memory
ROM ) some of it is Read Write Memory RWM
commonly termed as RAM (Random Access Memory). - Now a days Main Memory is connected to the CPU
through a high speed electronic Memory known as
the Cache Memory.
12 Features of an Electronic Memory
13An Electronic Memory Location Its Content
- Memory is shown here as a Group of Mail Boxes
i.e. each location is a Mail Box used to hold a
byte ( 8 bits ) of data . - Lets assume each binary digit ( one bit ) is a
single mail envelopes hence each location / mail
box can hold eight (8) bits or eight different
envelopes . - Each byte can assume one of 256 different values
since using 8 bits one can represent 2 8 256
different values. - Each mail box has a unique numeric identifier
which denotes its address. Note the addresses
shown in the previous slide e.g. box. No. 0 , 1,
2 etc. - Each address can hold any one of 256 values as
data as has been depicted.
14An Electronic Memory Location (an Inside View)
- Each Location of any Electronic Memory (usually
one byte / 8 Bits) is actually implemented by
using a parallel in parallel-out (PIPO)
Register composed of 8 no. of D F/Fs. - The Addressing Mechanism is implemented using
Address Decoder. - The Data Read Signal is actually achieved
through Output Enable (OE) signal . - The Data Write Signal represents the Write Clock
/ the Clock of the D F/Fs (all tied together) .
15Byte Organized Memory Vs. Multi Byte CPU
- Main Memory is byte organized (normally).
- Modern day CPUs can handle multi byte words
(usually integral multiples) say 4 bytes. - In such a case one of the two following storage
pattern is followed - 1) Little Endian Lower Memory Address holds
lower order byte. Intel Convention . - 2) Big Endian Lower Memory Address holds
Higher Order byte.
16Storage Pattern of n X 8 bit ( n an integer)
Data, in Byte Organized Memory
- Example n 4 i.e. 32 bit Data
- 32 bit Data Word A2 24 3C 4B 8 Hex Digits
- 4 byte Memory Block starting from A000 0000 (32
bit Address) - Address Content in Hex
- in Hex (Little Endian) ( Big
Endian ) - --------------------------------------------------
-------------------- - A000 0000 4B
A2 - --------------------------------------------------
-------------------- - A000 0001 3C
2 4 - --------------------------------------------------
-------------------- - A000 0002 24
3C - --------------------------------------------------
-------------------- - A000 0003 A2
4B - --------------------------------------------------
--------------------
17The Functions of the CPU
- The CPU ( Central Processing Unit) performs
the following tasks by executing Instructions of
some specific program stored in Main Memory. - 1) Controlling all peripheral devices.
Relevant Device Driver Program(s). - 2) Communicating with all types of Remote
Devices. - Network Protocol Program
- 3) Recognizing user commands Operating
System (O.S.) . - 4) Inputting Data Device Driver invoked by
the O.S.. - 5) Producing Output (on screen /or on
printer) after obtaining Data from
Main/Secondary Memory.Device Driver thro O.S. - 5) Performing arithmetic logical
operations. As per Specified Instruction(s) of
the executing program
18The CPU Performance Parameters - 1
- N.B All the activities of any CPU are being
carried out by executing some machine level /low
level instruction. - 1. CPU Speed Each instruction takes a
definite time to complete execution. This time is
measured in terms of the Number of CPU Clock
Periods needed to execute that instruction ( The
Instruction Latency). Hence one way to measure
the CPU speed is Number of Instructions executed
/ second (termed as the Throughput) . Typical
unit is MIPS (Millions of Instructions per
second) or MFLOPS (Millions of Floating point
Operations performed per second.) However one
normally finds the CPU Clock frequency as rough
estimate of its speed i.e. higher the clock
frequency higher will be the CPU speed. But in
actual terms speed will be affected depending on
the most frequently used instructions hence the
Throughput happens to be a more fair estimate of
the CPU speed estimated by executing some
benchmark programs . -
19The CPU Performance Parameters - 2
- 2. CPU Processing Power The Operand Size (in
bits) it can handle at one go i.e. in a single
machine instruction normally. This is directly
related to its ALU ( Arithmetic Logic Unit a
purely combinational Circuit) width. - e.g. Pentium is a 32 Bit CPU ? Any Machine
level instruction of a Pentium Processor can
handle 32 bit operands or Pentium contains 32
bit Integer ALUs. - N.B This Operand Sized based classification is
interesting in the sense that any n bit CPU can
also be used to handle larger sized data provided
one writes proper programs to achieve that which
gets translated into n bit processing
instructions by the Translator Program (The
Compiler).
20Computer Organization 2 (Slightly Detailed View)
21Computer Organization (Other Parts - 1)
- MMU Memory Management Unit acts as the
interface interconnection block between the CPU
and the Memory System.It helps to manage the
finite sized main memory in such a way that it
appears to the user as an Infinite Sized High
Speed Memory. - Cache Memory A high speed partly content
addressable memory which represents a high speed
window of the Main Memory. Its typical size
happens to be 256 KB. CPU normally accesses the
Main Memory through the Cache Memory (look
through configuration). It does not add up to the
main memory space in any way.We shall however
initially assume that this Cache Memory is
transparent till it is formally introduced later.
22Computer Organization (Other Parts - 2)
- DMA Direct Memory Access Controllers used by
some peripherals to Interact with the Memory
bypassing the CPU (sometimes required for very
high speed access of memory). - I/O Controllers Acts as intermediary /
interface between the CPU and diverse types of
peripheral devices enabling the CPU to treat
every peripheral device in the same way. - N.B (1) The Secondary Storage Peripherals are
also termed as I/O Peripherals. - (2) Each of these above controllers
does possess some form of local memory /
registers termed as buffers as well as local
controllers. - (3) DMA happens to be one particular
type of I/O Interface Mechanism .
23Some Key Observations - 1
- Most of the peripheral devices helps in
establishing human interface to the computer
System (mainly CPU Memory). - Each of the peripheral differs in
characteristics from each other as well as from
the electronic parts (CPU Memory) in terms of
electrical features and operating speed. - Some kind of programs are required to control
all the various peripherals (Device Drivers) . - Users interact with any computer either by some
command or alternately by mouse click . Hence
some form of command interpreter or Graphic User
interface GUI is needed . - These device driver programs as well as Command
Interpreter GUI forms part of the existing
Operating System . -
24Some Key Observation - 2
- All peripherals must possess the following things
- a) An Electronic Peripheral Interface.
- b) Each Peripheral Interface must
possess the following - 1) Electronically addressable
Command Register (Write Only). - 2) Electronically addressable
Status Register (Read Only). - 3) Electronically addressable
Local Store / Buffer (Read/Write).
25Some Key Observation - 3
- CPU External World (Memory / Peripheral )
Interface - 1) CPU must be able to address each
device interface as well as each memory location.
This Address is sent via a group of electrical
lines / PCB Tracks termed as the Address bus. - 2) CPU sends / receives data to /
from the device interface memory through a
separate group of lines termed as Data Bus. - 3) CPU sends Command to / or reads
Device Status from the device interface / memory
via a 3rd group of lines known as the Control
Bus.
26The Computer Organization as we See
27The CPU-External World Connectivity
- Address Bus - Group of lines that is used to
carry address information from the CPU to the
concerned device(s). Address is one that helps
the CPU to select one among many devices. Hence
it is unidirectional. - Data Bus - The group of lines used to carry
data/information from the device to CPU vice
versa. It is always bi-directional. - Control Bus The group of lines that enables the
CPU to control various activities by sending
appropriate commands as well as monitor status of
the concerned device e.g. Read Signal, Write
Signal, Status Set Signal. - Each bus consists of a number of lines, which is
represented in a compact manner.
Bi Directional Bus composed of 32 Lines
32
28Typical WRITE Sequence CPU Storing Data to a
Memory Location/ Sending Data / Command to
Device Interface Register(s)
- Say CPU wants to Write Decimal Value 11 into
location / address 2 (Decimal) . - CPU sends (floats) 2 via its Address Bus. This
value 2 coming via address bus will select the
Memory Location/ Device Interface Buffer location
whose address happens to be 2 (Decimal). - CPU next sends value 11 via its Data Bus . The
CPU also asserts the Write Signal through its
control bus at the same time. This Write Signal
will write 11 (value sent via data bus) in the
location already selected by the address bus (2
here). - CPU waits for the Acknowledgement signal via its
Control Bus, from the written place before
proceeding with the next write. (necessary for
slow devices)
29Typical READ / FETCH Sequence CPU Loading Data
from Memory / Device Interface Registers OR
Fetching Instruction from Memory
- Say CPU wants to Read from the location whose
address happens to be 3 (Decimal) or 0000 0000
0000 0011 in 16 bit Binary. - CPU sends (floats) 3 via its Address Bus. This
value 3 coming via address bus will select the
Memory Location/ Device Buffer Location whose
address happens to be 3. - The CPU also asserts the Read Signal through
its Control Bus at the same time. This Read
Signal will read i.e. make available on the
data bus the value/ data content of the location
already selected by the address bus (3 here). - CPU next waits for the READY signal sent through
its Control Bus from the concerned Memory
Location/ Device interface buffer (a must for
slow device) before probing its Data Bus and then
it must store the data existing on the Data Bus
(READ from the location 3 ) into a relevant
storage place lying inside it CPUs local memory
store . This local memory store inside any CPU
is termed as REGISTER. Several Registers may
exist inside any CPU. Some of them are special
purpose while others are general purpose
registers GPRs .
30The Actual Scenario - 1
- Each every CPU works by executing some
pre-written , stored programs . Some of these
programs like Editor, Operating System,
Translator( Compiler/Assembler), Linking Loaders
System Programs are not written by the
ordinary users but are already written and
maintained by the System Programmer(s).Other
Programs are termed as Application Packages. - These System Programs as well as some
application packages are preserved as executable
files in the secondary memory / Non Volatile
Store. - However , in order to be executed, any
executable file will have to be brought into the
volatile main memory. - Power on self test Program as well as some of
the device driver programs like Keyboard Driver ,
Display Driver and Disk Read/Write Drivers are
needed immediately after power on , hence these
needs to be available in some non volatile,
unalterable section of the electronic main memory
ROM.
31The Actual Scenario - 2
- In order to execute any program CPU has to
execute its instructions stored in main memory
one by one. - Before execution CPU will have to read/ fetch
the instructions inside some of its register
from main memory. - Any activity inside the Computer System will have
to be initiated by the CPU in accordance with an
instruction execution. - Respond to any user command , peripheral control
communications are done by the various modules
of the Operating System O.S. program. - The Operating System modules initially starts
running and subsequently are invoked from within
some user program by system call (via software
interrupt) , exceptions OR through
device/hardware interrupts.