Introduction to Computer Organization. Final Exam Summer 2017

Similar documents
CS61c MIDTERM EXAM: 3/17/99

CS341l Fall 2009 Test #1

Floating Point. The World is Not Just Integers. Programming languages support numbers with fraction

Run time environment of a MIPS program

231 Spring Final Exam Name:

ECE331: Hardware Organization and Design

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

Introduction to C. Why C? Difference between Python and C C compiler stages Basic syntax in C

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

MIPS Instruction Set

Shift and Rotate Instructions

COMPUTER ORGANIZATION AND DESIGN

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture

Name: Problem 1: (25 points) Short Answers. a) (5 points) Executing a program

Lecture 7: Examples, MARS, Arithmetic

Computer Architecture I Midterm I

CS2214 COMPUTER ARCHITECTURE & ORGANIZATION SPRING 2014

ECE 30 Introduction to Computer Engineering

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes

ICS DEPARTMENT ICS 233 COMPUTER ARCHITECTURE & ASSEMBLY LANGUAGE. Midterm Exam. First Semester (141) Time: 1:00-3:30 PM. Student Name : _KEY

Assembly Programming

Computer Architecture Chapter 3. Fall 2005 Department of Computer Science Kent State University

Chapter Two MIPS Arithmetic

Main Points of the Computer Organization and System Software Module

Machine Language Instructions Introduction. Instructions Words of a language understood by machine. Instruction set Vocabulary of the machine

Assembly Language Programming. CPSC 252 Computer Organization Ellen Walker, Hiram College

A simple syntax-directed

3.5 Floating Point: Overview

Lecture 5: Procedure Calls

Number Systems and Their Representations

Unsigned Binary Integers

Unsigned Binary Integers

The type of all data used in a C++ program must be specified

ECE260: Fundamentals of Computer Engineering

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

COMP2611: Computer Organization. Data Representation

I-Format Instructions (3/4) Define fields of the following number of bits each: = 32 bits

ECE331: Hardware Organization and Design

Divide: Paper & Pencil

3. (5 points) Name the 5 components of a computer

MIPS ISA and MIPS Assembly. CS301 Prof. Szajda

CSE 2021: Computer Organization

The type of all data used in a C (or C++) program must be specified

MIPS R-format Instructions. Representing Instructions. Hexadecimal. R-format Example. MIPS I-format Example. MIPS I-format Instructions

Lecture 6: Assembly Programs

Computer Science and Engineering 331. Midterm Examination #1. Fall Name: Solutions S.S.#:

Floating Point Numbers

Lab8: SAM Assembler and Simulator

Problem maximum score 1 35pts 2 22pts 3 23pts 4 15pts Total 95pts

SIGNED AND UNSIGNED SYSTEMS

Lecture 10: Floating Point, Digital Design

Architecture II. Computer Systems Laboratory Sungkyunkwan University

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2)

MIPS Instruction Set Architecture (2)

CS 354 Midterm 1a, 33.33% Monday, October 9th, 2000 Solution

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Assembler. Lecture 8 CS301

Instructions: Language of the Computer

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

COMP MIPS instructions 2 Feb. 8, f = g + h i;

CDA3100 Midterm Exam, Summer 2013

Foundations of Computer Systems

COMP Overview of Tutorial #2

LAB B Translating Code to Assembly

CS311 Lecture: The Architecture of a Simple Computer

ECE 2035 Programming HW/SW Systems Fall problems, 7 pages Exam Two 23 October 2013

Lecture 2. Instructions: Language of the Computer (Chapter 2 of the textbook)

CO Computer Architecture and Programming Languages CAPL. Lecture 15

Review: MIPS Organization

Number Representations

CS 61C: Great Ideas in Computer Architecture. (Brief) Review Lecture

Signed Multiplication Multiply the positives Negate result if signs of operand are different

1 5. Addressing Modes COMP2611 Fall 2015 Instruction: Language of the Computer

CSE P 501 Exam 8/5/04

Computer Organization MIPS ISA

2. Define Instruction Set Architecture. What are its two main characteristics? Be precise!

EN164: Design of Computing Systems Lecture 09: Processor / ISA 2

COS 140: Foundations of Computer Science

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754

MIPS (SPIM) Assembler Syntax

Chapter 3. Arithmetic Text: P&H rev

Problem 3: Theoretical Questions: Complete the midterm exam taken from a previous year attached at the end of the assignment.

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other

ECE260: Fundamentals of Computer Engineering

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

Format. 10 multiple choice 8 points each. 1 short answer 20 points. Same basic principals as the midterm

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Review. Lecture #9 MIPS Logical & Shift Ops, and Instruction Representation I Logical Operators (1/3) Bitwise Operations

NAME: 1. (2) What is a transistor?

MACHINE LEVEL REPRESENTATION OF DATA

CSCI 402: Computer Architectures. Arithmetic for Computers (4) Fengguang Song Department of Computer & Information Science IUPUI.

EDIABAS BEST/2 LANGUAGE DESCRIPTION. VERSION 6b. Electronic Diagnostic Basic System EDIABAS - BEST/2 LANGUAGE DESCRIPTION

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam Two 23 October Your Name (please print clearly) Signed.

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring Topic Notes: MIPS Programming

