CS8491 Computer Architecture LTPC 3 0 0 3
CS8491 Computer Architecture LTPC 3 0 0 3
REFERENCES:
1. William Stallings, Computer Organization and Architecture – Designing for Performance, Eighth
Edition, Pearson Education, 2010.
2. John P. Hayes, Computer Architecture and Organization, Third Edition, Tata McGraw Hill, 2012.
3. John L. Hennessey and David A. Patterson, Computer Architecture – A Quantitative Approach‖,
Morgan Kaufmann / Elsevier Publishers, Fifth Edition, 2012.
The MAR (memory address register) is used to hold the address of the location to or from which data
are to be transferred
The MDR(memory data register) contains the data to be written into or read out of the addressed
location.
12. Define CPI BTL1
The term clock cycles per instruction which is the average number of clock cycles each instruction
takes to execute, is often abbreviated as CPI.
CPI= CPU clock cycles/instruction count.
13. Define throughput and throughput rate. BTL1
throughput -the total amount of work done in a given time.
throughput rate-the rate at which the total amount of work done at a given time.
14. State and explain the performance equation? BTL2
Suppose that the average number of basic steps needed to execute one machine instruction is S,where each
basic step is completed in one clock cycle. if the clock cycle rate is R cycles per second, the program execution
time is given by
T = (N x S) / R this is often referred to as the basic performance equation.
15. What are the various types of operations required for instructions? BTL1
Data transfers between the main memory and the CPU registers
Arithmetic and logic operation on data
Program sequencing and control
I/O transfers
16. What are the various units in the computer? BTL1
Input unit
Output unit
Control unit
Memory unit
Arithmetic and logical unit
PART B
1 Explain in detail, the eight ideas in computer architecture. (13m) BTL4
Answer: U-1 in refer notes
Definition(2m)
Diagram(4m)
Explanation(7m)
Design for Moore’s Law
Use Abstraction to simplify design
Make the common case fast
Performance via parallelism
Performance via pipelining
Performance via prediction
Hierarchy of memories
Dependability via redundancy
2 Explain in detail, the components of a computer system. (13m) (Apr/may 2018) BTL4
Answer: U-1 Refer notes
Explanation(8m)
Diagram(5m)
The five classic components of a computer are input, output, memory, datapath, and control.
3 Explain in detail, the technologies for building processor and memory. (13m) BTL4
Technologies. (3m)
Answer: U-1 Refer notes
The manufacturing process for integrated circuits: (7m)
The manufacture of a chip begins with silicon, a substance found in sand. Because silicon does
not conduct electricity well, it is called a semiconductor. With a special chemical process, it is
possible to add materials to silicon that allow tiny areas to transform into one of three devices:
Excellent conductors of electricity (using either microscopic copper or aluminum wire)
Excellent insulators from electricity (like plastic sheathing or glass)
Areas that can conduct or insulate under special conditions (as a switch) Transistors fall in the
last category.
A VLSI circuit, then, is just billions of combinations of conductors, insulators, and switches
manufactured in a single small package. The manufacturing process for integrated circuits is
critical to the cost of the chips and hence important to computer designers.
The process starts with a silicon crystal ingot, which looks like a giant sausage. Today, ingots are
8–12 inches in diameter and about 12–24 inches long. An ingot is finely sliced into wafers no
more than 0.1 inches thick.
JIT-2106 /CSE/Ms.R.Revathi/II Yr/Sem 04/CS8491 COMPUTER ARCHITECTURE/UNIT 1-5 QB+Keys/Ver3.0
1.5
REGULATION: 2017 ACADEMIC YEAR: 2020-2021
These wafers then go through a series of processing steps, during which patterns of chemicals
are placed on each wafer, creating the transistors, conductors, and insulators discussed earlier.
Today’s integrated circuits contain only one layer of transistors but may have from two to eight
levels of metal conductor, separated by layers of insulators.
Diagram(3m)
4 Explain in detail, the performance of a computer. (13m) BTL4
Defining Performance:
If you were running a program on two different desktop computers, you’d say that the faster one is the
desktop computer that gets the job done first. If you were running a datacenter that had several servers
running jobs submitted by many users, you’d say that the faster computer was the one that completed
JIT-2106 /CSE/Ms.R.Revathi/II Yr/Sem 04/CS8491 COMPUTER ARCHITECTURE/UNIT 1-5 QB+Keys/Ver3.0
1.6
REGULATION: 2017 ACADEMIC YEAR: 2020-2021
This means that for two computers X and Y, if the performance of X is greater than the performance of Y, we
have
That is, the execution time on Y is longer than that on X, if X is faster than Y. To relate the performance
of two different computers quantitatively. We will use the phrase “X is n times faster than Y”—or
equivalently “X is n times as fast as Y”—to mean
Instruction Performance : One way to think about execution time is that it equals the number of instructions
executed multiplied by the average time per instruction.
Therefore, the number of clock cycles required for a program can be written as
fragment.
clock cycles per instruction (CPI) Average number of clock cycles per instruction for a program or program
The Classic CPU Performance Equation: The basic performance equation in terms of instruction count (the
number of instructions executed by the program),
CPI, and clock cycle time:
or, since the clock rate is the inverse of clock cycle time:
The basic components of performance and how each is measured. These factors are combined to yield
execution time measured in seconds per program:
Instruction mix: A measure of the dynamic frequency of instructions across one or many programs. The
performance of a program depends on the algorithm, the language, the compiler, the architecture, and the actual
hardware.
PART-C
1
Write short notes on : i) Operations and operands ii) Representing instructions iii) Logical and control
operations (15m) BTL2
Operations of the Computer Hardware:
Every computer must be able to perform arithmetic. The MIPS assembly language Notation add a, b, c
instructs a computer to add the two variables b and c and to put their sum in a.
The natural number of operands for an operation like addition is three: the two numbers being added
together and a place to put the sum. Requiring every instruction to have exactly three operands, no
more and no less, conforms to the philosophy of keeping the hardware simple: hardware for a variable
number of operands is more complicated than hardware for a fixed number.
Three underlying principles of hardware design:
Design Principle 1: Simplicity favors regularity.
Design Principle 2: Smaller is faster.
Design Principle 3: Good design demands good compromises.
operands of the Computer Hardware:
Unlike programs in high-level languages, the operands of arithmetic instructions are restricted; they
must be from a limited number of special locations built directly in hardware called registers.
Registers are primitives used in hardware design that are also visible to the programmer when the
computer is completed, so you can think of registers as the bricks of computer construction.
The size of a register in the MIPS architecture is 32 bits; groups of 32bits occur so frequently that they
JIT-2106 /CSE/Ms.R.Revathi/II Yr/Sem 04/CS8491 COMPUTER ARCHITECTURE/UNIT 1-5 QB+Keys/Ver3.0
1.8
REGULATION: 2017 ACADEMIC YEAR: 2020-2021
Data transfer instruction is a command that moves data between memory and registers. Address A value
used to delineate the location of a specific data element within a memory array.
Memory addresses and contents of memory at those locations.
The data transfer instruction that copies data from memory to a register is traditionally called load. The
actual MIPS name for this instruction is lw, standing for load word.
lw $t0,8($s3) # Temporary reg $t0 gets A[8]
The instruction complementary to load is traditionally called store; it copies data from a register to
memory. The actual MIPS name is sw, standing for store word.
sw $t0,48($s3) # Stores h + A[8] back into A[12]
Load word and store word are the instructions that copy words between memory and registers in the
MIPS architecture.
Constant or Immediate Operands:
Many times a program will use a constant in an operation—for example, incrementing an index to point
to the next element of an array.
This quick add instruction with one constant operand is called add immediate or addi. To add 4 to
register $s3,
Computer programs calculate both positive and negative numbers, so we need a representation that
distinguishes the positive from the negative.
The most obvious solution is to add a separate sign, which conveniently can be represented in a single
bit; the name for this representation is sign and magnitude.
Signed and Unsigned Numbers:
Signed versus unsigned applies to loads as well as to arithmetic. The function of a signed load is to copy
JIT-2106 /CSE/Ms.R.Revathi/II Yr/Sem 04/CS8491 COMPUTER ARCHITECTURE/UNIT 1-5 QB+Keys/Ver3.0
1.9
REGULATION: 2017 ACADEMIC YEAR: 2020-2021
the sign repeatedly to fill the rest of the register—called sign extension—but its purpose is to place a
correct representation of the number within that register.
Unsigned loads simply fill with 0s to the left of the data, since the number represented by the bit pattern
is unsigned.
i) Representing instructions
Instructions are kept in the computer as a series of high and low electronic signals and may be
represented as numbers.
In fact, each piece of an instruction can be considered as an individual number, and placing these
numbers side by side forms the instruction.
Instruction format: A form of representation of an instruction composed of fields of binary numbers.
Machine language: Binary representation used for communication within a computer system. Hexa decimal
Numbers in base 16.
MIPS Fields:
0000 0000 0000 0000 0000 0000 0000 1001two = 9ten and the instruction to shift left by 4 was executed, the
new value would be: 0000 0000 0000 0000 0000 0000 1001 0000two = 144ten
The dual of a shift left is a shift right. The actual name of the two MIPS shift instructions are called shift
left logical (sll) and shift right logical (srl).
AND: A logical bit by- bit operation with two operands that calculates a 1 only if there is a 1 in both operands.
And $t0,$t1,$t2 # reg $t0 = reg $t1 & reg $t2
OR: A logical bit-by bit operation with two operands that calculates a 1 if there is a 1 in either operand.
or $t0,$t1,$t2 # reg $t0 = reg $t1 | reg $t2
NOT: A logical bit-by bit operation with one operand that inverts the bits; that is, it replaces every 1 with a 0,
and every 0 with a 1.
NOR: A logical bit-by bit operation with two operands that calculates the NOT of the OR of the two operands.
That is, it calculates a 1 only if there is a 0 in both operands.
Instructions for Making Decisions:
MIPS assembly language includes two decision-making instructions, similar to an if statement with a go
to. The first instruction is
beq register1, register2, L1
This instruction means go to the statement labeled L1 if the value in register1 equals the value in
register2. The mnemonic beq stands for branch if equal.
The second instruction is bne register1, register2, L1 It means go to the statement labeled L1 if the value
in register1 does not equal the value in register2.
The mnemonic bne stands for branch if not equal. These two instructions are traditionally called
conditional branches.
the compiled MIPS code for this C if statement if (i == j) f = g + h; else f = g – h; is given as bne $s3,$s4,Else #
go to Else if i ≠ j conditional branch
An instruction that requires the comparison of two values and that allows for a subsequent transfer of
control to a new address in the program based on the outcome of the comparison.
Loops:
Decisions are important both for choosing between two alternatives—found in ifstatements—and for
iterating a computation—found in loops.
Eg1: Loop: sll $t1,$s3,2 # Temp reg $t1 = i * 4
Eg 2: j Loop # go to Loop
Exit:
Case/Switch Statement:
Most programming languages have a case or switch statement that allows the programmer to select one
of many alternatives depending on a single value.
Jump address table also called jump table. A table of addresses of alternative instruction sequences.
2 Explain in detail, the Addressing & Addressing Modes. (15m) (Apr/may 2018) BTL4
Answer: U-1Refer notes Carl hamacher book Pageno:48 (10m)
Immediate addressing, where the operand is a constant within the instruction itself
1. Register addressing, where the operand is a register
2. Base or displacement addressing, where the operand is at the memory location whose address is
the sum of a register and a constant in the instruction
3. PC-relative addressing, where the branch address is the sum of the PC and a constant in the
instruction
4. Pseudodirect addressing, where the jump address is the 26 bits of the instruction concatenated with
the upper bits of the PC.
Diagram(5m)
Immediate Addressing Mode
Absolute(Direct) Addressing Mode
Indirect Addressing Mode
Register Addressing Mode
Base with index Addressing Mode
Base with index & offset Addressing Mode
Additional Modes(Increment & Decrement Addressing Mode)
Addition and Subtraction – Multiplication – Division – Floating Point Representation – Floating Point
Operations – Subword Parallelism
PART A
1 State the principle of operation of a carry look-ahead adder. BTL2
The input carry needed by a stage is directly computed from carry signals obtained from all the
preceding stages i-1,i-2,…..0, rather than waiting for normal carries to supply slowly from stage
to stage.
An adder that uses this principle is called carry look-ahead adder.
2 What are the main features of booth’s algorithm? BTL1
It achieves some efficiency in the number of addition required when the multiplier has a few
large blocks of 1s.
The first technique guarantees that the maximum number of summands that must be added is n/2
for n-bit operands.
The second technique reduces the time needed to add the summands.
4 What is bit pair recoding? give an example. BTL1
Group the booth-recoded multiplier bits in pairs and observe the following: the pair (+1 -1) is
equivalent to the pair (0 +1)that is instead of adding -1 times the multiplicand m at shift position
i to +1 the same result is obtained by adding +1
5 What is the advantage of using booth algorithm? BTL1
It handles both positive and negative multiplier uniformly.
It achieves efficiency in the number of additions required when the multiplier has a few large
blocks of 1’s.
The speed gained by skipping 1’s depends on the data.
6 Write the algorithm for restoring division BTL3
Do the following for n times:
shift a and q left one binary position.
subtract m and a and place the answer back in a.
if the sign of a is 1, set q0 to 0 and add m back to a.
where a- accumulator, m- divisor, q- dividend.
7 Write the algorithm for non restoring division. BTL3
Do the following for n times:
If the sign of a is 0, shift a and q left one bit position and subtract m from a; otherwise, shift a and
q left and add m to a.
Now, if the sign of a is 0, set q0 to 1; otherwise, set q0 to0.
step 2: if the sign of a is 1, add m to a.
8 Explain about the special values in floating point numbers. BTL2
The end values 0 to 255 of the excess-127 exponent e are used to represent special values such
as:
when e= 0 and the mantissa fraction m is zero the value exacts 0 is represented.
when e= 255 and m=0, the value is represented.
when e= 0 and m=0, denormal values are represented.
when e= 2555 and m=0, the value represented is called not a number.
Choose the number with the smaller exponent and shift its mantissa right a number of steps equal
to the difference in exponents.
Set the exponent of the result equal to the larger exponent.
Perform addition/subtraction on the mantissa and determine the sign of the result
Normalize the resulting value, if necessary.
10 Write the multiply rule for floating point numbers. BTL3
In some cases, the binary point is variable and is automatically adjusted as computation proceeds.
In such case, the binary point is said to float and the numbers are called floating point numbers.
14 In floating point numbers when so you say that an underflow or overflow has occurred? BTL5
In single precision numbers when an exponent is less than -126 then we say that an underflow has
occurred.
In single precision numbers when an exponent is less than +127 then we say that an
overflow has occurred.
15 In floating point numbers when so you say that an underflow or overflow has occurred? BTL5
In single precision numbers when an exponent is less than -126 then we say that an underflow has
occurred.
In single precision numbers when an exponent is less than +127 then we say that an overflow has
occurred.
PART B
1 Summarize about the sub word parallelism. (13m) BTL2
Since every desktop microprocessor by definition has its own graphical displays, as
transistor budgets increased it was inevitable that support would be added for graphics
operations.
Many graphics systems originally used 8 bits to represent each of the three primary colors
plus 8 bits for a location of a pixel. The addition of speakers and microphones for
teleconferencing and video games suggested support of sound as well. Audio samples
need more than 8 bits of precision, but 16 bits are sufficient.
Every microprocessor has special support so that bytes and halfwords take up less space
when stored in memory (see Section 2.9), but due to the infrequency of arithmetic
operations on these data sizes in typical integer programs, there was little support beyond
data transfers. Architects recognized that many graphics and audio applications would
perform the same operation on vectors of this data.
By partitioning the carry chains within a 128-bit adder, a processor could use parallelism
to perform simultaneous operations on short vectors of sixteen 8-bit operands, eight 16-bit
operands, four 32-bit operands, or two 64-bit operands. The cost of such partitioned
adders was small.
Given that the parallelism occurs within a wide word, the extensions are classified as
subword parallelism. It is also classified under the more general name of data level
parallelism. They have been also called vector or SIMD, for single instruction, multiple
data (see Section 6.6). The rising popularity of multimedia applications led to arithmetic
instructions that support narrower operations that can easily operate in parallel.
For example, ARM added more than 100 instructions in the NEON multimedia instruction
extension to support subword parallelism, which can be used either with ARMv7 or
ARMv8. It added 256 bytes of new registers for NEON that can be viewed as 32 registers
8 bytes wide or 16 registers 16 bytes wide. NEON supports all the subword data types
you can imagine except 64-bit floating point numbers:
8-bit, 16-bit, 32-bit, and 64-bit signed and unsigned integers
32-bit floating point numbers
Figure shows the memory structures of an NVIDIA GPU. We call the onchip memory that is local
Explain in detail, the division algorithm, with a neat diagram. (13m) (Apr/may 2018) BTL4
Answer: U-2 Refer notes carl hamacher book-page no:390
Explanation:(5m) & Algorithm:(5m)
3
Step 1: Shift A&Q left 1 binary bit position
Diagram:(3m)
4
Explain in detail, the flow chart of floating-point multiplication. (13m) BTL4
Answer: U-2 Refer notes carl hamacher book-page no:398
Explanation:(5m) &Algorithm:(5m),
Step 1: If either multiplicand or multiplier is 0, result will be 0
Step 2: Add the exponents & subtract bias.
Step 3: Multiply the mantissas & determine the sign of the result
Step 4: Result must be normalized
Diagram:(3m)
PART C
Explain in detail, the block diagram of an arithmetic unit for floating-point addition &
1 subtraction. (15m) (Apr/may 2018) BTL4
Answer: U-2 Refer notes carl hamacher book-page no:393
Explanation & Algorithm:(10m),
Step 1: Change the sign of Q for subtraction & check zero.
Step 2: Align mantissa
Step 3: Addition
Step 4: Normalization
Diagram:(5m)
The situation that prevents the next instruction in the instruction stream from executing during its
designated clock cycle. stall is introduced by hazard. (ideal stage).
6 State different types of hazards that can occur in pipeline. BTL1&2
The types of hazards that can occur in the pipelining were,
Data hazards.
Instruction hazards.
Structural hazards.
Operand forwarding
Software approach
For e.g. an instruction with register indirect mode cannot proceed to fetch the
operand if the previous instructions is loading the address into the register. hence operand access
is delayed degrading the performance of pipeline.
12 How compiler is used in pipelining? BTL5
A compiler translates a high level language program into a sequence of machine instructions.
To reduce n, we need to have suitable machine instruction set and a compiler that makes good use
of it.
An optimizing compiler takes advantages of various features of the target processor to reduce the
product n*s, which is the total number of clock cycles needed to execute a program.
The number of cycles is dependent not only on the choice of instruction, but also on the order in
which they appear in the program.
The compiler may rearrange program instruction to achieve better performance of course, such
changes must not affect of the result of the computation.
13 List out the methods used to improve system performance. BTL1
The methods used to improve system performance are
Processor clock
Pipelining
Clock rate
Instruction set
Compiler
PC is loaded with address of interrupt handler and handling program to handle it.
18 Web server is to be enhanced with a new CPU which is 10 times faster on computation than old CPU
The original CPU spent 40% its time processing and 60% of its time waiting for I/O. What will be
the overall speedup? Nov/Dec 2018 BTL1
Overall speedup= 0.4*10+0.6 = 4.6
0.4+0.6
19 List the types of Exception BTL1
Precise Exception- partially executed instructions are discarded.
Imprecise Exception- instructions executed to completion
20 List out the common steps to implement any type of instruction Nov/Dec 2018 BTL1
Fetch & Decode
PART B
1
Explain in detail, the basic implementation of MIPS. (13m) BTL4
Answer: U-3 refer notes pageno:3
Explanation:8m
The Basic MIPS Implementation
An Overview of the Implementation
Diagram:5m
2
Explain in detail, the steps involved in building a data path unit. (13m) (Apr/May 2018) BTL4
Answer: U-3 Refer Notes pageno:1
Explanation:8m
Building a datapath
Types of Elements in the Datapath
Datapath Segment for ALU, LW & SW, Br. Instructions
Diagram:5m
3
Explain in detail about the operation of datapath & Control Nov/Dec2017 BTL4
Building a datapath/Operation (7)
Building a datapath
Types of Elements in the Datapath
Datapath Segment for ALU, LW & SW, Br. Instructions
Diagram
Control (6)
Control Implementation scheme
ALU Control
Designing the main control unit
Format for R, L&S, Br. Instructions
Important observations about this Ins. Format
Table/Cmp- Functions of Seven Single bit control Lines
Diagram
4
Explain in detail, the design of the main control unit. (13m) BTL4
Answer: U-3 Refer Notes
Explanation(8m)
Control Implementation scheme
ALU Control
Designing the main control unit
Format for R, L&S, Br. Instructions
Important observations about this Ins. Format
Table/Cmp- Functions of Seven Single bit control Lines
Diagram:(5m)
5 Explain in detail, the pipelined data path and control. (13m) (Apr/May 2018) BTL5
Answer: U-3 Refer Notes carl hamacher book-page no:479
Explanation(8m)
Implementation of 2 stage instruction pipelining
Organization of CPU with 4 stage Instruction pipelining
Implementation of MIPS Instruction Pipeline
The Pipelined Control & datapath(5m)
Instruction fetch:
Instruction decode and register file read:
JIT-2106 /CSE/Ms.R.Revathi/II Yr/Sem 04/CS8491 COMPUTER ARCHITECTURE/UNIT 1-5 QB+Keys/Ver3.0
1.21
REGULATION: 2017 ACADEMIC YEAR: 2020-2021
each with half the latency of the original stage, which stage would you split & what is
the new clock cycle time of the processor? Assuming there are no stalls or hazards,
what is the utilization of the write-register port of the “Registers” unit? Nov/Dec
2018 BTL3
Answer
(a) Clock cycle tome in a pipelined processor=350ps
Clock cycle time in non-pipelined processor= 250+350+150+300+200=1250ps
(b) We have to split one stage of the pipelined datapath which has a maximum
latency i.e, ID
After splitting ID stage with latencies ID1=175ps
ID2=175ps
We have new clock cycle time of the processor equal to 300ps
(c) Assuming there are no stalls or hazards, the utilization of the
data memory= 20% to 15%=35%
(d) Assuming there are no stalls or hazards, the utilization of the write reg. port of
the reg. Unit = 40%+25% = 65%
5 Summarize the following sequence of instructions are executed in the basic 5- stage pipelined
processor Apr/May 2018 BTL3/4 (14m)
OR r1, r2, r3
OR r2, r1, r4
OR r1, r1, r2
(i) Indicate dependences & their type
Answer:
RAW- dependency in r1 between Instruction 1,2 & 3
RAW- dependency in r2 between Instruction 2 & 3
WAR- in r2 from Instructions 1 to 2
WAR- in r1 from Instructions 2 to 3
WAR- in r1 from Instructions 1 to 3
(ii) Assume there is no forwarding in this pipelined processor. Indicate hazards & add NOP
instructions to eliminate them.
Answer:
No hazards form WAR, WAW, Since there are 5 stages RAW cause data Hazards
OR r1, r2, r3
NOP
NOP
OR r2, r1, r4
NOP
NOP
OR r1, r1, r2
(iii) Assume there is full forwarding. Indicate hazards & add NOP instructions to eliminate
them.
Answer: In full forwarding the data hazards above are eliminated, thus there is no need for NOP
instructions.
UNIT 4- PARALLELISM
Parallel processing architectures and challenges, Flynn’s Classification, Hardware multithreading,
Multicore and shared memory multiprocessors, Introduction to Graphics Processing Units, Clusters and
Warehouse scale computers – Other Message passing Multiprocessors
PART A
1 What is instruction level parallelism? BTL1
Pipelining is used to overlap the execution of instructions and improve performance. this potential
overlap among instructions is called instruction level parallelism (ILP).
Data dependences
Name dependences
Control dependences
3 What is Multithreading? BTL1
Multithreading allows multiple threads to share the functional units of a single processor in an
overlapping fashion.to permit this sharing, the processor must duplicate the independent state of each
thread.
4 What are multiprocessors? mention the categories of multiprocessors? BTL1
Multiprocessor are used to increase performance and improve availability. the different categories are
SISD, SIMD, MISD, MIMD.
called cluster
Which is better tradeoff among the following two proposals? First: Compiler optimization that
reduces number of integer instructions by 25%(assume each integer instruction takes the same
amount of time); Second: Hardware optimization that reduces the latency of each I/O operations
from 6µs to 5µs. BTL2 May-18
Solution:
If we can speed up X of the program by S times, Amdahl’s law gives the total speedup, S tot.
Stot=1/(X/S+(1-X)
First case: Speed integer instruction time
X=0.2
S=1/(1-0.25)=1.33
SINT=1/[(0.2/1.33)+(1-0.2)]
= 1.052
Second case: Speedup I/O operation time.
X=0.35
S=6µs/5µs
= 1.2
SIO=1/[(0.35/1.2)+(1-0.35)]
= 1.062
Thus, speeding up I/O operations is done.
PART B
1 Explain the challenges in parallel processing. (13m) (Apr/May 2018) BTL4
The tall challenge facing industry is to create hardware and software that will make it easy to
write correct parallel processing programs that will execute efficiently in performance and
energy as number of cores per chip scales.
Only challenge of parallel revolution is figuring out how to make naturally sequential
software have high performance on parallel hardware, but it is also to make concurrent
programs have high performance on multiprocessors as number of processors increases.
The difficulty with parallelism is not hardware; it is that too few important application
programs have been rewritten to complete tasks sooner on multiprocessors.
It is difficult to write software that uses multiple processors to complete one task faster, and
problem gets worse as number of processors increases.
The first reason is that you must get better performance or better energy efficiency
from a parallel processing program on a multiprocessor; why is it difficult to write
parallel processing programs that are fast, especially as number of processors
increases
For both analogy and parallel programming, challenges include scheduling,
partitioning work into parallel pieces, balancing load evenly between workers, time to
synchronize, and overhead for communication between parties.
The challenge is stiffer with more reporters for a newspaper story and with more
processors for parallel programming.
Another obstacle, namely Amdahl’s Law. It reminds us that even small parts of a program
must be parallelized if program is to make good use of many cores. Speed-up Challenge:
Suppose you want to achieve a speed-up of 90 times faster with100 processors.
What percentage of original computation can be sequential? Amdahl’s Law in terms of
speed-up versus original execution time:
0.1%
Speed-up Challenge: Balancing Load
Example demonstrates importance of balancing load, for just a single processor with
twice load of the others cuts speed-up by a third, and five times load on just one
processor reduces speed-up by almost a factor of three.
2 Explain in detail, hardware multithreading unit. (13m) (Apr/May 2018) BTL4
Answer: U-5 Refer Notes Pageno:5
Explanation(10m)
Interleaved
Blocked
Simultaneous(SMT)
Chip processing
Scalar
Superscalar
VLSW
Diagram(3m)
3 Summarize about the Introduction to Graphics Processing Units (GPU) (13m) BTL2
The original justification for adding SIMD instructions to existing architectures was that
many microprocessors were connected to graphics displays in PCs and workstations, so an
increasing fraction of processing time was used for graphics.
As Moore’s Law increased number of transistors available to microprocessors, it therefore
made sense to improve graphics processing.
A major driving force for improving graphics processing was computer game industry, both
on PCs and in dedicated game consoles such as Sony PlayStation.
The rapidly growing game market encouraged many companies to make increasing
investments in developing faster graphics hardware, and positive feedback loop led graphics
processing to improve at a faster rate than general-purpose processing in mainstream
microprocessors.
Given that graphics and game community had different goals than microprocessor
development community, it evolved its own style of processing and terminology.
As graphics processors increased in power, they earned name Graphics Processing Units or
GPUs to distinguish themselves from CPUs. For a few hundred dollars, anyone can buy a
GPU today with hundreds of parallel floating-point units, which makes high-performance
computing more accessible.
The interest in GPU computing blossomed when potential was combined with a
JIT-2106 /CSE/Ms.R.Revathi/II Yr/Sem 04/CS8491 COMPUTER ARCHITECTURE/UNIT 1-5 QB+Keys/Ver3.0
1.29
REGULATION: 2017 ACADEMIC YEAR: 2020-2021
programming language that made GPUs easier to program. Hence, many programmers of
scientific and multimedia applications today are pondering whether to use GPUs or CPUs.
Here are some of key characteristics as to how GPUs vary from CPUs:
GPUs are accelerators that supplement a CPU, so y do not need be able to perform all tasks
of a CPU.
This role allows m to dedicate all their resources to graphics. It’s fine for GPUs to perform
some tasks poorly or not at all, given that in a system with both a CPU and a GPU, CPU can
do m if needed.
The GPU problems sizes are typically hundreds of megabytes to gigabytes, but not
hundreds of gigabytes to terabytes. These differences led to different styles of architecture:
Perhaps biggest difference is that GPUs do not rely on multilevel caches to overcome long
latency to memory, as do CPUs.
Instead, GPUs rely on hardware multithreading (Section 6.4) to hide latency to memory. That
is, between time of a memory request and time that data arrives, GPU executes hundreds or
thousands of threads that are independent of that request.
The GPU memory is thus oriented toward bandwidth rather than latency. There are even
special graphics DRAM chips for GPUs that are wider and have higher bandwidth than
DRAM chips for CPUs.
In addition, GPU memories have traditionally had smaller main memories than
conventional microprocessors. In 2013, GPUs typically have 4 to 6 GiB or less, while CPUs
have 32 to 256 GiB.
Finally, keep in mind that for general-purpose computation, you must include time to
transfer data between CPU memory and GPU memory, since GPU is a coprocessor.
Given reliance on many threads to deliver good memory bandwidth, GPUs can
accommodate many parallel processors (MIMD) as well as many threads.
Hence, each GPU processor is more highly multithreaded than a typical CPU, plus y have
more processors.
computers use large multilevel caches that try to contain whole working sets
completely.
Both use a 64-bit address space, although physical main memory is much smaller
in GPUs. While GPUs support memory protection at page level, y do not yet
support demand paging.
SIMD processors are also similar to vector processors.
The multiple SIMD processors in GPUs act as independent MIMD cores, just as
many vector computers have multiple vector processors.
4. Explain in detail about the multicore & shared memory multiprocessors with a neat
diagram(13m) BTL4
Answer: Refer notes
Introduction
Type1, Type2, Type3
Diagram
Shared memory
UMA
NUMA
Diagram
5 Describe about the Flynn’s classification with a neat diagram (13m) BTL2
Answer: Refer notes
Explanation- 9m
Diagram – 4m
Introduction
SISD
SIMD
MISD
MIMD
PART C
1 Explain in detail, the GPA with a neat diagram. (15m) BTL4
Answer: U-5 refer notes
Explanation (12m)
Introduction
GPU vs CPU
Connection between CPU & GPU
GPU Architecture
An Introduction to the NVIDIA GPU Architecture
Diagram (3m)
2 Explain in detail about the introduction to Multiprocessor network topologies. (15m) BTL1
Answer: Carl Hamacher book pageno:624
Explanation(10m)
Time shared Bus or common bus
Crossbar Switch
Multiport memory
Multistage Switching networks
Hypercube Interconnection
Diagram(5m)
3 Explain in detail, the shared memory multiprocessor, with a neat diagram. (15m) (Apr/May
2018) BTL4
Shared memory multiprocessor (SMP) is one that offers programmer a single physical
address space across all processors-which is nearly always case for multicore chips
Although a more accurate term would have been shared-address multiprocessor. Processors
communicate through shared variables in memory, with all processors capable of accessing
any memory location via loads and stores.
Note that such systems can still run independent jobs in their own virtual address spaces,
even if y all share a physical address space.
Single address space multiprocessors come in two styles. In first style, latency to a word in
memory does not depend on which processor asks for it.
Such machines are called uniform memory access (UMA) multiprocessors. In second style,
some memory accesses are much faster than others, depending on which processor asks for
which word, typically because main memory is divided and attached to different
microprocessors or to different memory controllers on same chip.
Such machines are called non uniform memory access (NUMA) multiprocessors. As you
might expect, programming challenges are harder for a NUMA multiprocessor than for a
UMA multiprocessor, but NUMA machines can scale to larger sizes and NUMAs can have
lower latency to nearby memory.
As processors operating in parallel will normally share data, you also need to coordinate
when operating on shared data; otherwise, one processor could start working on data before
another is finished with it.
This coordination is called synchronization, When sharing is supported with a single
address space, there must be a separate mechanism for synchronization. One approach uses
a lock for a shared variable.
Only one processor at a time can acquire lock, and or processors interested in shared data
must wait until original processor unlocks variable.
Pn is number that identifies processor, between 0 and 63. All processors start program by
running a loop that sums their subset of numbers:
Half of processors add pairs of partial sums, and n a quarter add pairs of new partial sums,
Each processor to have its own version of loop counter variable i, so we must indicate that it
is a private variable. Here is the code,
The time that elapses between the initiation of an operation and completion of that
operation, for example, the time between the read and the MFC signals.
The minimum time delay required between the initiations of two successive memory
operations, for example, the time between two successive read operations.
Many instructions in localized area of the program are executed repeatedly during some
time period and the remainder of the program is accessed relatively infrequently.
Optical or light based techniques for data storage, such memories usually employ optical
disk which resemble magnetic disk in that they store binary information in concentric tracks on
an electromechanically rotated disks.
The information is read as or written optically, however with a laser replacing the read write arm
of a magnetic disk drive. optical memory offer high storage capacities but their access rate is are
generally less than those of magnetic disk
9 What are static and dynamic memories? BTL1
static memory are memories which require periodic no refreshing. dynamic memories
are memories, which require periodic refreshing.
10 What are the components of memory management unit? BTL1
A facility for dynamic storage relocation that maps logical memory references into physical
memory addresses.
14 Why program controlled i/o is unsuitable for high-speed data transfer? BTL5
Many high speed peripheral; devices have a synchronous modes of operation, that is data
transfer are controlled by a clock of fixed frequency, independent of the CPU.
18 What is an interrupt?
An interrupt is an event that causes the execution of one program to be suspended and another program
to be executed
19 What is the difference between Serial interface & Parallel interface Dec15 BTL2
Serial Interface
It transfer data one bit at a time
Lower data transfer rate.
Needs less number of wires to connect devices in the system
Well suited for long distances, because fewer wires are used as compared to a parallel bus.
Parallel Interface
It can transmit more than one data bit at a time.
Faster data transfer rate.
Needs more number of wires to connect devices in the system.
The interconnection penalty increases as distances increase.
20 What is DMA? Or What is DMA operation? State its advantages or why we need DMA Dec
16/May 15/Dec 17 BTL1
A Special control unit may be provided to enable transfer a block of data directly between an external
device and memory without contiguous intervention by the CPU. This approach is called DMA. The
data transfer using such approach is called DMA operation.
Two main Advantages of DMA operation are:
The data transfer is very fast.
Processor is not involved in the data transfer operation and hence it is free to execute other tasks.
The I/O processor (IOP) has an ability to execute I/O instructions and it can have complete
control over I/O operation.
The I/O instructions are stored in main memory. When I/O transfer is required, the CPU
initiates an I/O transfer by instructing the I/O channel to execute an I/O program stored in the
main memory.
The I/O program specifies the device or devices, the area of memory storage, priority and
actions to be taken for certain error conditions.
Features and Functions of IOP
1. An IOP can fetch and execute its own instructions.
2. Instructions are specially designed for I/O processing.
3. In addition to data transfer, IOP can perform arithmetic and logic operations,
branches, searching and translation.
4. IOP does all work involved in I/O transfer including device setup, programmed I/O,
DMA operation.
5. IOP can transfer data from an 8-bit source to 16-bit destination and vice versa.
6. Communication between IOP and CPU is through memory based control blocks.
CPU defines tasks in the control blocks to locate a program sequence, called a
channel program.
7. IOP supports multiprocessing environment. IOP and CPU can do processing
simultaneously. This distributed processing approach improves system
performance and flexibility.
The Figure shows the block diagram of computer system with an I/O processor.
The CPU and I/O processor work independently and communicate with each other
using centrally located memory and DMA.
The CPU does the processing of needed in the solution of computational tasks and IOP
does the data transfer between various peripheral devices and the memory unit.
CPU and IOP Communication
The communication between CPU and IOP may be different for different processor
and IOP configurations. However, in most of cases the memory based control blocks
are used to store the information about the task to be performed.
The processor uses these blocks to leave information in it for the other processor. The
memory control block are linked, i.e., the address of the next memory based control
blocks is available in the previous memory based control block.
The figure shows the flowchart of sequence of operations that are carried out during
the CPU and IOP communication. The sequence of operations carried out during CPU
and IOP communication are:
1. CPU checks the existence of I/O path by sending an instruction.
2. In response to this IOP puts the status word in the memory stating the condition
f IOP and I/O device (Busy, ready, etc.)
3. CPU checks the status word and if all conditions are OK, it sends the
instruction to start I/O transfer along with the memory address where the IOP
program is stored.
4. After this CPU continues with another program.
5. IOP now conducts the I/O transfer using DMA and prepares status report.
6. On completion of I/O transfer, IOP sends an interrupt request to the CPU.The
CPU responds to the interrupt by issuing an instruction to read the status from
the IOP. The status indicates whether the transfer has been completed or is any
errors occurred during the transfer.
3 Compare & Design the mapping techniques & functions in involved in cache memory (13m)
(Apr/May2018) BTL4&6
Answer: U-4 Refer Notes, Carl hamacher book Pageno:316
Explanation(8m)
Direct mapping
Associative mapping(Fully Associative)
Set- Associative mapping
Diagram(5m)
4 Explain about the mass storage. (13m) BTL4
Answer: U-4 Refer notes, Carl hamacher book Pageno:358
Explanation(8m)
Magnetic disk
Floppy disk
RAID Disk arrays
Magnetic tapes
Optical Disk
Diagram(5m)
5 Expain about Interuppt Handling / Write the sequence of operations carried out by a
processor. When interrupted by a peripheral device connected to it. /Design & Explain a
parallel priority interrupt hardware for a system with 8 interuupt sources. Dec 15/May 17
BTL4
Answer:
Explanation (10m)
Interrupt Driven I/O
Enabling & disabling interrupts
Vectored Interuppts
Interuppt Nesting
Interuppt Priority
Recognition of interrupt & Response to interrupt
Diagram (3m)
Response to an interrupt with the flowchart & diagram
6 Explain about virtual memory & steps involved in Virtual Memory address translation
BTL2
Answer:
Explanation (10m)
Virtual memory
Concept of paging
Virtual to Physical Address Translation
Segment Translation
Page Translation
Diagram (3m)
7 Explain memory technologies in detail May17 BTL4
Answer:
Explanation: (10m)
RAM & ROM Technologies
Static RAM cell
Read operation
Write operation
CMOS Cell
Read operation
Write operation
DRAM
ROM, PROM, EPROM, EEPROM
Diagram (3m)
8 Explain Bus Arbitration techniques in DMA Dec 14/ May 17
Answer:
Explanation (10m)
Approaches to Bus Arbitration
Centralized bus arbitration
Daisy Chaining
Polling method
Independent request
Distributed bus arbitration
Diagram (3m)
9 Describe about the i/p & o/p devices in detail with a neat diagram. (15m) BTL1
(ii) The following sequence of instructions are executed in the basic 5-stage pipelined
processor
I1: lw $1, 40($6)
I2: add $6, $2, $2
I3: sw $6, 50($1)
JIT-2106 /CSE/Ms.R.Revathi/II Yr/Sem 04/CS8491 COMPUTER ARCHITECTURE/UNIT 1-5 QB+Keys/Ver3.0
1.41
REGULATION: 2017 ACADEMIC YEAR: 2020-2021
6 Assume the miss rate of an instruction cache is 2% & miss rate of data cache is 4% If a
processor has a CPI of 2 without any memory stalls & miss penalty 100 cycles for all misses,
determine how much faster a processor would run with a perfect cache that never missed.
Assume the frequency of all loads & stores is 36%
Solution: The number of memory miss cycles for instructions in terms of the instruction
count(I) is
Instruction miss cycle=I*2% * 100 = 2.00*I
As the frequency of all loads & stores is 36%, we can find the number of memory miss cycles
for data refernces:
Data miss cycles= I*36%*4%*100=1.44 *I
The total number of memory-stall cycles is 2.00 I + 1.44 I = 3.44 I. This is move then 3 cycles
of memory stall per instruction. Accordingly, the total CPI including memory stalls is 2+3.44 =
5.44. Since there is no change in instruction count or clock rate, the ratio of the CPU execution
times is
CPU time with stalls/CPU time with perfect cache = I*CPIstall * Clock cycle/ I*CPIperfect * Clock
cycle
= CPIstall /CPIperfect
= 5.44/2
The performance with the perfect cache is better by 2.72
Hit time is the time to access the upper level of the memory hierarchy, which includes the time
needed to determine whether the access is a hit or miss.
If a larger cache is used, there is increase in the access time i.e, the hit time. But at a certain
point, the increase in hit time due to larger cache results into decrease in miss rate i.e, the hit
rate increases and so the cache performance also increases.
AMAT(Average Memory Access Time) is the average time to access memory considering
both hits & misses & the frequency of different accesses
AMAT= Time for a hit + Miss rate * Miss penalty