Professional Documents
Culture Documents
Computer Architecture-Word Press
Computer Architecture-Word Press
VI SEMESTER
STUDY MATERIAL
CS6303
COMPUTER ARCHITECTURE
ANNA UNIVERSITY
REGULATION 2013
UNIT 1 – OVERVIEW AND INSTRUCTIONS 10. _What is an instruction and instruction set? U
PART – A Instruction is a part of code, written in step-by-step
1. List the eight ideas invented by computer architects procedure for the CPU to complete a certain task N
Design for Moore’s Law Instruction set is a set of instructions to be executed by the
Use Abstraction to simplify Design compiler, that contains all the details of the tasks I
Make the common case fast Ex for Instruction set:-
Performance via Parallelism Arithmetic instructions Ex: (ADD, SUB) T
Performance via Pipelining Logic instructions Ex: (AND, OR, NOT)
Performance via Prediction Data transfer instructions Ex: (MOVE, LOAD, STORE)
Hierarchy of memories Control flow instructions Ex: (GOTO, CALL, RETURN)
11. What is instruction format?
Dependability via redundancy 1
2. What is pipelining? The format in which the instructions are written is called as
Pipelining is a set of data processing elements connected in Instruction format
series, where output of one element is the input of next element. Each instruction has three fields.
3. What are the major hardware components? OPCODE It specifies which operation is to be performed.
Input Unit (Keyboard, Mouse, etc.) MODE It specifies how to find effective address.
ADDRESSIt specifies the address in memory/register
CPU (Memory Unit, ALU, Control Unit)
OPCODE MODE ADDRESS
Output Unit (monitor, printer, speaker, etc.)
4. What is CPU and ALU?
12. What are the different logical instructions?
CPU: Central Processing Unit
INSTRUCTION EXAMPLE Equivalent to
It is also called as brain of the computer
Input and Output devices work according to the CPU AND AND $1, $2, $3 $1 = $2 & $3
ALU:- Arithmetic Logic Unit OR OR $1, $2, $3 $1 = $2 | $3
It performs arithmetic and Logical operations NOR NOR $1, $2, $3 $1 = ~ ($2 | $3)
It is present inside the CPU ANDI AND $1, $2, imme $1 = $2 & imme
ORI OR $1, $2, imme $1 = $2 | imme
It uses main memory for operations (RAM)
5. What is control unit? SHIFT LEFT SLL $1, $2, 10 $1 = $2 << 10
It is present inside the CPU SHIFT RIGHT SRL $1, $2, 10 $1 = $2 >> 10
SHIRT RIGHT SRA $1, $2, 10 $1 = $2 >> 10
It controls the operation of input unit, output unit and ALU
ARITHMETIC
It has the overall control of the computer
It tells memory unit to send/receive data
13. Write the different control operations.
It tells ALU what operation to perform Conditional branch:-
6. What is Response Time and Throughput? BEQ instruction Branch on EQual ( BEQ $s, $t, offset)
the time between the starting and ending of a task is BNE instruction Branch on Not Equal (BNE $s, $t, offset)
called as response time. It is also called as “execution Unconditional branch:-
time”. J instruction Jump (J target)
The total amount of work done in the given time is called JAL instruction Jump And Link (JAL target)
as Throughput JR instruction Jump Register ( JR $s)
7. What is CPU time?
Amount of time, the CPU spends for doing a task is 14. What is PC-relative addressing?
called as CPU time It is also called as Program Counter Addressing
It is also called as CPU execution time The address of the Data or Instruction is specified as an
Time of waiting for I/O is not included. offset, relative to the incremented Program counter.
CPU time spent in program (user CPU time) It is used in conditional branches
𝐶𝑃𝑈 𝑡𝑖𝑚𝑒 =
𝐶𝑃𝑈 𝑡𝑖𝑚𝑒 𝑠𝑝𝑒𝑛𝑡 𝑖𝑛 𝑂𝑆 (𝑠𝑦𝑠𝑡𝑒𝑚 𝐶𝑃𝑈 𝑡𝑖𝑚𝑒) Offset value can be direct or indirect value
8. Write down the formula for power consumed by CPU. Operand address = PC + Offset
The formula for finding the power consumed by CPU is, Ex: BEQZ $t0, strEnd
P = C V2 f BEQZ = Branch if EQual to Zero
Where,P=power, C=Capacitive loading, V=Voltage, f= frequency 15. State Moore’s law
9._What are multiprocessor systems? Give its advantages.
“Number of transistors per square inch, on Integrated Circuits
Computer systems that contain more than one processor are (IC) had doubled every year since the IC was invented”
called as Multiprocessor systems
“Computer architects should concentrate on, after the design
They execute more than one applications in parallel. is finished, where the technology will be. Don’t bother where
They are also called as shared memory multiprocessor s/m it has started”.
High performance, high cost, high complexity. 16. State Amdahl’s law
Advantages:- Improve the performance of common case, optimize rare case.
Improved cost-performance ratio Use common case for designing non-frequent cases.
High speed processing This method makes simple design and faster.
If one processor gets failed, other processors will This idea is called as Amdahl’s law.
continue work.
“Chase Your Dreams; Dreams Do Come True” – Sachin Tendulkar
CS6303 – COMPUTER ARCHITECTURE
Registers
In-board Cache Small, fast,
storage Main Memory costly
Plotter:-
They are used for printing graphics
They are used in CAD/CAM
Pen plotters take printout by moving a pen across the paper
SOFTWARE COMPONENTS
1.System Software
They are in-built within the computer system
They are essential for a computer to operate.
A computer cannot be run without them
They control and manage the hardware components
Software for Program Development Environment:-
Text Editor: To type the program and make changes.
Compiler: Converts High level language to machine code
Assembler: Converts Assembly level language to m/c code
Linker: Combines OBJ programs and creates EXE code
Debugger: To clear errors in EXE program
Software for RunTime Environment:-
OS: It operates the overall computer system
Loader: Loads the EXE file into memory for execution
Libraries: Precompiled LIB files that are used by other pgrms
Dynamic Linker: Load and Link shared libraries at run time.
2. Application Software:-
They are softwares necessary for problem solving.
Programs such as JAVA, Games, MS-Word, Dictionary,
Emulator, etc are the examples.
They are not necessary for a computer to operate.
They are optional; If user wants, he/she can install them.
UNIT 3 – PROCESSOR & CONTROL 9. What are the stages of MIPS pipeline?
IF : Instruction fetch from memory
UNIT
ID : Instruction Decode
Part – A EX : Execute the operation
MEM : Access the memory for an operand
1. How the performance of CPU is measured? WB : Write back the results in a register
Instruction Count: It is determined by Instruction Set
Architecture (ISA) and compiler. 10. Define hazard. Mention its types.
Cycles Per Instruction (CPI) and Clock cycle time: It is Any condition that makes pipeline to stall is called HAZARD
determined by the CPU hardware It avoids execution of next instruction in the instruction stream
Structural hazard: Two instructions use same resource at same time
2. Write the basic performance equation of CPU Data hazard: Data are not available at expected time in pipeline
Control hazard: branch decisions made before branch condition
CPU time = Instruction count X CPI X Clock cycle (or)
CPU time = (Instruction count X CPI) / Clock Rate
11. What is data hazard? Mention its types.
3. What is MIPS? Data hazard occurs when data are not available at expected
time in a pipeline
Million Instructions Per Second
Consider two instructions: I1 occurs before I2
It is a metric used to measure CPU performance
RAW: Read After Write: I2 reads before I1 writes it
It is defined as the ratio of Instruction count to the product
WAW : Write After Write : I2 writes before I1 writes it
of execution time and 106
WAR : Write After read: I2 writes before I1 reads it
MIPS = Instruction count / (Execution time X 106) U
12. What are the methods to handle Data hazard?
4. What are the types of Instruction in MIPS instruction set?
Forwarding: Result is passed forward from a previous
Memory reference instructions : Load word (LW), store word (SW)
Arithmetic logical instructions : ADD, SUB, AND, OR, SLT
instruction to a later instruction
Bypassing: Passing the result by register file to the desired
N
Control flow instructions : BEQ, JUMP unit
5. What are the steps involved in MIPS instruction execution? 13. What are the methods to handle control hazard?
Fetch instruction from memory
I
Stall the pipeline
Decode the instruction Predict branch not taken
Execute the operation
Access an operand in Data memory
Predict branch taken
Delayed branch
T
Write result into register
Part - B Adder:-
1. Explain the types of MIPS Instruction format. Increment the PC to solve next instruction
An ALU is connected to perform addition of its two 32bit
R-Format:- inputs, place result on its output
Opcode Rs Rt Rd SHAMT FUNCT
31-26 25-21 20-16 15-11 10-6 5-0 Registers:-
Also called as Register format It is a structure that contains processor’s 32 GPR
Because only registers are used They can be read / Written
Three register operands : Rs, Rt, Rd It contains 4 inputs (2 read ports + 1 write port + 1 writeData)
Rs, Rt source register It contains 2 outputs (two read data)
Rd Destination
SHAMT Shift And Move To ALU:-
FUNCT ALU functions (ADD, SUB, AND, OR, SLT) Input: two 32bits
Opcode for R-format = 0 Output: 32bit result
ALU control lines Function
000 AND Data memory Unit:-
001 OR Input: Address and write data
010 ADD Output: Read result
110 SUB
111 (SLT)Set on Less Than Sign extension Unit:-
Input: 16bit sign
I-Format:- Output: 32bit extended sign
Opcode Rs Rt Address
31-26 25-21 20-16 15-0 MUX:-
For Load/Store instructions It is also called data selector
o For LOAD, Opcode = 35 It allows multiple connections to the input of an element and
o For STORE, opcode = 43 have a control signal SELECT among the inputs.
o Rs Base register
o Rt For load, it is the destination register, for Building a data path:-
store, it is the source register
o Memory address = base register + 16 bit Fetch instructions:-
address field
For Branch Instructions
o For BRANCH, opcode = 4
o Rs, Rt source registers
o Target address = PC + (sign-extended 16-bit
offset address << 2 )
J-Format:-
Opcode Address
31-26 25-0
For Jump instructions, Opcode = 2
To execute any instruction, first the instruction is fetched
Destination address = PC [31-28] | | (Offset address < < 2 )
from memory
2. Explain Datapath and its control in detail. To prepare for executing next instruction, PC is incremented
(Or) by 4 bytes, which points to next instruction
Explain Datapath and its control implementation schemes Data path for R-Format instructions:-
for MIPS instruction formats with neat diagrams.
Data path:-
Data path is the pathway that data takes through the CPU
Data travels through data path; control unit regulates it
It consists of functional units that perform ALU operations
Functional Units of data path:-
Instruction memory:-
It is a memory unit to store instructions of a program and
Regiter File and ALU are needed additionally with previous
supply instructions
components.
Program Counter:-
ALU gets input from DataRead ports of register File
Program counter is defined as a register which is used to
store the address of the instruction in the program being Register file is written by ALUResult output of ALU with
executed RegWrite signal
ALU
Opcode ALUop Operation FUNCT ALU control
action input
LW 00 Load Xxxxxx Add 010
Word
SW 00 Store Xxxxxx Add 010
word
BEQ 01 Branch on Xxxxxx Sub 110
Equal
R-Type 10 ADD 100000 Add 010
Data memory unit and Sign extension unit are needed additionally
R-type 10 SUB 100010 Sub 110
Three register inputs are read from instruction field
R-Type 10 AND 100100 AND 000
Memory address is calculated based on instruction field
For Load, data at memory address is read from data memory R-Type 10 OR 100101 OR 001
For store, write data is written into data memory R-Type 10 Set On 101010 SLT 111
Less Than
Data path for Branch/Jump instructions
Truth Table for Three ALU control bits:-
1
Get operands from register file, based on Src reg num
Perform ALU operation using ALUSrc=0
ALUop
0
WB to destination register(regWrite=1, RegDst=1)
Branc
h
1
Write
Mem
0
Read
Mem
0
Write
Reg
0
Memto
Reg
X
0
1
ALUsr
c
0
RegDs
X
1
0
t
format
ction
BEQ
Example:-
Consider the following instructions:-
LW R1,100(R0)
LW R2, 200(R0)
LW R3, 300(R0)
Without pipeline:-
Stages of pipeline:-
IF : Instruction fetch from memory
ID : Instruction Decode
EX : Execute the operation
MEM : Access the memory for an operand
WB : Write back the results in a register
Delayed branch:-
Instruction Execution:-
Write Back:-
UNIT 4 – PARALLELISM 5. Define parallelism. What are its goals? Mention its types.
Parallelism is defined as the process of doing multiple
PART – A operations at the same time.
Goals:-
1.. Distinguish between strong scaling and weak scaling. o Speed up the processing, increase the speed.
o Increase the throughput
Strong scaling Weak scaling
o Improve the performance
Strong scaling means, at a Weak scaling means, the
Types:-
constant problem size, the time to solve a problem with
o Instruction level parallelism
parallel speed up increases increasing size can be held
o Task parallelism
linearly with the number of constant by enlarging the
o Bit-level parallelism
processors used. number of processors used.
6. What is ILP? What are the approaches to exploit ILP?
It is limited by Amdahl’s law. It is limited by memory. The technique which is used to overlap the execution of
instructions and improve performance is called as Instruction-
Level-Parallelism
2.. Distinguish between UMA and NUMA Approaches:-
UMA NUMA o Dynamic hardware intensive approach
It is a type of shared memory It is a type of shared memory o Static compiler intensive approach
architecture. architecture.
All the processors are identical, All the processors are identical, 7. Define Loop level Parallelism
connected to a network, have connected to a network, have The common way to increase the amount of parallelism
equal access to all memory individual memory units available among instructions is, to exploit parallelism
regions. attached to it. among iterations of a loop. This is called as Loop-level
They are also called as They are also called as parallelism.
Symmetric Multi-Processor Asymmetric Multi-Processor U
machines (SMP). machines (AMP) 8.. What are the types of dependencies?
M . .M. . . . . . . . . M
Data dependence N
Bus interconnection n/w
Name dependence
Bus interconnection n/w M
. . M. . . . . . . . M
Control dependence I
P P P P P 9. What are the types of Data hazard? T
RAW (Read After Write)
WAW (Write after Write)
3.. What is Flynn’s classification? WAR (Write after Read)
Flynn has classified parallel computer architectures 4
based on number of concurrent instructions and data 10.. Define IPC
streams Inter process communication is defined as a set of
They are: SISD, SIMD, MISD, MIMD programming interfaces that allow a programmer to
coordinate activities among different program processes
Name Full form No.of No.of No.of data that can run concurrently in an operating system.
processor instruction stream It allows the program to handle many user requests
SISD Single 1 1 1 concurrently.
Instruction
Single Data
SIMD Single N 1 N
11.. Mention the three ways to implement Hardware MT
Instruction Coarse-grained Multi-threading
Multiple Fine-grained multi-threading
Data
Simultaneous Multi-threading (SMT)
MISD Multiple N N 1
Instruction
Single Data 12. Mention the advantages of multi-threading
MIMD Multiple N N N To tolerate latency of memory operations, dependent
Instruction instructions, etc.
Multiple
Data To improve system throughput by exploiting TLP
To reduce context switch penalty
4.. Define Multi-threading.
The ability of a CPU or a processor to execute multiple 13. What are multi-core processors? Give its applications.
processes or threads concurrently is called as Multi- A multi-core processor is a single computing component
threading that contains two or more distinct cores in the same
It allows multiple threads to share the functional units of package.
a single processor in overlapped fashion. Applications: General purpose, embedded systems,
Networks, Digital Signal Processing, Graphics.
PART – B MISD:-
1. Explain the Flynn’s classification of parallel computer Multiple Instruction, Multiple Data
architectures with neat diagrams. MULTIPLE INSTRUCTIONS are executed on SINGLE
Flynn proposed a concept for describing a machine’s DATA streams by multiple processors
structure based on stream. Ex: Pipelined Architecture
Stream means a sequence of items
There are two types of streams:-
o Data stream (Sequence of Data)
o Instruction stream (Sequence of instructions) Control Unit CPU1
Purpose:- Advantages:-
To tolerate latency of memory operations, dependent More threads execute concurrently
instructions, etc. Best processor utilization is done.
To improve system throughput by exploiting TLP High performance is achieved
To reduce context switch penalty Disadvantages:-
Three ways to implement HMT:- Highly complex task for software developers to develop
Coarse-grained Multi-threading the software to implement SMT on the given hardware
Fine-grained multi-threading Security problem is also there. Intel’s hyper-threading
Simultaneous Multi-threading (SMT) technology has a drawback. On a system with many
i) Coarse-grained multi-threading:- concurrent processes, from one process, one can steal
When a thread is stalled due to some event, switch to a the login details which is running in another process.
different hardware context. This is called as coarse- Illustration:-
grained multi-threading
It is also called as switch-on-event multi-threading
Advantages:-
o It eliminates the need to have very fast
thread-switching
o It does not slow down the thread because
the instructions from other threads issued only
when the thread faces a costly stall.
Disadvantages:-
o Since the CPU issues instructions from one
thread, when a stall occurs, the pipeline
must be emptied or frozen
o New thread must fill pipeline before Superscalar Course-grained Fine grained SMT
instructions can complete
ii)Fine-grained multi-threading:- Thread 1
Thread 2
Switch to another thread in every cycle, such that no two
instructions from the thread are in pipeline concurrently Thread 3
It improves the usage of pipeline by taking advantage of idle
multiple threads
Advantages:- 3. What is ILP? Explain the methods to enhance the
o No need to check dependency between performance of ILP.
instructions because only one instruction is in Definition:-
pipeline from a single thread. The technique which is used to overlap the execution of
o No need for branch prediction logic instructions and improve performance is called as Instruction-
o Bubble cycles are used for executing useful Level-Parallelism
instructions from different threads Principle:-
o Improved system throughput, latency, There are many instructions in code that don’t depend on
tolerance, usage. each other so it’s possible to execute those instructions in
Disadvantages:- parallel.
o Extra hardware complexity is created, Build compilers to analyse the code
because many hardware contexts are there, Build hardware to be even smarter than that code
many thread selection logic is there Approaches:-
o A single thread performance is reduced Dynamic and hardware intensive approach:-
o Resource Conflicts are created between the o It depends on hardware to exploit the
threads parallelism dynamically at run time.
iii)Simultaneous Multi-threading(SMT):- o It is used in desktop, server and in wide range
Intel introduced SMT in 2002 (Intel Pentium IV – of processors.
3.06GHz) o Ex: Pentium III and IV, Athlon, MIPS
It uses resources of a dynamically scheduled processors R10000/12000, Sun UltraSPARC III, PowerPC
to exploit ILP 603, Alpha 21264
At the same time, it exploits ILP, It converts TLP into ILP Static and compiler intensive approach:-
It also exploits following features from latest processors: o It depends on software technology to find
o Multiple functional units: latest processors parallelism statically at compile time.
have more functional units for a single thread o It is used in embedded systems
o Register renaming and dynamic o Ex: Intel IA-64 architecture, Intel Itanium
scheduling: multiple instructions from
independent threads can co-exist and co-
execute
UNIT 5 – MEMORY & I/O SYSTEMS 8. Define TLB. What is its purpose?
PART – A Translation Look-aside Buffer
1. Differentiate between volatile and non-volatile memory. It is a cache memory.
Volatile memory Non-volatile memory The page table in main memory is placed in the main
Memory that loses its Memory that does not lose its memory, but a copy of its small portion is placed within
contents when the computer contents when the computer Main memory Unit. This is called as TLB
is switched OFF is called as is switched OFF is called as It contains page table entries of most recently accessed
Volatile memory non-volatile memory pages and their virtual addresses.
We need to refresh main We need not to refresh main It can contain 32 page table entries
memory content periodically memory content periodically TLB coupled with a 4KB page size, covers 128KB
Ex: RAM Ex: ROM memory addresses
9. What is DMA?
2. Differentiate between SRAM and DRAM. Direct Memory Access
SRAM DRAM Transferring a large block of data directly between an
Static Random Access Memory Dynamic Random Access external device and main memory is called as DMA
Memory External device controls the data transfer
Information is stored in one bit Information is stored as External device generates address and control signals
cell, called as Flip Flop charge across capacitor to control data transfer.
Information is erased if power Information is not erased if This external device which controls the data transfer is
is switched OFF power is switched OFF called as DMA controller.
We need not to refresh We need to refresh memory 10. Define interrupts
memory periodically periodically The event that creates interruption is called as interrupt.
Less packaging density High packaging density Special routine that is executed to service the interrupt
More complex hardware Less complex hardware is called as Interrupt service
More expensive Less expensive It is an external event that affects the normal flow of
execution.
3. Define locality of reference. It is caused by external hardware such as keyboard,
Instructions in localized area of the program are mouse, printer, etc
executed repeatedly during some period, and remaining 11. What is exception? What are the types of exception?
of the program is not accessed frequently. An interrupt stops the currently executing program and
This is called as locality of reference starts another program.
Reference is within the locality = Locality of reference This interrupt is created by external hardware.
Ex: simple loops, nested loops Like this, many events can create interrupts.
4. What are the types of Locality of reference? All these type of events that stops current program and
Temporal Locality of Reference (locality in time) creates new program is called as exception.
o Recently executed instructions are likely to be Types: Faults, Traps, Aborts.
executed again Faults: exceptions that are detected & serviced before
o Ex. Loops, Reuse execution of an instruction that creates problem
Spatial Locality of Reference (locality in space) Traps: exceptions that are reported immediately after
o Instructions stored near to the recently execution of instruction that creates some problem
executed instructions are also likely to be Aborts: Exceptions that does not allow execution of an
executed again. instruction that creates problem.
o Ex: straight line code, array access. 12. What are the features (or) functions of IOP?
5. What are the techniques to improve cache performance? IOP can fetch and execute its own instructions
Reducing the miss rate: Reduce the chances of two Instructions are specially designed for I/O processing
different memory blocks fight for same cache location 8089 IOP can perform data transfer, arithmetic and
Reducing the miss penalty: Add additional level to the logical operations, branches, searching, translation.
hierarchy called as multi-level caching. It also performs I/O transfer, device set up, programmed
6. What is the formula for calculating CPU execution time? I/O, DMA operation.
CPU = (CPU clockCycles+memoryStall clock cycles) It can transfer data from 8-bit source to 16-bit destination
execution x clock cycle time
It supports multiprocessing environment
time
13. Differentiate between programmed I/O and DMA
7. Define virtual memory.
programmed I/O DMA
Virtual memory is defined as a technique that is used to
Software controlled data Hardware controlled data
extend the size of the physical memory.
transfer transfer
In virtual memory concept, Operating system moves the Data transfer speed is low Data transfer speed is high
program and data between main memory and
CPU is involved in transfer CPU is not involved in it
secondary memory.
No controller is needed DMA controller is needed
It is also called as imaginary memory. During transfer, data goes During transfer, data does not go
-Main memory acts as cache for secondary memory. through processor through processor
“Chase Your Dreams; Dreams Do Come True” – Sachin Tendulkar
CS6303 – COMPUTER ARCHITECTURE
Reading “1”
from DRAM cell
DDR SDRAM:-
Fastest version of SDRAM
DDR Double Data Rate
SDRAM performs operations on rising edge of the clock
signal
But DDR SDRAM performs operations on both the
edges of clock signals
The bandwidth is doubled in DDR PROM:-
It is also called as faster SDRAM Programmable ROM
Two banks of cell arrays are there in DDR SDRAM It has diodes in every bit position
It is dual bank architecture Output is initially all 0s
Each bank can be accessed separately Each diode has fusible series link.
Nowadays, DDR version II and III is released By addressing the bits and applying proper current pulse
at output, we can blow out that fuse, store “1” at that bit
Fuse is made up of nichrome
For blowing, pass 20 – 50 mA current for 5 – 20 µs
This blowing occurs according to truth table of PROM
PROM programmers can do it programmatically
That is why the name is called as PROM
They are one-time programmable, once programmed,
information cannot be erased.
EPROM:-
Erasable PROM
They use MOS circuit
They store 0s and 1s as a packet of charge in IC.
They also can be programmed by EPROM programmers
We can erase the data in it, by exposing the chip to UV
light through quartz window for 15 – 20 mins
We cannot erase selective information, all information
will be vanished.
It can be re-programmed and re-used many times
EEPROM:-
It also uses MOS circuit
Data is stored as: CHARGE or NO CHARGE
20 – 25 V charge is used to move charges
We can selectively erase information
They are expensive than ROM
Flash memory:-
ROM:-
They are RW memories (both READ and WRITE)
They can store the data even after power is OFF
We can read contents of a single cell, but can write whole
We cannot write data to it block of cells
Non-volatile memory It is based on single transistor controlled by trapped charge
It is used to store binary codes They have higher capacity, less power consumption
It contains only Diode and decoder It is suitable for Laptop, tablets, smartphones, iPod, etc.
Address lines A0 and A1 are decoded by 2 : 4 decoder Types: Flash card (memory card) 1 GB to 64 GB
Flash drive(pen drive) maximum 64GB capacity
Page Translation:-
5. Explain the purpose and working of TLB with a diagram. 6. Explain the Programmed I/O data transfer technique.
7. What is DMA? Explain DMA cycles and configuration with Data transfer is monitored by DMA controller, which is also
neat diagrams. called as DMA channel
It comes under hardware controlled data transfer When CPU wants to read or write a block of data, it issues a
An external device is used to control the data transfer command to the DMA module, with these instructions:-
External device generated the address and control R/W operation
signals to control the data transfer Address of I/O device involved in this operation
It allows the peripheral device to directly access the Starting address in memory to read or write
memory No. of words to be Read/Written
This technique is called as DIRECT MEMORY DMA channel:-
ACCESS
That external device that controls the data transfer is
called as DMA CONTROLLER
Adv-Independent priority
Due to the separate pair of bus request and bus grant
signals, arbitration is fast
Arbitration is independent of number of masters in the
system
Disadv-Independent Priority
It requires more bus request and bus grant signals
Distributed arbitration:-
All devices participate in selection of next bus master
Adv:-
Each device on bus is assigned a 4bit ID
It offers high reliability because operation of bus is not
The number of bits in ID depends on number of devices dependent on any single device.
When one or more devices request for bus control, they
assert START-ARBITRATION signal and place their 4bit ID 10.What are Interrupts? Explain the Interrupt hardware in
on arbitration lines, ARB0 to ARB3 detail with necessary diagrams.
More than one device can place their 4bit ID to indicate that Interrupts:-
they need control of bus An External event that affects the normal flow of instruction
If one device puts 1 on bus line, another device puts 0 on execution generated by the external hardware devices such
same bus line, bus line status will be 0 as keyboard, mouse, etc is called as interrupts
Device reads status of all lines through inverter buffers, so Ex: computer should response to keyboard, mouse, etc
device reads bus status 0 as logic 1 when they ask something.
Device having highest ID, has highest priority If a device wants to tell processor about the completion of
When two or more devices place their ID on bus lines, it is an operation, it sends a hardware signal,, that signal is
necessary to find highest ID from status of bus line called as Interrupt
For example, consider two devices A and B having ID 1 and A special Routine that is executed to give service to the
6, request for bus interrupts is called as Interrupt Service Routine (ISR)
Device A puts bit pattern 0001, device B puts 0110 Interrupt request line is used to alert the processor
With this combination, the bus line status will be 1000 A program can be interrupted in three ways:-
Inverter buffers code seen by both devices is 0111 By external signal
Each device compares code formed on arbitration lines to its By a special instruction in the program
own ID, starting from MSB By some other condition
If it finds a difference at any bit position, it disables drives at Ex:-
that position by placing 0 at input of all these drives Main program ISR
Here, device detects a difference on line ARB2 Instruction1:______ .
.
It disables drives on lines ARB2, ARB1, ARB0 ;
.
This makes code on arbitration lines to change to 0110 INTERRUPT OCCURS HERE .
0110 6, which is ID of B ;
This means, B wins the competition Instruction n:_______
“Chase Your Dreams; Dreams Do Come True” – Sachin Tendulkar
CS6303 – COMPUTER ARCHITECTURE
An interrupt is caused by an external signal is called as If a signal is closed, Flag 0 is used; INTR=1
hardware interrupt Open collector and open drain gates are used
Conditional interrupts (or) interrupts is created by special Because o/p of open collector (or) an open drain gate is
instructions are called as software interrupts equivalent to a switch to ground that is open\
Interrupt Hardware:- Multi-Level interrupts:-
An I/O device requests an interrupt by activating a bus line Processor has more than one interrupt pins
called as interrupt request (or) request I/O devices are tied to individual interrupt pins
Interrupts are classified as Single level and Multilevel interrupt They can be immediately classified by CPU upon receiving
Single level Interrupts:- an interrupt request from it
This allows processor to go directly to that I/O device and
service it without polling concept
This saves time in time processing input
When a process interrupted, it stops executing its current
program, and calls special routine
The event causes interruption is called as interrupt
Processor finishes its current instruction; no cut-off
Program counter’s current details stored in stack
Remember during pgrm execution of an instruction
PC is loaded with address of ISR
Interrupt programs continue working until result executed
Enabling and Disabling interrupts:- 11. Write notes on I/O processor and explain its features with
Maskable interrupts are enabled and disabled under a neat diagram.
program control An I/O processor is aprocessor with DMA and interrupt
By SET and RESET particular flip flops in processor, capability that reduces work load of CPU from communicating
interrupts can be masked or unmasked with I/O devices
When masked, processor does not respond to interrupt A computer system may have one CPU and one or more IOPs
even though interrupt is activated An IOP that communicates with remote terminals over
Most of the processors give masking facility communication lines and other communication media is
In some kinds of processors, those inputs which can be called as data communication processor (DCP)
masked under software control are called as maskable An IOP is not dependent on CPU
interrupts It transfers data between external devices and memory under
The interrupts that cannot be masked under software the control of I/O program
control are called as non-maskable interrupts I/O program is initiated by CPU
Exceptions:-
An interrupt is an event that suspends processing of
currently executing program and begins execution of
another program
Many events can cause interrupts, called as exceptions
An I/O interrupt is a subtype of exception
Exceptions can be classified as: Faults, Traps (or) aborts
Faults:-
Faults are a type of exceptions that are detected and
services BEFORE the execution of the faulting instruction
Ex: In VM, if page or segment referenced by processor is Communication between IOP and device attached to it, is
not present, OS fetches that page from Disk, using fault similar to programmed I/O
exception routine. IOP and memory communication is through DMA
Traps:- CPU send instructions to IOP to start or to test status of IOP
Traps are exceptions that are reported immediately AFTER When an I/O operation is desired, CPU informs IOP where to
the execution of instructions which causes the problem find I/O programs
Ex: user defined interrupts such as Divide by Zero error I/O programs contains instructions regarding to data transfer
Aborts:- The instructions in I/O program are prepared by system
Aborts are exceptions which do not permit precise location programmers, called as “commands”
of the instruction causing the exception to be found It is different from CPU instruction
They are used to report severe errors such as hardware Features of IOP:-
error, illegal values in system. An IOP can fetch and execute its own instructions
Debugging:- Instructions are specially designed for I/O processing
System software contains a system program called Debugger
Intel 8089 IOP can perform arithmetic, logical operations,
A debugger is a program that helps programmer to find and data transfer operations, searching, branching and translation
clear errors in a program IOP does all work involved in I/O transfer including device set
It uses two types of exceptions: Trace, Breakpoint up, programmed I/O, DMA
To use trace exception, it is necessary to program the IOP can transfer data from an 8bit source to 16bit destination
processor in trace mode Communication between IOP and CPU is through memory
If processor is in trace mode, an exception occurs after based control blocks; CPU defines tasks in control blocks to
execution of every instruction find a program sequence, called as channel program
This is used to execute debug program as an exception IOP supports multiprocessing; IOP and CPU can do
service routine processing at the same time.
This exception service routine makes user to find the Intel 8089 IOP:-
contents of register, memory locations. Etc
Trace exception is disabled during the execution of
debugging program
A debugger allows programmer to set breakpoints at any
point in the program
In this mode, the system executes instructions up to the
breakpoint and creates break point exception
This exception routine allows to find contents of registers,
memory locations for checking process
Programmer can verify whether his program is correct
until that point or not.