CMPUT 101 with Solutions Quiz 2 (50 minutes) November 16, 2000

Similar documents
CMPUT 101 with Solutions Quiz 2 (50 minutes) August 7, 2002

CMPUT 101 with Solutions Quiz 2 (50 minutes) November 7, 2003

The Von Neumann Architecture Odds and Ends. Designing Computers. The Von Neumann Architecture. CMPUT101 Introduction to Computing - Spring 2001

CMPUT101 Introduction to Computing - Summer 2002

The Von Neumann Architecture. Designing Computers. The Von Neumann Architecture. CMPUT101 Introduction to Computing - Spring 2001

Designing Computers. The Von Neumann Architecture. The Von Neumann Architecture. The Von Neumann Architecture

CMPUT101 Introduction to Computing - Summer 2002

Computer Architecture (part 2)

CS1004: Intro to CS in Java, Spring 2005

Chapter 5 12/2/2013. Objectives. Computer Systems Organization. Objectives. Objectives (continued) Introduction. INVITATION TO Computer Science 1

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Chapter 5: Computer Systems Organization

Chapter 5: Computer Systems Organization. Invitation to Computer Science, C++ Version, Third Edition

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

A Review of Chapter 5 and. CSc 2010 Spring 2012 Instructor: Qian Hu

A B C ((NOT A) AND B) OR C

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

Introduction to Computer Science. Homework 1

An Introduction to System Software and Virtual Machines

Von Neumann Architecture

Computer Organization

Level 2: The Hardware World Chapters 4 and 5 (topics of other cs courses)

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

Year 10 OCR GCSE Computer Science (9-1)

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

4. Write a sum-of-products representation of the following circuit. Y = (A + B + C) (A + B + C)

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

AS/A Level Computing Syllabus 2011

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Computer Architecture

Computer Organization and Levels of Abstraction

1. Boolean algebra. [6] 2. Constructing a circuit. [4] 3. Number representation [4] 4. Adders [4] 5. ALU [2] 6. Software [4]

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Show how to connect three Full Adders to implement a 3-bit ripple-carry adder

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Invitation to Computer Science, C++ Version, Third Edition

Concept of Memory. The memory of computer is broadly categories into two categories:

N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

Midterm Exam 2B Answer key

COSC 122 Computer Fluency. Computer Organization. Dr. Ramon Lawrence University of British Columbia Okanagan

SECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017

Computer Organization and Levels of Abstraction

IB Computer Science Topic.2-

Information Science 1

5 Computer Organization

Midterm Examination - Answers October 25, 2012 In Class Instructor: Joseph Vybihal

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

2. (a) Compare the characteristics of a floppy disk and a hard disk. (b) Discuss in detail memory interleaving. [8+7]

Machine Architecture. or what s in the box? Lectures 2 & 3. Prof Leslie Smith. ITNP23 - Autumn 2014 Lectures 2&3, Slide 1

1. Draw general diagram of computer showing different logical components (3)

Electricity: Voltage. Gate: A signal enters the gate at a certain voltage. The gate performs operations on it, and sends it out was a new signal.

11/22/1999 7pm - 9pm. Name: Login Name: Preceptor Name: Precept Number:

GCSE Computer Science for OCR Overview Scheme of Work

Digital Systems. John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC. December 6, 2012

Topic #6. Processor Design

Solve only 2 out of 3 questions

UNIT 1 USING LOGIC. UPGRADE 8 Write a detailed report on how logic gates would be used to add up two nibbles using examples and explanations

Fundamentals of Programming Session 1

Department of Electrical and Computer Engineering The University of Texas at Austin

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

CS 151 Quiz 4. Instructions: Student ID. (Last Name) (First Name) Signature

CS 140 Introduction to Computing & Computer Technology. Computing Components

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON. Instructor: Rahul Nayar TAs: Annie Lin, Mohit Verma

2c. Content of Computer systems (Component 01)

University of Toronto Mississauga. Flip to the back cover and write down your name and student number.

Chapter 2 Data Manipulation

Basic Von Neumann Designs

Reference Sheet for C112 Hardware

Digital Logic Design: a rigorous approach c

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

User. Application program. Interfaces. Operating system. Hardware

Computer Architecture 2/26/01 Lecture #

Little Man Computer (LMC)

Sample Exam I PAC II ANSWERS

