Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Similar documents
Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

ELECTRICAL ENGINEERING

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

William Stallings Computer Organization and Architecture

CPU Structure and Function

data block 0, word 0 block 0, word 1 block 1, word 0 block 1, word 1 block 2, word 0 block 2, word 1 block 3, word 0 block 3, word 1 Word index cache

Micro-Operations. execution of a sequence of steps, i.e., cycles

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Please state clearly any assumptions you make in solving the following problems.

registers data 1 registers MEMORY ADDRESS on-chip cache off-chip cache main memory: real address space part of virtual addr. sp.

Advanced Memory Organizations

CS/CoE 1541 Mid Term Exam (Fall 2018).

William Stallings Computer Organization and Architecture

DC57 COMPUTER ORGANIZATION JUNE 2013

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

The levels of a memory hierarchy. Main. Memory. 500 By 1MB 4GB 500GB 0.25 ns 1ns 20ns 5ms

CS161 Design and Architecture of Computer Systems. Cache $$$$$

CPU Structure and Function

Computer Architecture CS372 Exam 3

SAE5C Computer Organization and Architecture. Unit : I - V

Blog -

s complement 1-bit Booth s 2-bit Booth s

CS Computer Architecture

Week 11: Assignment Solutions

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

CS433 Homework 2 (Chapter 3)

6x86 PROCESSOR Superscalar, Superpipelined, Sixth-generation, x86 Compatible CPU

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

Cache memories are small, fast SRAM-based memories managed automatically in hardware. Hold frequently accessed blocks of main memory

Processing Unit CS206T

CS433 Homework 2 (Chapter 3)

Perfect Student CS 343 Final Exam May 19, 2011 Student ID: 9999 Exam ID: 9636 Instructions Use pencil, if you have one. For multiple choice

Memory management units

CPUs. Caching: The Basic Idea. Cache : MainMemory :: Window : Caches. Memory management. CPU performance. 1. Door 2. Bigger Door 3. The Great Outdoors

Lecture 16. Today: Start looking into memory hierarchy Cache$! Yay!

3Introduction. Memory Hierarchy. Chapter 2. Memory Hierarchy Design. Computer Architecture A Quantitative Approach, Fifth Edition

Chapter 14 - Processor Structure and Function

Chapter 16. Control Unit Operation. Yonsei University

Caches and Memory Hierarchy: Review. UCSB CS240A, Fall 2017

These actions may use different parts of the CPU. Pipelining is when the parts run simultaneously on different instructions.

CS 3510 Comp&Net Arch

EECS151/251A Spring 2018 Digital Design and Integrated Circuits. Instructors: John Wawrzynek and Nick Weaver. Lecture 19: Caches EE141

Module 5 - CPU Design

Final Exam Fall 2007

Cache Memory COE 403. Computer Architecture Prof. Muhamed Mudawar. Computer Engineering Department King Fahd University of Petroleum and Minerals

ENGN 2910A Homework 03 (140 points) Due Date: Oct 3rd 2013

Cache introduction. April 16, Howard Huang 1

c. What are the machine cycle times (in nanoseconds) of the non-pipelined and the pipelined implementations?

registers data 1 registers MEMORY ADDRESS on-chip cache off-chip cache main memory: real address space part of virtual addr. sp.

V. Primary & Secondary Memory!

ELE 375 / COS 471 Final Exam Fall, 2001 Prof. Martonosi

Memory Hierarchy: Motivation

Alexandria University

Chapter 4. The Processor

Caches and Memory Hierarchy: Review. UCSB CS240A, Winter 2016

Plot SIZE. How will execution time grow with SIZE? Actual Data. int array[size]; int A = 0;

Summary of Computer Architecture

CAD for VLSI 2 Pro ject - Superscalar Processor Implementation

The University of Adelaide, School of Computer Science 13 September 2018

ELE 375 Final Exam Fall, 2000 Prof. Martonosi

PESIT Bangalore South Campus

ECE232: Hardware Organization and Design