ECE260: Fundamentals of Computer Engineering

Chapter 2A Instructions: Language of the Computer

Transcription:

Introduction to Computer Organization Final Exam 605.204 Summer 2017 Name : 1) As described by Hennessy and Patterson,the modern computer is composed of five (4) classic hardware components. Given one, list the other four:,, and OUTPUT,,. 2) The hardware above provides the four basic functions that every computer performs. (4) What are these functions? data, data, data, and. 3) The integer word length and register size of the MIPS machines is A) 8 bits. B) 1 byte. C) 3 bytes. D) 32 bits. 4) How are negative integer numbers represented on the MIPS machines? A) ASCII. B) 1's complement. C) 2's complement. D) negative integers are not allowed. 5) Today, assembly language programs are more efficient than compiled high-level language programs, such as C++, for the same large accounting applications. ( True / False ) 6) 1,099,511,627,776 bytes is known as: A) Gigabyte B) Terabyte C) Petabyte 7) Given this hexadecimal representation of a 16-bit Two s Complement number: 753B Is the value A) less than zero B) equal to zero C) greater than zero D) invalid

8) Match these people with their noted accomplishments : (4) Alan Turing L0pht A) - ENIAC B) - TCP / IP J. Presper Eckert C) - computing theory Vinton G. Cerf D) - Internet Security 9) What is the purpose of each of the following MIPS assembler directives: (4).globl.text.word.asciiz 10) Convert 0.435 to a binary fraction ( total of 8 bits) For example 0.75 = 0.1100 0000 11) The MIPS subroutines generally have PROLOG code. What is the purpose of this code? 12) The MIPS multiply hardware stores the 64 bit product in two registers, HI and LO. What does it mean when the value in the HI register is minus one (-1)? 13) Which of the following must be performed by every assembler : A) Provide relocatable object code. B) Process a program in two passes. C) Assign machine memory addresses to symbol labels.

14) Floating point arithmetic has problems different from integer arithmetic. Which of these floating point arithmetic statements are True and which are False? A) Addition of two positive numbers will never overflow. B) Addition of a positive and a negative number will never overflow. C) Multiplication of a positive and a negative number will never overflow. 15) What is the primary reason a two-pass assembler is necessary rather than a one-pass assembler? A) Instructions may vary in length. B) Symbols need to be stored in the symbol table. C) Symbols may be defined before they are used as operands. D) Symbols may be used as operands before they are defined. 16) Computer Arithmetic has a problem called Overflow. Simply what is this problem? 17) Generate the hexadecimal object machine code for each line in the following MIPS source (20) program. (Use the Green reference card) Values are decimal numbers. ( For example: sub $s4, $s2, $s1 = 0251 A022 ).text 2044.globl strcpy # subroutine for memory copy of a string from A to B strcpy: add $t0, $zero, $zero # index to the next character to copy loop: add $t1, $t0, $a0 # t1 has address of A lb $t2, 0($t1) # get the next character add $t3, $t0, $a1 # t3 has the address of B sb $t2, 0($t3) # copy it beq $t2, $zero, finish # if it is null character, then finished addi $t0, $t0,1 # increment the index j loop # continue the copy finish: jr $ra # return from the subroutine

18) Write the MIPS Assembler pair of hardware instructions for this pseudoinstruction: BGT $s4, $t1, AGAIN 19) The MIPS hardware does not have a subtract immediate instruction. Why? 20) The MIPS architecture has five Addressing Modes. (5) For each of the modes, give an example of an instruction that uses each. Base Register Immediate Pseudo Direct Program Counter 21) Floating point numbers are stored in Normalized format. Give three reasons : A) B) C) 22) From the discussion readings: What was the first Internet killer app? 23) What decimal value does this bit pattern : 0000 0000 0000 0000 0000 0000 0000 0000 represent (exactly) in the IEEE 754 format?

24) Convert the following decimal value to its MIPS floating point binary value: (4) (IEEE 754 32-bit format) Show result as hex digits. 8765.75 25) Identify which of these Assembly process functions would most likely occur in (4) 1) Pass one or 2) Pass two of a two-pass assembler a) Translate mnemonic operation codes to machine codes b) Save addresses assigned to labels c) Scan for label definitions d) Write object code 26) Match the statements ( a - e ) with the most appropriate Object Program record type : (5) D) Data Segment S) Symbol H) Header T) Text Segment R) Relocation a) Object instruction code. b) Relative address of global symbol. c) Modification information. d) Program name. e) Data values. 27) Does the MIPS assemble language allow for arithmetic with 1-byte and 2-byte operands? Yes / No? Why?

