CS Computer Organization and Architecture II Practice Questions for Final

Similar documents
Page Replacement. 3/9/07 CSE 30341: Operating Systems Principles

Virtual Memory: Page Replacement. CSSE 332 Operating Systems Rose-Hulman Institute of Technology

Page Replacement Algorithms

Module 9: Virtual Memory

Basic Page Replacement

Module 9: Virtual Memory

Virtual Memory. 1 Administrivia. Tom Kelliher, CS 240. May. 1, Announcements. Homework, toolboxes due Friday. Assignment.

Virtual Memory. Virtual Memory. Demand Paging. valid-invalid bit. Virtual Memory Larger than Physical Memory

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Background. Virtual Memory (2/2) Demand Paging Example. First-In-First-Out (FIFO) Algorithm. Page Replacement Algorithms. Performance of Demand Paging

Lecture 17. Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne

Chapter 9: Virtual Memory

CS370 Operating Systems

MODERN OPERATING SYSTEMS. Chapter 3 Memory Management

Chapter 9: Virtual-Memory

Background. Demand Paging. valid-invalid bit. Tevfik Koşar. CSC Operating Systems Spring 2007

Lecture 14 Page Replacement Policies

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Optimal Algorithm. Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs

Chapter 6: Demand Paging

Chapter 9: Virtual-Memory Management. Operating System Concepts 8 th Edition,

Principles of Operating Systems

Memory management, part 2: outline. Operating Systems, 2017, Danny Hendler and Amnon Meisels

Virtual Memory COMPSCI 386

CS370 Operating Systems

ADRIAN PERRIG & TORSTEN HOEFLER Networks and Operating Systems ( ) Chapter 6: Demand Paging

CS 5523 Operating Systems: Memory Management (SGG-8)

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Chapters 9 & 10: Memory Management and Virtual Memory

Lecture-55 System Interface:

Memory management, part 2: outline

Computer Organization ECE514. Chapter 5 Input/Output (9hrs)