Question Bank Microprocessor and Microcontroller

UNIT- 5. Chapter 12 Processor Structure and Function

cs470 - Computer Architecture 1 Spring 2002 Final Exam open books, open notes

Memory Technology. Caches 1. Static RAM (SRAM) Dynamic RAM (DRAM) Magnetic disk. Ideal memory. 0.5ns 2.5ns, $2000 $5000 per GB

University of Western Ontario, Computer Science Department CS3350B, Computer Architecture Quiz 1 (30 minutes) January 21, 2015

CS 433 Homework 4. Assigned on 10/17/2017 Due in class on 11/7/ Please write your name and NetID clearly on the first page.

ECE331: Hardware Organization and Design

There are four registers involved in the fetch cycle: MAR, MBR, PC, and IR.

Memory: Page Table Structure. CSSE 332 Operating Systems Rose-Hulman Institute of Technology

For this problem, consider the following architecture specifications: Functional Unit Type Cycles in EX Number of Functional Units

Predict Not Taken. Revisiting Branch Hazard Solutions. Filling the delay slot (e.g., in the compiler) Delayed Branch

Transistor: Digital Building Blocks

Computer Architecture and Organization. Instruction Sets: Addressing Modes and Formats

Q1: Finite State Machine (8 points)

Chapter 7 Large and Fast: Exploiting Memory Hierarchy. Memory Hierarchy. Locality. Memories: Review

Solutions for Chapter 7 Exercises

UNIT I BASIC STRUCTURE OF COMPUTERS Part A( 2Marks) 1. What is meant by the stored program concept? 2. What are the basic functional units of a

Lecture 29 Review" CPU time: the best metric" Be sure you understand CC, clock period" Common (and good) performance metrics"

SCRAM Introduction. Philipp Koehn. 19 February 2018

Lecture 9: Case Study MIPS R4000 and Introduction to Advanced Pipelining Professor Randy H. Katz Computer Science 252 Spring 1996

Memory. Lecture 22 CS301

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

INTRODUCTION OF MICROPROCESSOR& INTERFACING DEVICES Introduction to Microprocessor Evolutions of Microprocessor

Computer Architecture Sample Test 1

ECE331: Hardware Organization and Design

Virtual to physical address translation

CPSC 313, 04w Term 2 Midterm Exam 2 Solutions

Computer Architecture Memory hierarchies and caches

Where Does The Cpu Store The Address Of The

ECE 331 Hardware Organization and Design. UMass ECE Discussion 10 4/5/2018

Computer Organization and Technology Processor and System Structures

ECE331: Hardware Organization and Design

ECE 2300 Digital Logic & Computer Organization. More Caches Measuring Performance

Transcription:

Serial : 2BS_CS_C_Computer Orgnisation_248 Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: E-mail: info@madeeasy.in Ph: -452462 CLASS TEST 28- COMPUTER SCIENCE & IT Subject : Computer Organization Date of test : 24//28 Answer Key. (c) 7. (a) 3. (b). (b) 25. (b) 2. (c) 8. (d) 4. (b) 2. (c) 26. (c) 3. (c). (c) 5. (c) 2. (b) 27. (b) 4. (b). (b) 6. (d) 22. (d) 28. (a) 5. (b). (d) 7. (a) 23. (b) 2. (d) 6. (a) 2. (c) 8. (c) 24. (a) 3. (b)