28) Natural languages are clear and concise, and therefore suitable for use as programming languages. (True / False) 29) Register $t5 contains a negative 32-bit value in two s complement form. After performing a 1-bit sll instruction, followed by a 1-bit srl instruction. Register $t5 would contain the absolute value of the original value. ( True / False ) 30) The IEEE 754 floating point standard includes these objects. (4) What they are, and how they are used?? Guard Bit : Round Bit : Sticky Bit : NaN : 31) What is RAID 1? 32) Which of the following is a primary characteristic of System Software? A) It is totally machine independent. B) Will run on any PC or Unix machine. C) Supports the operation of a specific computer. D) Calculates employee paychecks. 33) What is the primary purpose of Pass One of the Two-pass Linker/Loader? 34) A process that is BLOCKED must wait for an event to occur before it can resume processing. ( True / False )

35) Given two programs that are multiprogrammed in a single processor computer: Program ONE uses a large amount of CPU time and little I/O. Program TWO uses a small amount of CPU time but performs a large number of I/O operations. Which program should get the higher priority for dispatching the single CPU? Why? 36) The purpose of the Main Frame Operating System Job Scheduler is to assign resourses to waiting program processes. The Scheduler has a priority scheme. List the names of two of these schemes. A) B) 37) The Grammar describes the (A) SEMANTICS or (B) SYNTAX of the programming language. 38) The I / O Channel causes an I / O Interrupt when the I / O process completes. ( True / False ) 39) The purpose of Interrupts and the Interrupt Processing is to A) Stop the computer when a fault occurs. B) Slow down the processing of programs. C) Enable the operating system to efficiently process several concurrent programs. 40) Given this binary bit pattern, what is the MIPS instruction as Assembly Language: 1000 1101 0010 1000 0000 0100 1011 0000 41) One of the two basic functions of any Operating System is to provide the programming run-time environment. What is the other basic function?

42) Given this Intermediate File of a Compiler : (8) ( 1 ) : = #1 Indx ( 2 ) JGT Indx #25 (20) ( 3 ) - Indx #1 t1 ( 4 ) * t1 #10 t2 ( 5 ) * #2 MLK t3 ( 6 ) - t3 #1 t4 ( 7 ) - t4 #1 t5 ( 8 ) + t2 t5 t6 ( 9 ) * t6 #4 t7 ( 10 ) - Indx #1 t8 ( 11 ) * t8 #10 t9 ( 12 ) * #2 MLK t10 ( 13 ) - t10 #1 t11 ( 14 ) + t9 t11 t12 ( 15 ) * t12 #4 t13 ( 16 ) : = ZYX[t13] CBA[t7] ( 17 ) + #1 Indx t14 ( 18 ) : = t14 Indx ( 19 ) JMP ( 2 ) ( 20 ) Optimize the code. Mark which statements would be moved, modified, or removed. Machine independent code optimization uses many techniques. List the optimization methods you used.

43) In a few phrases, describe these components of a compiler. SCANNER - PARSER - CODE GENERATOR - 44) From the discussion readings: What is Ubuntu? 45) Machine independent code optimization uses many techniques. List two of the methods discussed in the presentation that you did not use in problem #42 (on previous page). 46) Match the following terms with the most correct definition. (8) 1) CHANNEL PROGRAM 2) CONTEXT SWITCHING 3) DEAD - LOCK 4) DISPATCHING A) Set of programs in a Circular Wait. B) Set mask to prevent Interrupt Processing C) Register containing interrupt mask D) Set of instructions for special i/o 5) STORAGE PROTECTION KEY E) Select next program to process by CPU 6) INHIBIT INTERRUPT 7) PAGE TABLE MAP 8) PROGRAM STATUS WORD F) Data area used by the Memory Manager G) Saving / restoring registers by Interrupt Processor. H) Half byte used for memory access control.

47) Is memory-protection hardware necessary on a machine that uses a Virtual (demand-paged) Memory Management system? Yes / No? Why? 48) In many operating systems, the Timer Interrupt (the assigned time interval is used up) is assigned a lower priority than the Operating System Service Request Interrupt. Why is this done? 49) Once the operating system detects that a Deadlock has occured, how does it resolve the conflict between the processes? List two methods. A) B) 50) What actions must the Operating System perform when an interrupt is recognized? A) B) 51) Is it ever safe (you do not lose data values ) for a MIPS user program to use registers $k0 or $k1? Yes / No? Why? 52) The Textbook, page 36, discusses the Classic CPU Performance Equation. Fill in the blanks: CPU Time Seconds = = Program Program X X Seconds

53) Given the following Simplified Pascal grammar : < stmt-list > : : = < stmt > { ; < stmt > } < stmt > : : = < assign > < read > < write > < for > < assign > : : = id : = < exp > < exp > : : = < term > { + < term > - < term > } < term > : : = < factor > { * < factor > DIV < factor > } < factor > : : = id int ( < exp > ) Modify the above Grammar to include the exponentiation operation. Make exponentiation the highest priority arithmetic operation. 54) Create quadruples of the form we have used in class for the following <assign> statement: (6) ZEE := 3 * EX 5 * WHY + EX / WHY; 55) The Optical Mouse includes an embedded processor. (True / False) 56) Data Security consists of a number of methods and techniques. Name two. ( Extra credit for more than two. Max : 4 extra points.) 57) Don t forget to complete the online Course Evaluation Survey. It is the only method to provide the feedback for improving the course.