Natchatran

NATCHATRAN

Natchatran Blogs includes Technical Tutorials, E-books, Notes, Lab Manual, Question Banks, Viva questions and Interview questions for engineering students, provides all study material for cse students.

-Natchatran(Prem Anandh.J)

Friday, March 7, 2014

CS2354 - Advanced Computer Architecture- PART A Question and Answer

CS2354- ADVANCED COMPUTER ARCHITECTURE
PART A Question and Answer
2 Marks
UNIT I
1. What is Instruction Level parallelism?
The technique which is used to overlap the execution of instructions and improve
performance is called ILP.
2. What are the approaches to exploit ILP?
The two separable approaches to exploit ILP are,
Dynamic or hardware intensive approach
Static or Compiler intensive approach
3. What is pipelining?
Pipelining is an implementation technique whereby multiple instructions are overlapped
in execution when they are independent of one another.
4. Write down the formula to calculate the pipeline CPI?
The value of the CPI (Cycles per Instruction) for the pipelined processor is the sum of the
CPI and all contributions from stalls.
Pipeline CPI = Ideal pipeline CPI + structural stalls + Data hazard stalls + control stalls.
5. What is loop level parallelism?
Loop level parallelism is a way to increase the amount of parallelism available among
instructions is to exploit parallelism among iterations of loop.
6. Give the methods to enhance performance of ILP?
To obtain substantial performance enhancements, the ILP across multiple basic blocks
are exploited using
loop level parallelism
vector instructions
7. List out the types of dependences.
There are three different types of dependences
Data dependences
Name dependences
Control dependences
8. What is Data hazard?
A hazard is created whenever there is dependence between instructions and they are close
enough that the overlap caused by pipelining, or other reordering of instructions, would change
the order of access to the operand involved in the dependence.
9. Give the classification of Data hazards
Data Hazards are classified into three types depending on the order of read and write
accesses in the instructions
RAW (Read After Write)
WAW (Write After Write)
WAR (Write After Read)
10. List out the constraints imposed by control dependences?
The two constraints imposed by control dependencies are
An instruction that is control dependent on branch cannot be moved before the branch
so that its execution is no longer controlled by the branch.
An instruction that is not control dependent on a branch cannot be moved after the
branch so that its execution is controlled by the branch.
11. What are the properties used for preserving control dependence?
Control dependence is preserved by two properties in a simple pipeline.
Instruction execute in program order
Detection of control or branch hazards
12. Define Dynamic Scheduling?
Dynamic scheduling is a technique in which the hardware rearranges the instruction
execution to reduce the stalls while maintaining data flow and exception behavior.
13. List the advantages of dynamic scheduling?
It handles dependences that are unknown at compile time.
It simplifies the compiler.
Uses speculation techniques to improve the performance.
14. What is score boarding?
Score boarding is defined as it allows out of order execution when all the resources are
available and there is no data dependence. It can’t be eliminated until these two hazards WAW,
WAR are cleared.
15. What are the advantages of Tomosulo’s Approach?
Distribution of hazard detection layer
Elimination of WAR and WAW hazard
16. What are the types of branch prediction?
There are two types of branch prediction. They are,
Dynamic branch prediction
Static branch prediction
17. Define Amdahl’s Law?
This law states that particular performance of the computer can be improved by
improving some portion of the computer. This is known as Amdahl’s Law.
18. What are the things present in Dynamic branch prediction?
It uses two things they are,
Branch prediction buffer
Branch history table
19. Define Correlating branch prediction?
Branch prediction that uses the behavior of other branches to make a prediction is called
correlating branch prediction.
20. What are the basic ideas of pipeline scheduling?
The basic ideas of pipeline scheduling are,
To keep pipeline full: Find sequence of unrelated instructions that can be
overlapped in the pipeline.
To avoid pipeline stall: Separate dependent instructions by a distance in clock
dependent instructions by a distance in clock cycles equal to the pipeline latency
of that source instruction.
21. What are the four fields involved in ROB?
ROB contains four fields,
Instruction type
Destination field
Value field
Ready field
22. What is reservation station?
In Tomasulo’s scheme register renaming is provided by reservation station. The basic
idea is that the reservation station fetches and buffers an operand as soon as it is available,
eliminating the need to get the operand from a register.
23. What is ROB?
ROB stands for reorder buffer. It supplies operands in the interval between completion of
instruction execution and instruction commit. ROB is similar to the store buffer in Tomasulo’s
algorithm.
24. What is imprecise exception?
An exception is imprecise if the processor state when an exception is raised does not look
exactly as if the instructions were executed sequentially in strict program order.
25. What are the two possibilities of imprecise exceptions?
If the pipeline has already completed instructions that are later in program order
then that instruction will cause exception.
If the pipeline has not yet completed instructions that are earlier in program order
then that instructions will cause exception.
26. What are the two main features preserved by maintaining both data and control dependence?
Exception behavior
Data flow
27. What are the types of dependence?
Anti dependence
Output dependence
28. What is anti dependence?
An anti dependence between instruction i and instruction j occurs when instruction j
writes a register or memory location that instruction i reads. The original ordering must be
preserved to ensure that i read the correct value.
29. What is output dependence?
An output dependence occurs when instruction i and instruction j write the same register
or memory location. The ordering between the instructions must be preserved to ensure that the
value finally written corresponds to instruction j.
30. What is register renaming?
Renaming of register operand is called register renaming. It can be either done statically
by the compiler or dynamically by the hardware.
UNIT 2
1. Define VLIW.
VLIW is a technique for ILP by executing instructions without dependencies in parallel.
The compiler analysis the program and detects operations to be executed in parallel; such
operations are packed into one “ large” instruction.
2. List out the advantages of VLIW processor.
􀂙 Simple hardware
Number of functional units can be increased without needing additional
sophisticated hardware to detect parallelism like in superscalus.
􀂙 Good compilers can detect parallelism based on global analysis of the whole
program.
3. Define EPIC
􀂙 Epic is Explicit Parallel Instruction Computing
􀂙 It is an architecture framework proposed by HP.
􀂙 It is based on VLIW and was designed to overcome the key limitations of VLIW
while simultaneously giving more flexibility to compiler writers.
4. What is loop level analysis?
Loop level analysis involves determining what depends exist among the operands in a
loop across the iterations of a loop are data dependent on data values produced in earlier
iterations.
5. What are the types of Data dependencies in loops?
􀂙 Loop Carried dependencies
􀂙 Not loop carried dependence
6. What is loop carried dependence?
Data dependence between different loop iterations (data produced in earlier iterations
used in a later one) is called a loop carried dependence.
7. What are the tasks in finding the dependence in a program?
There are 3 tasks. They are
􀂙 Have good scheduling of code
􀂙 Determine which loop might contain parallelism
􀂙 Eliminate name dependence
8. Define dependence analysis algorithm.
Dependence analysis algorithm is algorithm used to detect the dependence by the
compiler based on the assumptions that
􀂙 Array indices are affine
􀂙 There exist GCD of the two affine indices
9. What is copy propagation?
Copy propagation is the algebraic simplifications of expressions and an optimization
which eliminates operation that copy values.
10. What is tree-height reduction technique?
Tree-height reduction is optimization which reduces the height of the tree structure
representing a computation, making it wider but shorter.
11. What are the components of software pipeline loop?
􀂙 A software pipeline loop consists of a loop body, start- up code and clean-up
code.
􀂙 Start up code is to execute code left out from the first original loop iterations.
􀂙 Finish code to execute instructions from the last original iterations.
12. What is trace scheduling?
Trace scheduling is way to organize the process of global code motion it simplifies
instruction scheduling by incuring the cost of possible code motion on the less critical
paths.
13. List out steps used for trace scheduling.
􀂙 Trace selection
􀂙 Trace compaction
14. Define Inter-procedural analysis.
A procedure with pointer parameters and if we want to analyse the procedure across the
boundaries of the particular procedure. It is called interprocedural analysis.
15. What is software pipelining?
It is a technique for reorganizing loop such that each iteration in the code is made from
instructions chosen from different iterations of original loop.
16. Define critical path.
Critical path is defined as the longest sequence of dependent instructions in a program.
17. Define IA-64 processor.
The IA-64 is a RISC-Style, register-register instruction set with the features designed to
support compiler based exploitation of ILP.
18. What is CFM and what is its use?
􀂙 CFM stands for Current Frame Pointer
􀂙 CFM pointer points to the set of registers to be used by a given procedure.
19. What are the parts of CFM pointer?
There are two parts. They are
􀂙 Local area – Used for local storage
􀂙 Output area - Used to pass values to any called procedure.
20. What is Itanium processor?
Itanium processor is a implementation of Intel IA-64 processor. It is capable of having 6
issues per clock cycle. The 6 issues includes 3 branches and 2 memory reference.
21. What are the parts of 10 stage pipeline in Itanium processor?
􀂙 Front end
􀂙 Instruction delivery(EXP, REN)
􀂙 Operand delivery(WLD, REG)
􀂙 Execution(EXE, DEG, WRB)
22. What are the limitations of ILP?
􀂙 Limitations on hardware model
􀂙 Limitations on window size and maximum issue count
􀂙 Effect of finite register
􀂙 Effects of imperfect alias analysis
23. List the two techniques for eliminating dependent computations
􀂙 Software pipelining
􀂙 Trace scheduling
24. Define Trace selection and Trace compaction
Trace Selection
Trace selection tries to find a likely sequence of basic blocks whose operations will be
put into small number of instructions this sequence is called trace.
Trace Compaction
Trace compaction tries to squeeze the trace into a small number
of wide instructions. Trace compaction is code scheduling hence it attempts to move
operations as early as it can in a sequence packing the operations into as few wide
instructions as possible.
25. Define Superblocks.
Superblocks are formed by a process similar to that used for traces, but are a form of
extended basic blocks, which are restricted to a single entry point but allow multiple exits.
26. Use of conditional or predicted instructions.
Conditional or predicted instructions are used to eliminate braches, converting a control
dependencies and potentially improving performance.
27. Define Instruction Group
Instruction group is a sequence of consecutive instructions with no register data dependencies
among them. All the instructions in a group could be executed in parallel if sufficient
hardware resources existed and if any dependences through memory were preserved.
28. Use of template field in bundle.
The 5 bit template field within each bundle describes both the presence of any stops
associated with the bundle and the execution unit type required by each instruction within
the bundle.
29. List the two types of speculation supported by IA 64 processor.
􀂙 Control Speculation
􀂙 Memory reference speculation
30. Define Advance loads.
Memory reference support in the IA 64 uses a concept called advanced loads. Advance load
is a load that has been speculatively moved above store instructions on which it is potentially
dependent. To speculatively perform a load the ld.a instruction is used.
31. Define ALAT
Executing advance load instructions created an entry in a special table called ALAT. It
stores both the register destination of the load and the address of the accessed memory
location. When a store is executed, an associative look up against the active ALAT
entries is performed. If there is an ALAT entry with the same memory memory address
as the store, mark the ALAT entry as invalid.
32. What are the functional units in Itanium Processor?
There are nine functional units in the Itanium processor.
Two I units
Two M units
Three B units
Two F units
All the functional units are pipelined.
33. Define Scoreboard
In Itanium processor 10 stage pipeline divided into 4 parts. In operand delivery part
scoreboard is used to detect when individual instruction can proceed so that a start of one
instruction in a bundle need not cause the entire bundle to stall.
34. Define Book Keeping Code
Basic block consists of 1 entry and 1 exit code. This code is known as Book 1Keeping
Code.
1. Define cache coherence problem?
Unit-3
Cache coherence problem describes how two different processors can have two different
values for the memory location.
2. What are the two aspects of cache coherence problem?
i. coherence- It determines what value can be returned by the particular read
operation.
ii. Consistency- It determine when the value may be returned by the read
operation.
3. What are the two types of cache coherence protocol?
i. Directory based protocol.
ii. Snooping protocol.
4. Define Directory based protocol.
The shared portion of the main memory may be kept in one common place called
directory. From this directory we can retrieve the data.
5. Name the different types of snooping protocol.
i. invalidate protocol
ii. update/write broadcast protocol.
6. Difference between write Update and invalidate protocol.
Write update:
i. Multiple write broadcast is present
ii. Here they consider separate word for each cache block
iii. Access time is less
Invalidate:
i. Only one invalidation is present
ii. Invalidation is performed for entire cache block
iii. Access time is high
7. What are the different types of access in distributed shared memory architecture?
i, Local:
If the processor refers the local memory then it is called local access.
ii. Remote:
If the processor refers the other process memory then it is called remote access
8. What are the disadvantages of remote access?
Compiler mechanism for cache coherence is very limited
Without the cache coherence property the multiprocessor system loss the
advantage of fetch and use multiple words
Prefetch is very useful only when the multiprocessor fetch multiple word
9. What are the states available in directory based protocol?
i. Shared:-One or more processor can have the copies of same dat.
ii. Uncached :- No processor has the copy of data block.
iii. Exclusive:- Exactly one processor has the copy of data block.
10. What are the nodes available in distributed system?
i. Local Node
ii. Home Node
iii. Remote Node
11. Define Synchronization.
Synchronization is the mechanism that is build with user level software routine,
which depends on hardware supplied synchronization instruction.
12. Name the basic hardware primitives.
i. Atomic Exchange
ii. Test and set
iii. Fetch and Increment
13. Define spinlock.
It is a lock that a processor continuously tries to acquire spinning around a loop until it
succeeds
It is mainly used when the programmer wants to use the lock for a small period of time
14. What are the mechanism to implement locks?
There are two methods to implement the locks.
i. Implementing lock without using cache coherence
ii. Implementing lock using cache coherence.
15. What are the advantage of using spin lock?
There are two advantages of using spin lock
i. They have low overhead
ii. Performance is high
16. Name the synchronization mechanisms for large scale multiprocessor.
i. Exponential back off
ii. queuing locks
iii. combining tree
17. What are the two primitives used for implementing synchronization?
Lock Based Implementation
Barrier based Implementation
18. Define sequential consistency.
It requires that the result of any execution be the same as, if the memory access executed
by each processor where kept in order and accesses among different processor are
interleaved.
It reduces the amount of incorrect execution
19. Define multithreading.
The process of executing the multiple thread by common memory or common
processor in which the execution is done is overlapping fashion.
20. What are the types of multi threading?
i. Fine grained multithreading:- It has the ability to switch threads for each
instruction
ii. coarse grained multithreading:- It has the ability to switch the threads only for
costly stalls.
Unit-4
1. Define cache.
Cache is the name given to the first level of the memory hierarchy encountered once
the address leaves the CPU.
Eg: file caches, name caches.
2. What are the factors on which the cache miss depends on?
The time required for the cache miss depends on both
Latency
Bandwidth
3. What is the principle of locality?
Program access a relatively small portion of the address space at any instant of
time is called principle of locality.
4. What is called pages?
The address space is usually broken into fixed-size blocks, called pages. Each
page resides either in main memory or on disk.
5. What is called memory stall cycles?
The number of cycles during which the CPU is stalled waiting for a memory
access is called memory stall cycles.
6. Write down the formula for calculating average memory access time?
Average memory access time=Hit time+Miss rate*Miss penalty.
When hit time is the time to hit in the cache, the formula can help us decide
between split caches and a unified cache.
7. What are the techniques to reduce the miss rate?
Larger block size
Larger caches
Higher associativity
Way prediction and pseudo associative caches
Compiler optimizations.
8. What are the techniques to reduce hit time?
Small and simple cache: direct mapped
Avoid address translation during indexing of the cache
Pipelined cache access
Trace cache
9. List out the types of storage devices.
Magnetic storages : disk, floppy, tape
Optical storages : compact disks(CD), digital/video/ verstaile
disks(DVD)
Electrical storage : flash memory
10. What is sequence recorded?
The sequence recorded on the magnetic medics is a sector number, a gap, the
information for that sector including error correction code, a gap, the sector number of
the next sector and so on.
11. What is termed as cylinder?
The term cylinder is used to refer to all the tracks under the arms at a given point
on all surfaces.
12. List the components to a disk access.
There are three mechanical components to a disk access:
Rotation latency
Transfer time
Seek time
13. What is average seek time?
Average seek time is the sum of the time for all possible seeks divided by the
number of possible seek. Average seek times are advertised to be 5 ms to 12 ms.
14. What is transfer time
Transfer time is the time it takes to transfer a block of bits, typically a sector,
under the read-write head. This time is a function of the block size, disk size, rotation
speed, recording density of the track, and speed of the electronics connecting the disk to
computer.
15. Write the formula to calculate the CPU execution time.
CPU execution time=(CPU clock cycles+ memory stall cycles)*clock cycle time.
16. Write the formula to calculate the CPU time.
CPU time=(CPU execution clock cycles+ memory stall clock cycles)* clock cycle
time.
17. Define miss penalty for an out of order execution processor.
For an out of order execution processor, miss penalty is defined as follows.
(Memory stall cycles/Instruction) *( misses/instruction) *(total miss latencyoverlapped
miss latency.
18. What are the techniques available to reduce cache penalty or miss rate via parallelism?
The three techniques that overlap the execution of instructions are
1.Non blocking caches to reduce stalls on cache miss- to match the out of
order processors
2.Hardware prefetching of instructions and data
3.Compiler- controlled prefetching.
19. How are the conflict misses divided?
The four divisions of conflict misses are,
Eight way
Four way
Two way
One way
20. List the advantage of memory hierarchy?
Memory hierarchy takes advantageof
a.locality
b.cost/performance of memory technologies
22. What is the goal of memory hierarchy?
The goal is to provide a memory system with
*cost almost as low as the cheapest level of memory
*speed almost as fast as the faster level
23. Define cache hit ?
When the cpu finds a requests data item in the cache, it is called a cache hit.
*Hit Rate: the fraction of cache access found in the cache
*Hit Time: time to access the upperlevel which consists of RAM access
time+Time to determine hit\miss
24.Define cache miss?
When the cpu doesnot find a data item it needs in the cache, a cache miss occurs
*Miss Rate-1-(Hit Rate)
*Miss penalty-Time to replace a block in cache +time to deliver the block to the
processor
25. What does Latency and Bandwidth determine?
-Latency determine the time to retrieve the first word of the block
-Bandwidth determine the time to retrieve the rest of this block
26. What are the types of locality?
*Temporal locality(Locality in time)
*Spatial locality(Locality in space)
27. How does page fault occur?
When the cpu references an item within a page that is not present in the cache or main
memory, a page fault occurs, and the entire page is moved from the disk to main memory
28. What is called the miss penalty?
The number of memory stall cycles depends on both the number of misses and the
cost per miss, which is called the miss penalty
29. What is Average memory access time?
The average memory access time for processors is the better measure of memory
hierarchy performance with in-order execution
30. What are the categories of cache miss(3cs of cache miss)
*compulsory
*capacity
*conflict
31. What are the techniques to reduce miss penalty?
*multi-level caches
*critical word first and early restart
*giving priority to read misses over writes
*Merging writes buffer
*victim caches
UNIT-5
1) What is the function of Power Processing Unit?
*a full set of 64-bit power pc register.
*32-168 bit vector multimedia register.
*a 32 KB LI data cache.
*a 32 KB LI instruction cache.
2) List out the disadvantages of Heterogeneous multi-core processors?
*Developer productivity.
*Portability.
*Manage ability.
3) Define Software Multithreading
Software multithreading is a piece of software that is aware of more than one
core/processor and can use these to be able to simultaneously complete multiple tasks.
4) Define Hardware Multithreading
Hardware multithreading is a multithreading that allows multiple to share the functional
units of a single processor in an overlapping fashion.
5) Difference between Software and Hardware Multithreading
*Multithreading(Computer Architecture), multithreading in hardware.
*Thread(Computer Science), multithreading in software.
6) List some advantages of Software Multithreading.
*Increased responsiveness and worker productivity.
-Increased application responsiveness when different tasks run in parallel.
*Improved performance in parallel environments.
-When running computations on multiple processors.
*More computations per cubic foot of data center.
-Web based applications are often multi-threaded in nature.
7) List out the two approaches of Hardware Multithreading.
The two main approaches in Hardware multithreading are
*Fine-grain Multithreading.
*Coarse-grain Multithreading.
8) Define Simultaneous Multithreading(SMT)
SMT is a variation on multithreading that uses resources of a multiple –issue,
dynamically scheduled processor to exploit ILP at the samw time it exploits ILP. ie., convert
thread-level parallelism into more ILP.
9) Give the features exploited by SMT.
It exploits the following features of modern processors
*Multiple Functional Units.
-Modern Processors typically have more functional units available than a
single thread can utilize.
*Register Renaming and Dynamic Scheduling.
execute.
-Multiple instructions from independent threads can co-exist and co-
10) What are the Design challenges of SMT?
The Design Challenges of SMT processor includes the following-
*Larger Files needed to hold multiple contents.
*Not affecting clock cycle time.
*Instruction issue-more candidate instructions need to be considered.
*Instruction comlpletion-choosing which instructions to commit may be challenging.
*Ensuring that cache and TLB conflicts generated by SMT do not degrade performance.
11) Compare the SMT processor with the base Superscalar Processor
The SMT processor are compared to the base superscalar processor in several key
measures
*Utilization of functional units.
*Utilization of Fetch units.
*Accuracy of branch predictors.
*Hit rates of primary caches.
*Hit rates of secondary caches.
12) List the factors that limits the issue slot usage
The issue slot usage is limited by the following factors.
*Imbalances in resources needs.
*Resources availabilty over multiple threads.
*Number of active threads considered.
*Finite Limitations of buffer.
*Ability to fetch enough instruction from multiple threads.
13) Define Multi-core microprocessor
A multi-core microprocessor is one that combines two or more separate processors in one
package.
14) What is Heterogeneous Multi-core processors?
Herogeneous Multi-core processor is a processor in which multiple cores of different
types are implemented in one CPU.
15) List out the advantages of Herogeneous Multi-core processors.
*Massive parallelism.
*Specialization of Hardware for tools.
16) List out the Disadvantages of Herogeneous Multi-core processors.
*Developer productivity.
*Portability.
*Manageability.
17) What is IBM cell processor?
The IBM cell processor is a heterogeneous multi-core processor comprised of controlintensive
processor and computative-intensive SIMD processor cores, each with its own
distinguishing feature.
18) List the components of IBM cell architecture
*Power Processing Elements(PPE).
*Synergistic Processor Elements(SPE).
*I/O controller.
*Element Interconnect Bus(EIB).
19) What are the components of PPE?
The PPE is made out of two main units..
1.Power Processor Unit(PPU)
2.Power Processor Storage Subsystem(PPSS)
20) What is Memory Flow Controller(MFC)?
The Memory Flow Controller is actually the interface between the Synergistic