CT-28 CS Computer Organization 7 Detailed Explanations. (c) PC holds the value of next instruction to be executed. We store the value of PC to MBR and value of stack pointer to MAR. Then store the value of PC which is available in MBR to location addressed by MAR. Atlast vector address return to the PC. This can be done in interrupt subprogram initialization. 2. (c) Execution time for pipeline = (k + n ) tp where k = Number of stages n = Number of instruction tp = Execution time = Max (all stages) P = [8 + 5 ] 8 = 456 P 2 = [5 + 5 ] 5 = 252 Time saved using P 2 = 456 252 = 536 nsec =.536 µsec 3. (c) In relative addressing mode content of the program counter is added to the address part of the instruction to get the effective address. 4. (b) ADD R, R, 2 R 3 SUB R, 3 R, R 2 ADD R, 2 R, R 3 ADD R, R, 2 R 3 RAW (In-Out) dependancy between consicutive instruction is considered only. 5. (b) For second it take byte 64k So for 64 kbyte it takes = = 64 µsec Main memory latency = 64 µsec Total time required to fetch = 64 µsec + 64 µsec = 28 µsec 6. (a) S : Cache solely works on principle of locality i.e., temporal locality and spatial locality. S 2 : The performance of a system depends on the indirect proportion of memory accesses satisfied by cache. 7. (a) Opcode Register Memory Opcode bit = log 2 7 = 8 Register address bit = log 2 37 = 6 Memory address bit = 32 (8 + 6) = 8 = 2 8 words = 2 8 4 bytes = 2 2 bytes = MB 32

8 Computer Science & IT 8. (d) 2 s Complement of 72 is Append at LSB and start from right end taking pair of two symbols which are encoded as. +. (c) Actual Booth Multiplier Recorded + Average CPI = Σ C i I i =.5 + 2.23 + 3.7 + 4. =.5.46 +.5 +.4 =.87. (b) CISC processor contain less registers and larger instruction set.. (d) 2 3 4 5 6 7 8 2 3 4 IF ID EX MA WB IF ID EX MA WB S = Stall 4 cycles are required. IF ID S S S EX MA WB IF ID S S S S S S EX MA WB 2. (c) Number of lines = 8 K 6 2 Number of sets = 2 2 2 Physical address size = 28 bits 2 way set associative cache. Address format 28 bit Tag SO WO 6 bit log 2 log26 = 4 bit 828 8 CFED B

CT-28 CS Computer Organization 3. (b) Main m/m size = 28 M byte = 2 27 byte = 27 bits Cache memory size = 6 kbytes Block size = 32 bytes Number of lines (N) = 4 6 kb=52 2 = = 2 5 32 kb 2 Number of Sets (S) = N 2 = = 2 2 P Way 2 27 Tag Sets Word Offset 7 5 bits 7 log 2(2 ) log 2(32) = 5 bits = 7 bits TAG bits = 27 (7 + 5) = 5 bits 4. (b) Stages of Pipeline WB EX ID IF I I 3 I 3 I 4 I 4 I 4 I 2 I 3 I 3 I I 2 I 3 I 2 I I I 2 I 2 I 3 I 4 I 4 I 4 I I 2 I 3 I 3 I 4 2 3 4 5 6 7 8 2 3 Number of Clock Cycles 5. (c) Number of sets = 2 = 2 232 mod = 2 Hence the block 232 will map to set 2. 6. (d) Sum = Z =, C =, O =, S = 7. (a) Number of bits for control signals in vertical programming: log 2 (2) + log 2 () + log 2 (4) + log 2 (27) + log 2 (7) = + + 2 + 5 + 5 = 4 bits 256 CW = 8 bits VCW: Branch condition VCW size = 4 + 8 = 22 bits Vertical control memory size = 256 22 bits = 256 22 bytes 8 = 74 bytes Flag Control field Control memory address 4 8

Computer Science & IT 8. (c) 32 op code Source Source 2 6 K words 4 bits needed for addressing 32 4 4 4 Number of op-codes possible = 2 4 = 6 Remaining op-codes = 6 2 = 4 Number of one address instructions = 4 2 4 = 64 K. (b) Speed up = 4 = t n tp = CP I CP I n P # instruction Cycle time # instruction Cycle time CPI n (+ 2 + 3 + 4 + 5) (5) n p CPI n = 2 = 4 =.33 5 3 2. (c) Choice A is "register" addressing, which is supported by this architecture. Choice B is also typically covered when manufacturers speak of "register" addressing, which is supported by this architecture. Choice C is "immediate" (or "literal") addressing, which is not supported by this architecture. Choice D is "direct" (or "absolute") addressing, which is supported by this architecture. Choice E is "indirect" (or "memory indirect") addressing, which is supported by this architecture. 2. (b) Time taken by I/O device = 6 MB 28sec 28 kb = 22. (d) (i) Percentage time CPU is busy = 28 28 + 28 = 82.5 The address decoder enables the device to recognize it s address when this address appears on the address lines. (ii) Control circuitry is required to coordinate I/O transfers. (iii) The data register holds the data being transferred to or from the processor. The status register contains information relevant to the operation of the I/O device. Bus Address lines Data lines Control lines Address decoder Control circuit Data & Status registers Input device