Chapter 6 (Lect 3) Counters Continued. Unused States Ring counter. Implementing with Registers Implementing with Counter and Decoder

The Stored Program Computer

ECE 30, Lab #8 Spring 2014

Chapter 13. The ISA of a simplified DLX Why use abstractions?

2.2 THE MARIE Instruction Set Architecture

1. Fundamental Concepts

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

Register Transfer and Micro-operations

Teaching London Computing

William Stallings Computer Organization and Architecture

BASIC COMPUTER ORGANIZATION. Operating System Concepts 8 th Edition

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

Basic Computer Architecture

MARIE: An Introduction to a Simple Computer

EE 3170 Microcontroller Applications

GIRLS SECONDARY, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2015/2016

CS6303 Computer Architecture Regulation 2013 BE-Computer Science and Engineering III semester 2 MARKS

Learning objectives. Computer principles The characteristics of contemporary processors, input, output and storage devices

Computer System. Hiroaki Kobayashi 7/25/2011. Agenda. Von Neumann Model Stored-program instructions and data are stored on memory

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

CS 105 Review Questions #3

11. A Computing Machine

What Are The Main Differences Between Program Counter Pc And Instruction Register Ir

MRIEHEL SECONDARY SCHOOL HALF-YEARLY EXAMINATIONS 2016~17. Year 9 Computing Time: 1hr 30mins

Transcription:

CMPUT 101 with Solutions Quiz 2 (50 minutes) November 16, 2000 Last Name: First Name: Section: Instructor: A6 Yngvi Bjornsson Instructions: Read carefully before proceeding. No calculators, books or other aids are permitted for this test. 1. Print your name in the space provided above. 2. Flip to the next page. A

Instructions (continued): Read carefully before proceeding. 3. Print your name and student ID in the space provided below (yes, your name again!). 4. Read the instructions below, and then wait until you are told to start working on the test (don t flip the pages yet). 5. Once you are told to start, write your ID number on top of all remaining pages in the test, only then start answering the questions. Put all your answers on the test paper, no additional sheets of papers can be handed it. You can use the back of the pages for your scratch notes and calculations. 6. When you are told that the time is up, stop working on the test. Good luck! Last Name: First Name: Student ID: Marks: (don t write anything below) 1 2 3 4 Total 10 15 10 15 50

CMPUT101 Section A6 Quiz 2 Page 3 of 7 ID#: Part I (Multiple choice) There can be more than one correct choice for each question, circle ALL that apply. 1. (2 marks) Which of the following are considered main subsystems in the Von Neumann architecture? (a) memory (b) system software (c) cache (d) control unit (e) ALU (f) Windows 2000 2. (2 marks) In most modern computers the main processor (CPU) contains a (a) I/O Controller (b) control unit (c) ALU (d) magnetic surface (e) read/write head (f) cache 3. (2 marks) The following properties are true for random access memory (RAM): (a) each memory cell has a unique address (b) the time it takes to fetch or store a memory cell is the same for all cells (c) the first bit always represents the sign of the number stored (d) a complete cell (all bits) must always be fetched or stored (e) information can only be fetched, not stored 4. (2 marks) An unspecified machine language instruction set uses 16 bits to represent memory addresses. Each instruction can have maximum of two address fields. What is the maximum memory size a computer using this instruction set can use? (a) 16 (b) 2 16 1 (c) 2 16 (d) 2 x 2 16 (e) 2 x (2 16 1) (f) 16 megabytes 5. (2 marks) Which of the following are considered to be system software: (a) compilers (b) web browsers (c) file systems (d) assemblers (e) computer games (f) hard-drives

CMPUT101 Section A6 Quiz 2 Page 4 of 7 ID#: Part II: Circuits 1. (4 Marks) The following circuit is given: a b + x = ( a b) + ( b c) c y = bc (a) The Boolean expression that describes the output value of y is shown above. Similarly, write above the expression that describes the output value of x. (b) For the two rows shown in the truth-table below, fill in the correct output values for x and y: Input Output a b c x y 0 0 0 1 0 1 0 1 0 1 2. (7 Marks) Use the sum-of-products circuit construction algorithm to design a circuit using AND, OR, and NOT gates that implements the following truth table. Input Output a b x y 0 0 1 0 0 1 0 0 1 0 0 1 1 1 1 0 (a) Write the expressions that describe the outputs: x = ( a b ) + ( a b) y = ( a b ) (b) Draw the circuit diagram. a b + x y