Processor(SPU) and the rest of the cell chip. Actually, the MFC interfaces the SPU with the EIB.

CS2354 - Advanced Computer Architecture - Syllabus

CS2354 ADVANCED COMPUTER ARCHITECTURE - Syllabus
L T P C
3 0 0 3
UNIT I INSTRUCTION LEVEL PARALLELISM 9
ILP – Concepts and challenges – Hardware and software approaches – Dynamic
scheduling – Speculation - Compiler techniques for exposing ILP – Branch prediction.
UNIT II MULTIPLE ISSUE PROCESSORS 9
VLIW & EPIC – Advanced compiler support – Hardware support for exposing parallelism
– Hardware versus software speculation mechanisms – IA 64 and Itanium processors –
Limits on ILP.
UNIT III MULTIPROCESSORS AND THREAD LEVEL PARALLELISM 9
Symmetric and distributed shared memory architectures – Performance issues –
Synchronization – Models of memory consistency – Introduction to Multithreading.
UNIT IV MEMORY AND I/O 9
Cache performance – Reducing cache miss penalty and miss rate – Reducing hit time –
Main memory and performance – Memory technology. Types of storage devices –
Buses – RAID – Reliability, availability and dependability – I/O performance measures –
Designing an I/O system.
UNIT V MULTI-CORE ARCHITECTURES 9
Software and hardware multithreading – SMT and CMP architectures – Design issues –
Case studies – Intel Multi-core architecture – SUN CMP architecture - heterogenous
multi-core processors – case study: IBM Cell Processor.
TOTAL : 45 PERIODS
56
TEXT BOOK:
1. John L. Hennessey and David A. Patterson, “ Computer architecture – A quantitative
approach”, Morgan Kaufmann / Elsevier Publishers, 4th. edition, 2007.
REFERENCES:
1. David E. Culler, Jaswinder Pal Singh, “Parallel computing architecture : A
hardware/software approach” , Morgan Kaufmann /Elsevier Publishers, 1999.
2. Kai Hwang and Zhi.Wei Xu, “Scalable Parallel Computing”, Tata McGraw Hill, New