CT-28 CS Computer Organization 23. (b) The required probability = C 3 (.35) 3 (.65) 7 =.252 24. (a) 4 way set associative Number of lines = 28 Number of sets = 28 4 = 32 Block size = 64 words TAG Set offset Word offset 2 (5 + 6) bits 5 bits 6 bits A : In addresses bit numbers ( 4) will decide the set number in cache memory. A 8, B 6, C, D 25. (b) Average Number of stalls per instruction = (# misses per instruction in L Hit time in L 2 ) + (# misses per instruction in L 2 Miss penalty of L 2 ) 2.5 memory references per instruction 2.5 instructions for references = 4 instructions. Average number of stalls per instruction = 25 + 2 4 25 4 4 = 25 + 75 = cycles. 26. (c). Since the cache line size is 8 bytes, the smallest unit of data transfer into cache from L2 cache or memory is 8 bytes. So if we have a miss for A[], both A[] and A[] get fetched into cache. 2. The cache is addressed by the lower bits of the address. However the address is byte address, and since a cache line can hold 8 bytes, the lower three bits of the address are used to address bytes inside a cache line. Since the cache is 2K bytes large, it has 2K/8 = 256 cache lines, which are addressed by 8 bits. Hence: bits -2 form the "offset", which is used to address inside a cache line bits 3 through of the address form the cache line address. Bits -32 form the TAG. (assuming a 32 bit architecture) Now, Consider the sequence : (2 iterations of the loop ) load A[] causes A[] and A[] at cache line load B[] *also addresses cache line * - so overwrites A[] & A[] above store A[] Nothing happens to cache (no write allocate) -> 8 bytes are written (8 is the unit of transfer) load A[] Accesses the SAME cache line as A[] So we load A[] and A[] again into line load B[2] addresses cache line - load B[2] and B[3] into cache line store A[] Again nothing happens as above.

2 Computer Science & IT So the pattern might be obvious : At every iteration of the loop, B[2*i] accesses a new cache line, and A overwrites the cache lines every two iterations. Since the loop is 256 iterations, B will just reach cache line 255 when the loop will finish. Since A has been erasing B half as fast, we would have A in the top half of the cache and B in the bottom half. Thus the cache contains : A[]-A[255] (In the top half) and B[256]- B[5] in the bottom half. Also, since the cache is write through, the entries in the cache will always be the freshly written entries. Since this is write through, we have to write 256 words = 24 bytes (all of A) back to the next level (L2 cache or memory). Assuming that the minimum transfer from a cache to a lower level is a cache line, this translates to 248 bytes. 27. (b) I/O ports are placed at addresses on bus and are accessed just like other memory location in computers that uses memory mapped I/O. 28. (a) Increase in the associativity leads to increase in the number of tag comparisons. Hence it leads to increase in cache access time. 2. (d) S : Separate I/O address space does not necessarily mean that I/O address lines are physically separated from the memory address lines. A special signal on the bus indicates that the requested read or write transfer is an I/O operation. S 2 : The address decoder, the data and status register and control circuitry required to coordinate I/O transfers constitute the interface circuit (Hence true). 3. (b). For a single instruction time taken on pipeline CPU is always greater than or equal to the non-pipeline. 2. When all stages have same delay and buffer latency is zero then for a single instruction execution time of pipeline CPU is equal to the execution time of non-pipeline CPU.