CMPUT101 Section A6 Quiz 2 Page 5 of 7 ID#: 3. (4 marks) Design a circuit that has 3 inputs and 2 outputs. The circuit should output the number of inputs set to 1. You only need to fill in the truth table for the circuit, there is no need to show the Boolean expressions or draw the circuit diagram. Hint: Think of the outputs x 1 x 0 as a two bit binary number, e.g. when a b c = 1 0 1 the number of 1 s is 2 and, thus, x 1 x 0 = 1 0. Input Output a b c x 1 x 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 Part III: Von Neumann Architecture 1. (2 marks) The following actions show what happens when a particular machine instruction is being executed: IR addr MAR FETCH MDR R Which machine instruction is being executed: LOAD 2. (4 marks) Assume a disk with the following characteristics: Number of sectors per track 10 Number of tracks per surface 20 Number of surfaces 2 Number of bytes per sector 100 Arm movement time 1 msec to move 1 track Number of tracks read/write head moves of average 10 Rotation speed 60 rev/min (a) How many bytes can be stored on this disk (show your work)? 100 x 10 x 20 x 2 = 40,000 bytes (b) What are the worst- and average-case latency for this disk (show your work)? 60 rev/min => 1 sec each rev. worst case (wait one rev.) = 1 sec. average case(wait half rev.) = 0.5 sec. 3. (2 marks) Fill the blanks below with the appropriate register names. The PC holds the address of the next instruction to be fetched. Prior to being decoded an instruction must be stored in the IR.

CMPUT101 Section A6 Quiz 2 Page 6 of 7 ID#: 4. (2 marks) The following figure shows one possible implementation of the ALU circuit. All the arithmetic/logic operations are done in parallel but then the result of only one of the operations is selected to be the output. a b a = b a + b a - b 0 1 2 3 Output a b Selector lines (a) What kind of a control circuit is used to select the output? Multiplexor (b) In the blanks below the selector lines, write down the signals (0 or 1) that make the result of the subtraction circuit become the output. 1 1 Part IV: Assembly language Note: A table describing the syntax and semantics of the assembly language instructions is provided in the appendix (at the bottom of the last page). 1. (3 marks) Assuming that memory locations X and Y store the values 2 and 3 respectively, what values will they and the register R store after the following assembly program fragment is executed? DECREMENT LOAD ADD STORE X Y X Y Answer: X = _1_ Y = _4_ R = _4_ 2. (4 marks) What does the following assembly program output when executed?.begin LOAD N ADD M STORE N LOAD Three COMPARE N JUMPLT Output INCREMENT M Output: OUT N OUT M HALT N:.DATA 2 M:.DATA 3 Three:.DATA 3.END Answer: 5 4

CMPUT101 Section A6 Quiz 2 Page 7 of 7 ID#: 3. (8 marks) Write an assembly program that implements the following algorithm. Get value for N While N 1 do Print the value of N Decrease N by 10 End loop Stop.BEGIN IN N Startloop: LOAD One COMPARE N JUMPLT Endloop OUT N LOAD N SUBTRACT Ten STORE N JUMP Startloop Endloop: HALT N.DATA 0 One:.DATA 1 Ten:.DATA 10.END Appendix: Assembly Language Instructions INSTRUCTION MEANING LOAD X CON(X) R STORE X R CON(X) CLEAR X 0 CON(X) ADD X R + CON(X) R INCREMENT X CON(X) + 1 CON(X) SUBTRACT X R CON(X) R DECREMENT X CON(X) 1 CON(X) COMPARE X If CON(X) > R then GT = 1 (EQ=0, LT=0) If CON(X) = R then EQ = 1 (GT=0, LT=0) If CON(X) < R then LT = 1 (GT=0, EQ=0) JUMP X Transfer to memory location X JUMPGT X Transfer to location X if GT = 1 JUMPEQ X Transfer to location X if EQ = 1 JUMPLT X Transfer to location X if LT = 1 JUMPNEQ X Transfer to location X if EQ = 0 IN X Input an integer value from the standard input device and store it in memory cell X. OUT X Output, in decimal notation, the value stored in memory cell X. HALT Stop program execution.