( B ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Shared memory (C) Semaphore (D) Monitor

Operating System Support

Chapter 3 - Top Level View of Computer Function

Virtual Memory Outline

Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition

a. What is a lower bound on the number of page faults? b. What is an upper bound on the number of page faults?

Operating Systems Virtual Memory. Lecture 11 Michael O Boyle

( D ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Semaphore (C) Monitor (D) Shared memory

Chapter 10: Virtual Memory. Background

CS370 Operating Systems

Virtual Memory Design and Implementation

Multiple Choice Type Questions

CS 333 Introduction to Operating Systems. Class 14 Page Replacement. Jonathan Walpole Computer Science Portland State University

CS 333 Introduction to Operating Systems. Class 14 Page Replacement. Jonathan Walpole Computer Science Portland State University

Chapter 8: Virtual Memory. Operating System Concepts

Chapter 10: Virtual Memory. Background. Demand Paging. Valid-Invalid Bit. Virtual Memory That is Larger Than Physical Memory

1. Background. 2. Demand Paging

Processes. Sanzheng Qiao. December, Department of Computing and Software

Blog -

These three counters can be programmed for either binary or BCD count.

Frequently asked questions from the previous class survey

Computer Architecture Review. ICS332 - Spring 2016 Operating Systems

Chapter 9: Virtual Memory

Objectives and Functions Convenience. William Stallings Computer Organization and Architecture 7 th Edition. Efficiency

FSM Design Problem (10 points)

Practice Exercises 449

Memory management. Requirements. Relocation: program loading. Terms. Relocation. Protection. Sharing. Logical organization. Physical organization

Memory Hierarchy. Goal: Fast, unlimited storage at a reasonable cost per bit.

Knowledge Organiser. Computing. Year 10 Term 1 Hardware

1. Internal Architecture of 8085 Microprocessor

First-In-First-Out (FIFO) Algorithm

CS420: Operating Systems

B. V. Patel Institute of Business Management, Computer &Information Technology, UTU

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMPUTER ARCHITECURE- III YEAR EEE-6 TH SEMESTER 16 MARKS QUESTION BANK UNIT-1

Virtual or Logical. Logical Addr. MMU (Memory Mgt. Unit) Physical. Addr. 1. (50 ns access)

CS307: Operating Systems

4.1 Paging suffers from and Segmentation suffers from. Ans

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

Demand Paging. Valid-Invalid Bit. Steps in Handling a Page Fault. Page Fault. Transfer of a Paged Memory to Contiguous Disk Space

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Where are we in the course?

Slide 6-1. Processes. Operating Systems: A Modern Perspective, Chapter 6. Copyright 2004 Pearson Education, Inc.

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Virtual Memory Management

Operating Systems. Overview Virtual memory part 2. Page replacement algorithms. Lecture 7 Memory management 3: Virtual memory

Virtual Memory. Overview: Virtual Memory. Virtual address space of a process. Virtual Memory

Summer 2003 Lecture 21 07/15/03

Interrupts Peter Rounce - room 6.18

EET2411 DIGITAL ELECTRONICS. A device or electrical circuit used to store a single bit (0 or 1) Ex. FF.

Chapter 9: Virtual Memory

Main Points of the Computer Organization and System Software Module

Introduction to Concurrency (Processes, Threads, Interrupts, etc.)

Move back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t

Memory Management Ch. 3

8254 is a programmable interval timer. Which is widely used in clock driven digital circuits. with out timer there will not be proper synchronization

Virtual Memory - Overview. Programmers View. Virtual Physical. Virtual Physical. Program has its own virtual memory space.

Chapter 9: Virtual Memory

Digital System Design Using Verilog. - Processing Unit Design

1. Define Peripherals. Explain I/O Bus and Interface Modules. Peripherals: Input-output device attached to the computer are also called peripherals.

Chapter 9: Virtual Memory. Chapter 9: Virtual Memory. Objectives. Background. Virtual-address address Space

Swapping. Operating Systems I. Swapping. Motivation. Paging Implementation. Demand Paging. Active processes use more physical memory than system has

OPERATING SYSTEM. Chapter 9: Virtual Memory

Chapter 9: Virtual Memory

Q.1 Explain Computer s Basic Elements

Unit 2 : Computer and Operating System Structure

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

PART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers.

CISC 7310X. C08: Virtual Memory. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/22/2018 CUNY Brooklyn College

Transcription:

NAME: CS 355 - Computer Organization and Architecture II Practice Questions for Final No answers will be provided (I will comment on your solution of being correct or not and how close you are, but I will not give hints - I want you to learn to think, having me telling you want the solution is will compromise my objective) These questions are focussing on the latter half of the material Question 1 In the multiprogramming operating system UNIX, programs are assigned priorities A program with higher priority value will get the CPU for a longer time when it is its turn to be executed This can be implemented by having two counters inside the PCB: PriorityCount RemainderCount The PriorityCount counter is initialized by UNIX when the program is run: every UNIX user is assigned a priority by the UNIX system and when a user runs a program, the UNIX system will create a new PCB for the program and initialize the PriorityCount with the user s priority The RemainderCount is initialzed with the value PriorityCount when the program receives a turn to run At each timer interrupt, the RemainderCount is decremented by 1 and when the RemainderCount becomes 0, the next program in the ReadyQueue is run Write the timer interrupt handler that implements the UNIX priority scheme Use Enqueue(ReadyQueue) and Dequeue(ReadyQueue) to indicate the enqueue and dequeue operation of the ReadyQueue Question 2 Many commercial CPU s have an accompanying math co-processor A math co-processor is a specialized chip that can do mathematical operations and floating point operations at a much higher speed than the general purpose CPUs (such as SPARC or M68000) 1

SIN computes sin-function SIN COS computes cos-function COS Decoder 10 11 00 01 CLK Register Select Decoder outputs all ZERO when = ZERO Tri-state-buffers enable with ONE Data The above figure shows the circuitry of a math co-processor The math co-processor has a decoder that can be in 5 states: if = ZERO, then all outputs are ZERO if = ONE, then exactly one of the outputs is ONE and all others are ZERO The output that becomes ONE depends on the Select inputs and the labeling of the outputs in the above figure shows output that turns ONE for a given set of Select inputs The co-processor has two special (combinatorial) circuits built in named SIN and COS These circuits compute the sin and cos functions of the input number, respectively The co-processor also 2

has a 32 bit working register made of D-flipflops The signal CLK is the clock signal and is tied to the clock input of all D-flipflops of the register When the math processor is enabled: What function will Select = 00 perform? What function will Select = 01 perform? What function will Select = 10 perform? What function will Select = 11 perform? In the figure above, the clock signal of the math processor is not yet connected Note that the use of the clock signal is to update the register in the math processor Using the answer to the above 4 questions as hints, complete the connection for the clock signal that will enable the math processor to update its register correctly (6 pts) The M68030 is a successor CPU of M680000 and can execute all M68000 instructions The main difference is that the M68030 is a 32 bit processes (the number of lines on databus is 32) The following figure shows the way that the math co-processor is connected on the system bus along with a M68030 CPU: 3

M68030 CPU Memory Math Co-processor Not Select MREQ Address lines A31-A4 A3 A2 A1 A0 Data lines D31-D0 The memory will only enables if its signal is equal to ONE Question: 1 Write a segment of M68000 assembler code that computes: Note: You may use binary numbers in your answer for convenience Note: You may assumed the following variables have already been defined: X: dsl 1 ; X is a 32 bit variable Y: dsl 1 ; Y is also a 32 bit variable Z: dsl 1 ; Z is also a 32 bit variable 4

Question 3 (The Belady s Anomaly) A program is placed in a vritual memory system for execution The summary of the sequence of pages used by the program is:! "!#"%$&'! "!("')! "*#"!$&!( Initially, the entire memory is empty Suppose the computer has 3 page frames and uses the FIFO replacement policy Show the sequence of pages that are in the memory each time a new page is fetched from the disk How many pages total have been yanked in? Suppose we increase the amount of memory to 4 page frames Repeat the same question (for a computer that has 4 page frames) We more memory pages available, one would expect to have less page faults Does this example conform to the expected result? Question 4 Repeat Question 3 with the LRU replacement policy Is the number of page fault with 4 memory pages less than 3 memory pages? Repeat Question 3 with the second chance replacement policy Is the number of page fault with 4 memory pages less than 3 memory pages? Question 5 Design a circuit with 3 inputs of 8 bits and one output of 8 bits The output is equal to the largest number in the input In houses that have more than one floors, there are usually pairs of switches that can be used to turn the same light on and off One switch on a floor will be able to switch the light on or off, regardless of the setting of the other switch Design a (combinatorial) circuit with 2 inputs (switches) and one output (light) so that the light can be turned on and off by any one switch, regardless of the setting of the other switch 5