Delhi, 2003.

CS2351 Artificial Intelligence

Friday, February 7, 2014

2 Mark Q&A CS2252 - Microprocessors and Microcontrollers





2 Mark Q&A CS2252 - Microprocessors and Microcontrollers


UNIT I
THE 8085 AND 8086 MICROPROCESSORS
PART A (2 MARKS)
1. What is Microprocessor? Give the power supply & clock frequency of 8085
A microprocessor is a multipurpose, programmable logic device that reads binary instructions from a storage device called memory accepts binary data as input and processes data according to those instructions and provides result as output. The power supply of 8085 is +5V and clock frequency in 3MHz.
2. List few applications of microprocessor-based system.
It is used:
i. For measurements, display and control of current, voltage,
temperature, pressure, etc.
ii. For traffic control and industrial tool control.
iii. For speed control of machines.
3. What are the functions of an accumulator?
The accumulator is the register associated with the ALU operations and sometimes I/O
operations. It is an integral part of ALU. It holds one of data to be processed by ALU. It also
temporarily stores the result of the operation performed by the ALU.
4. List the 16 – bit registers of 8085 microprocessor.
Stack pointer (SP) and Program counter (PC).
5. List the allowed register pairs of 8085.
• B-C register pair
• D-E register pair
• H-L register pair
6. Mention the purpose of SID and SOD lines
SID (Serial input data line):
It is an input line through which the microprocessor accepts serial data.
SOD (Serial output data line):
It is an output line through which the microprocessor sends output serial data.
7. What is the function of IO/M signal in the 8085?
It is a status signal. It is used to differentiate between memory locations and I/O operations.When this signal is low (IO/M = 0) it denotes the memory related operations. When this signal is high (IO/M = 1) it denotes an I/O operation.
8. List out the five categories of the 8085 instructions. Give examples of the instructions
for each group.
• Data transfer group – MOV, MVI, LXI.
• Arithmetic group – ADD, SUB, INR.
• Logical group –ANA, XRA, CMP.
• Branch group – JMP, JNZ, CALL.
• Stack I/O and Machine control group – PUSH, POP, IN, HLT.
9. Explain the difference between a JMP instruction and CALL instruction.
A JMP instruction permanently changes the program counter. A CALL instruction leaves
information on the stack so that the original program execution sequence can be resumed.
10. What is the difference between the shift and rotate instructions?
A rotate instruction is a closed loop instruction. That is, the data moved out at one end is put back in at the other end. The shift instruction loses the data that is moved out of the last bit
locations.
11. What is meant by Wait State?
This state is used by slow peripheral devices. The peripheral devices can transfer the data to or from the microprocessor by using READY input line. The microprocessor remains in wait state as long as READY line is low. During the wait state, the contents of the address, address/data and control buses are held constant.
12. List the four instructions which control the interrupt structure of the 8085
microprocessor.
• DI (Disable Interrupts)
• EI (Enable Interrupts)
• RIM (Read Interrupt Masks)
• SIM (Set Interrupt Masks)
13. What is the signal classification of 8085?
All the signals of 8085 can be classified into 6 groups
• Address bus
• Data bus
• Control and status signals
• Power supply and frequency signals
• Externally initiated signals
• Serial I/O ports
14. What are operations performed on data in 8085
The various operations performed are
• Store 8-bit data
• Perform arithmetic and logical operations
• Test for conditions
• Sequence the execution of instructions
• Store data temporarily during execution in the defined R/W memory locations called the
Stack
15. Steps involved to fetch a byte in 8085
i. The PC places the 16-bit memory address on the address bus
ii. The control unit sends the control signal RD to enable the memory chip
iii. The byte from the memory location is placed on the data bus
iv. The byte is placed in the instruction decoder of the microprocessor and the task is carried out according to the instruction
16. What are the interrupts of 8085 ?
The 8085 has 5 interrupt signals; they are INTR, RST7.5, RST6.5, RST5.5 and TRAP
17. What is an instruction?
An instruction is a binary pattern entered through an input device to command the
microprocessor to perform that specific function
18. What is the use of ALE
The ALE is used to latch the lower order address so that it can be available in T2 and T3 and used for identifying the memory address. During T1 the ALE goes high, the latch is transparent ie, the output changes according to the input data, so the output of the latch is the lower order address. When ALE goes low the lower order address is latched until the next ALE.
19. Explain the signals HOLD, READY and SID
HOLD indicates that a peripheral such as DMA controller is requesting the use of address bus, data bus and control bus. READY is used to delay the microprocessor read or write cycles until a slow responding peripheral is ready to send or accept data. SID is used to accept serial data bit by bit
20. What is the use of addressing modes, mention the different types
The various formats of specifying the operands are called addressing modes, it is used to access the operands or data. The different types are as follows
• Immediate addressing
• Register addressing
• Direct addressing
• Indirect addressing
• Implicit addressing
UNIT II
8086 SOFTWARE ASPECTS
PART A (2 MARKS)
1. What are the functions of bus interface unit (BIU) in 8086?
(a) Fetch instructions from memory.
(b) Fetch data from memory and I/O ports.
(c) Write data to memory and I/O ports.
(d) To communicate with outside world.
(e) Provide external bus operations and bus control signals
2. Explain ALIGN & ASSUME
The ALIGN directive forces the assembler to align the next segment at an address divisible by specified divisor. The format is ALIGN number where number can be 2, 4, 8 or 16.
Example: ALIGN 8.
The ASSUME directive assigns a logical segment to a physical segment at any given time. It tells the assembler what address will be in the segment registers at execution time.
Example: ASSUME CS: code, DS: data, SS: stack
3. Explain PTR & GROUP
A program may contain several segments of the same type. The GROUP directive collects them under a single name so they can reside in a single segment, usually a data segment. The format is,
Name GROUP Seg-name, Seg-name PTR is used to assign a specific type to a variable or a label. It is also used to override the declared type of a variable.
4. What is assembler?
The assembler translates the assembly language program text which is given as input to the assembler to their binary equivalents known as object code. The time required to translate the
assembly code to object code is called access time. The assembler checks for syntax errors &
displays them before giving the object code.
5. State the significance of LOCK signal in 8086?
If 8086 is working at maximum mode, there are multiprocessors are present. If the system bus is given to a processor then the LOCK signal is made low. That means the system bus is busy and it cannot be given of any other processors. After the use of the system bus again the LOCK signal is made high. That means it is ready to give the system bus to any processor.
6. Explain SEGMENT & ENDS
An assembly program in .EXE format consists of one or more segments. The starts of these segments are defined by SEGMENT and the end of the segment is indicated by ENDS directive.
Format Name SEGMENT Name ENDS
7. Explain TITLE & TYPE
The TITLE directive helps to control the format of a listing of an assembled program. It causes a title for the program to print on line 2 of each page of the program listing. Maximum 60
characters are allowed. Format TITLE text. TYPE operator tells the assembler to determine the
type of specified variable in bytes. For bytes the assembler gives a value 1, for word 2 & double
word 4.
8. What are procedures?
Procedures are a group of instructions stored as a separate program in memory and it is called from the main program whenever required. The type of procedure depends on where the
procedures are stored in memory. If it is in the same code segment as that of the main program
then it is a near procedure otherwise it is a far procedure.
9. How single stepping can be done in 8086?
By setting the Trace Flag (TF) the 8086 goes to single-step mode. In this mode, after the
execution of each instruction s 8086 generates an internal interrupt and by writing some interrupt
service routine we can display the content of desired registers and memory locations. So it is
useful for debugging the program.
10. What is a recursive procedure?
A recursive procedure is a procedure, which calls itself. Recursive procedures are used to work with complex data structures called trees. If the procedure is called with N=3, then the N is
decremented by 1 after each procedure CALL and the procedure is called until N=0.
11. What are Macros?
Macro is a group of instruction. The macro assembler generates the code in the program each time where the macro is called. Macros are defined by MACRO & ENDM directives. Creating macro is similar to creating new opcodes that can be used in the program
INIT MACRO
MOV AX, data
MOV DS
MOV ES, AX
ENDM
12. How do 8086 interrupts occur?
An 8086 interrupt can come from any of the following three sources
• External signals
• Special instructions in the program
• Condition produced by instruction
13. What are the 8086 interrupt types?
Dedicated interrupts
• Type 0: Divide by zero interrupt
• Type 1: Single step interrupt
• Type 2:Non maskable interrupt
• Type 3: Breakpoint
• Type 4: Overflow interrupt
Software interrupts
• Type 0-255
14. What is interrupt service routine?
Interrupt means to break the sequence of operation. While the CPU is executing a program an interrupt breaks the normal sequence of execution of instructions & diverts its
execution to some other program. This program to which the control is transferred is called the interrupt service routine.
15.Define BIOS
The IBM PC has in its ROM a collection of routines, each of which performs some specific function such as reading a character from keyboard, writing character to CRT. This collection of routines is referred to as Basic Input Output System or BIOS.
16. What is the purpose of segment registers in 8086?
There are 4 segment registers present in 8086. They are
1. Code Segment (CS) register
2. Data Segment (DS) register
3. Stack Segment (SS) register
4. Extra Segment (ES) register
The code segment register gives the address of the current code segment. ie. It will points out
here the instructions, to be executed, are stored in the memory.
The data segment register points out where the operands are stored in the memory.
The stack segment registers points out the address of the current stack, which is used to store the
temporary results.
If the amount of data used is more the Extra segment register points out where the large amount
of data is stored in the memory.
17. Define pipelining?
In 8086, to speedup the execution of program, the instructions fetching and execution of
instructions are overlapped each other. This technique is known as pipelining. In pipelining,
when the n th instruction is executed, the n+1 th instruction is fetched and thus the processing
speed is increased.
18. Discuss the function of instruction queue in 8086?
In 8086, a 6-byte instruction queue is presented at the Bus Interface Unit (BIU). It is used to prefetch and store at the maximum of 6 bytes of instruction code from the memory. Due to this, overlapping instruction fetch with instruction execution increases the processing speed.
19. What are the conditional and control flags available in status register of 8086?
Conditional Flags:
CF - Carry Flag
PF - Parity Flag
AF - Auxiliary Carry Flag
ZF - Zero Flag SF - Sign Flag
OF - Overflow Flag
Control Flags:
TF – Single step Trap Flag
IF – Interrupt Enable Flag
DF – String Direction Flag
20. List the various addressing modes present in 8086?
There are 12 addressing modes present in 8086. They are,
(a) Register and immediate addressing modes
_ Register addressing modes
_ Immediate addressing mode
(b) Memory addressing modes.
_ Direct addressing modes
_ Register indirect addressing modes
_ Based addressing modes
_ Indexed addressing modes
_ Based Indexed addressing modes
_ String addressing modes
(c) I/O addressing modes
_ Direct addressing mode
_ Indirect addressing mode
(d) Relative addressing mode
(e) Implied addressing mode
UNIT III
MULTIPROCESSOR CONFIGURATIONS
PART A (2 MARKS)
1. What are the advantages of multiprocessor system?
• High level performance can be attained when parallel processing.
• Robustness can be improved by isolating system functions.
2. What are the problems occurred in multiprocessor system?
1. Bus contention
2. Interprocess communication
3. Resource sharing
3. What is Coprocessor?
The coprocessor is a processor which specially designed for processor to work under the
control of the processor and support special processing capabilities. Example : 8087 which has
numeric processing capability and works under 8086.
4. What are the basic multiprocessor configurations?
1. Coprocessor configuration
2. Closely Coupled configuration
3. Loosely coupled configuration
5. Compare closely coupled and loosely coupled configurations.
Closely coupled
1. Single CPU is used
2. It has local bus only
3. No system memory or IO
4. No bus arbitration logic required
Loosely coupled
1. Multiple CPU modules are used
2. It has local as well system bus
3. It has system memory and IO, shared
among CPU modules
4. Bus arbitration logic required
6. What is mean by loosely coupled multiprocessor system?
In loosely coupled multiprocessor system, each processor has a set of Input/output
devices and a large memory, where it accesses most of the instructions and data.
7. Write the advantages of loosely coupled system over tightly coupled systems?
1. More number of CPUs can be added in a loosely coupled system to improve the
system performance
2. The system structure is modular and hence easy to maintain and troubleshoot.
3. A fault in a single module does not lead to a complete system breakdown.
8. What are the schemes for establishing priority in order to resolve bus arbitration
problem?
There are three basic bus access control and arbitration schemes
1. Daisy Chaining
2. Independent Request
3. Polling
9. What are the advantages of daisy chaining method?
1. It requires less number of control lines.
2. It is simple and cheap.
10. What are the disadvantages of daisy chaining method?
1. Propagation delay
2. The priority of master is fixed by its physical location.
11. Give the instruction set of 8087?
1. Data Transfer Instructions
2. Arithmetic Instructions
3. Comparison Instructions.
4. Transcendental Operations.
5. Constant Operations.
6. Coprocessor Control Operations.
12. What are the features of 8087?
It can operate on the data of integer, decimal and real types with lengths ranging from 2
to 10 bytes.
It is high performance numeric data processor. It can multiply two 16-bit real numbersin
about 27us and calculate square root in about 36us.
It is multi-bus compatible.
13. What are the three memory reference options in 8087 instruction?
1. Not reference memory.
2. Load an operand word from memory into 8087.
3. Store an operand word from 8087 to memory.
14. What are the status bits of 8087.
S2 S1 S0
15. Write a short note on data register in 8087.
1. It has 8 data register.
2. Each register is 8 bit and accessed as a stack
3. A PUSH operation decrements the TOP of the stack by one and loads the value on the
top register.
4. A POP register stores the value from the current TOP register and increments TOP by
one.
16. Write a short note on status register in 8087.
1. Status register is 16 bit register.
2. It indicates various errors, stores condition code for certain instruction and indicates
the BUSY status.
17. List the data types of 8087.
• Word integer
• Short integer
• Long integer
• Packed BCD
• Short real
• Long real
• Temporary real
18. List the instruction of 8087.
• Data transfer instructions
• Arithmetic instructions
• Compare instructions
• Transcendental instructions
• Load constant instructions
• Processor control instructions
19. What are the features of 8089 I/O processor?
• An IOP can fetch and execute its own instruction.
• IOP can transfer data from an 8 bit source to 16 bit destination and vice versa.
• Communication between IOP and CPU is through memory based control blocks.
• CPU defines tasks in the control blocks to locate a program seguence, called a
channel program.
20. What is the main advantage of polling method?
The priority can be dynamically changed by altering the polling sequence stored in the
controller.
UNIT IV
I/O INTERFACING
PART A (2 MARKS)
1. What are the basic modes of operation of 8255?
There are two basic modes of operation of 8255, viz.
1. I/O mode.
2. BSR mode.
In I/O mode, the 8255 ports work as programmable I/O ports, while In BSR mode only port C (PC0-PC7) can be used to set or reset its individual port bits. Under the IO mode of operation, further there are three modes of operation of 8 255, So as to support different types of
applications, viz. mode 0, mode 1 and mode 2.
Mode 0 - Basic I/O mode
Mode 1 - Strobed I/O mode
Mode 2 - Strobed bi-directional I/O
2. Write the features of mode 0 in 8255?
1. Two 8-bit ports (port A and port B) and two 4-bit ports (port C upper and lower) are available.
The two 4-bit ports can be combined used as a third 8-bit port.
2. Any port can be used as an input or output port.
3. Output ports are latched. Input ports are not latched.
4. A maximum of four ports are available so that overall 16 I/O configurations are possible.
3. What are the signals used in input control signal & output control signal?
Input control signal
STB (Strobe input)
IBF (Input buffer full)
INTR (Interrupt request)
Output control signal
OBF (Output buffer full)
ACK (Acknowledge input)
INTR (Interrupt request)
4. What are the modes of operations used in 8253?
Each of the three counters of 8253 can be operated in one of the following six modes of
operation.
1. Mode 0 (Interrupt on terminal count)
2. Mode 1 (Programmable monoshot)
3. Mode 2 (Rate generator)
4. Mode 3 (Square wave generator)
5. Mode 4 (Software triggered strobe)
6. Mode 5 (Hardware triggered strobe)
5. What are the different types of write operations used in 8253?
There are two types of write operations in 8253
(1) Writing a control word register
(2) Writing a count value into a count register
The control word register accepts data from the data buffer and initializes the counters, as
required. The control word register contents are used for
(a) Initializing the operating modes (mode 0-mode4)
(b) Selection of counters (counter 0- counter 2)
(c) Choosing binary /BCD counters
(d) Loading of the counter registers.
The mode control register is a write only register and the CPU cannot read its contents.
6. Give the different types of command words used in 8259a?
The command words of 8259A are classified in two groups
1. Initialization command words (ICWs)
2. Operation command words (OCWs)
7. Give the operating modes of 8259a?
(a) Fully Nested Mode
(b) End of Interrupt (EOI)
(c) Automatic Rotation
(d) Automatic EOI Mode
(e) Specific Rotation
(f) Special Mask Mode
(g) Edge and level Triggered Mode
(h) Reading 8259 Status
(i) Poll command
(j) Special Fully Nested Mode
(k) Buffered mode
(l) Cascade mode
8. Define scan counter?
The scan counter has two modes to scan the key matrix and refresh the display. In the encoded mode, the counter provides binary count that is to be externally decoded to provide the scan lines for keyboard and display. In the decoded scan mode, the counter internally decodes the least significant 2 bits and provides a decoded 1 out of 4 scan on SL0-SL3.The keyboard and display both are in the same mode at a time.
9. What is the output modes used in 8279?
8279 provides two output modes for selecting the display options.
1. Display Scan
In this mode, 8279 provides 8 or 16 character-multiplexed displays those can be organized as dual 4-bit or single 8-bit display units.
2. Display Entry
8279 allows options for data entry on the displays. The display data is entered for display from the right side or from the left side.
10. What are the modes used in keyboard modes?
1. Scanned Keyboard mode with 2 Key Lockout.
2. Scanned Keyboard with N-key Rollover.
3. Scanned Keyboard special Error Mode.
4. Sensor Matrix Mode.
11. What are the modes used in display modes?
1. Left Entry mode
In the left entry mode, the data is entered from the left side of the display unit.
2. Right Entry Mode
In the right entry mode, the first entry to be displayed is entered on the rightmost display.
12. What is the use of modem control unit in 8251?
The modem control unit handles the modem handshake signals to coordinate the communication between the modem and the USART.
13. What is the use of 8251 chip?
Intel’s 8251A is a universal synchronous asynchronous receiver and transmitter compatible with Intel’s Processors. This may be programmed to operate in any of the serial communication modes built into it. This chip converts the parallel data into a serial stream of bits suitable for serial transmission. It is also able to receive a serial stream of bits and converts it into parallel data bytes to be read by a microprocessor.
14. What are the different types of methods used for data transmission?
The data transmission between two points involves unidirectional or bi-directional transmission of meaningful digital data through a medium. There are basically there modes of data transmission
(a) Simplex
(b) Duplex
(c) Half Duplex
15. What are the various programmed data transfer methods?
i) Synchronous data transfer
ii) Asynchronous data transfer
iii) Interrupt driven data transfer
16. What is synchronous data transfer?
It is a data method which is used when the I/O device and the microprocessor match in speed. To transfer a data to or from the device, the user program issues a suitable instruction addressing the device. The data transfer is completed at the end of the execution of this instruction.
17. What is asynchronous data transfer?
It is a data transfer method which is used when the speed of an I/O device does not match with the speed of the microprocessor. Asynchronous data transfer is also called as Handshaking.
18. Give the register organization of 8257?
The 8257 perform the DMA operation over four independent DMA channels. Each of the four channels of 8257 has a pair of two 16-bit registers. DMA address register and terminal count register. Also, there are two common registers for all the channels; namely, mode set registers and status register. Thus there are a total of ten registers. The CPU selects one of these ten registers using address lines A0- A3.
19. What is the function of DMA address register?
Each DMA channel has one DMA address register. The function of this register is to store the address of the starting memory location, which will be accessed by the DMA channel. Thus the starting address of the memory block that will be accessed by the device is first loaded in the DMA address register of the channel. Naturally, the device that wants to transfer data over a DMA channel, will access the block of memory with the starting address stored in the DMA
Address Register.
20. What is the use of terminal count register?
Each of the four DMA channels of 8257 has one terminal count register. This 16-bit register is used for ascertaining that the data transfer through a DMA channel ceases or stops after the required number of DMA cycles.
21. What is memory mapping?
The assignment of memory addresses to various registers in a memory chip is called as memory
mapping.
22. What is I/O mapping?
The assignment of addresses to various I/O devices in the memory chip is called as I/O mapping.
23. What is Key bouncing?
Mechanical switches are used as keys in most of the keyboards. When a key is pressed the contact bounce back and forth and settle down only after a small time delay (about 20ms). Even though a key is actuated once, it will appear to have been actuated several times. This problem is called Key Bouncing.
24. What is the use of stepper motor?
A stepper motor is a device used to obtain an accurate position control of rotating shafts. A stepper motor employs rotation of its shaft in terms of steps, rather than continuous rotation as in case of AC or DC motor.
UNIT V
MICROCONTROLLERS
PART A (2 MARKS)
1. What is mean by microcontroller?
A device which contains the microprocessor with integrated peripherals like memory, serial ports, parallel ports, timer/counter, interrupt controller, data acquisition interfaces like ADC, DAC is called microcontroller.
2. List the features of 8051 microcontroller?
The features are
*single_supply +5 volt operation using HMOS technology.
*4096 bytes program memory on chip(not on 8031)
*128 data memory on chip.
*Four register banks.
*Two multiple mode,16-bit timer/counter.
*Extensive Boolean processing capabilities.
*64 KB external RAM size
*32 bi-directional individually addressable I/O lines.
*8 bit CPU optimized for control applications.
3. What are the addressing modes supported by 8051?
• Register addressing
• Direct byte addressing
• Register indirect
• Immediate
• Register specific
• index
4. State the function of RS1 and RS0 bits in the flag register of Intel 8051 microcontroller?
RS1 RS0 Bank Selection
0 0 Bank 0
0 1 Bank 1
1 0 Bank 2
1 1 Bank 3
5. Explain the function of the PSEN pin of 8051.
PSEN: PSEN stands for program store enable. In 8051 based system in which an external ROM holds the program code, this pin is connected to the OE pin of the ROM.
6. Explain the function of the EA pin of 8051.
EA: EA stands for external access. When the EA pin is connected to Vcc, program fetched to addresses 0000H through 0FFFH are directed to the internal ROM and program fetches to addresses 1000H through FFFFH are directed to external ROM/EPROM. When the EA pin is grounded, all addresses fetched by program are directed to the external ROM/EPROM.
7. Explain the 16-bit registers DPTR of 8051.
DPTR: DPTR stands for data pointer. DPTR consists of a high byte (DPH) and a low byte (DPL). Its function is to hold a 16-bit address. It may be manipulated as a 16-bit data register or as two independent 8-bit registers. It serves as a base register in indirect jumps, lookup table instructions and external data transfer.
8. Explain the function of the SP of 8051.
SP: SP stands for stack pointer. SP is a 8- bit wide register. It is incremented before data is stored during PUSH and CALL instructions. The stack array can reside anywhere in on-chip RAM. The stack pointer is initialised to 07H after a reset. This causes the stack to begin at location 08H.
9. Name the special functions registers available in 8051.
• Accumulator
• B Register
• Program Status Word.
• Stack Pointer.
• Data Pointer.
• Port 0
• Port 1
• Port 2
• Port 3
• Interrupt priority control register.
• Interrupt enable control register.
10. Explain the register IE format of 8051. EA
ET2
ES
ET1
EX1
ET0
EX0