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,
___________________________ , ___________________________ .
The hardware above provides the four basic functions that every computer performs.
(4) What are these functions ?
data _______________________ , data __________________________ ,
data _______________________ , and ___________________________ .
The integer word length and register size of the MIPS machines is (1)8 bits. B) 1 byte. C) 3 bytes. D) 32 bits.
How are negative integer numbers represented on the MIPS machines ?
(1)
B) 1's complement. C) 2's complement. D) negative integers are not allowed.
Today, assembly language programs are more efficient than compiled high-level language (1) programs, such as C++, for the same large accounting applications.
( True / False )
1,099,511,627,776 bytes is known as: A) Gigabyte B) Terabyte C) Petabyte
(1)
Given this hexadecimal representation of a 16-bit Two’s Complement number:
(1) 753B
Is the value A) less than zero B) equal to zero C) greater than zero D) invalid
Match these people with their noted accomplishments :
(4)
Alan Turing ____
A) - ENIAC
L0pht ____
B) - TCP / IP
J. Presper Eckert ____
C) - computing theory
Vinton G. Cerf ____
D) - Internet Security
What is the purpose of each of the following MIPS assembler directives:
(4)
.globl ____________________________________________________________
.text ____________________________________________________________
.word ____________________________________________________________
.asciiz ____________________________________________________________
Convert 435 to a binary fraction ( total of 8 bits) For example 0.75 = 0.1100 0000 (3)
The MIPS subroutines generally have PROLOG What is the purpose of this code ?
(2)
__________________________________________________________
__________________________________________________________
The MIPS multiply hardware stores the 64 bit product in two registers, HI and LO.
(1) What does it mean when the value in the HI register is minus one (-1) ?
_________________________________________________________________
Which of the following must be performed by every assembler :
(1)
Provide relocatable object code.
Process a program in two passes.
Assign machine memory addresses to symbol labels.
Floating point arithmetic has problems different from integer arithmetic.
(3) Which of these floating point arithmetic statements are True and which are False?
Addition of two positive numbers will never overflow.
Addition of a positive and a negative number will never overflow.
Multiplication of a positive and a negative number will never overflow.
What is the primary reason a two-pass assembler is necessary rather than a one-pass assembler ?
(1)
Instructions may vary in length.
Symbols need to be stored in the symbol table.
Symbols may be defined before they are used as operands.
Symbols may be used as operands before they are defined.
Computer Arithmetic has a problem called ‘Overflow’. Simply what is this problem ?
(1)
___________________________________________________________________
Generate the hexadecimal object machine code for each line in the following MIPS source (20) (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
Write the MIPS Assembler pair of hardware instructions for this pseudoinstruction:
(3)
BGT $s4, $t1, AGAIN
The MIPS hardware does not have a subtract immediate Why ?
(1)
_________________________________________________________________
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 _________________________________________________
Floating point numbers are stored in Normalized Give three reasons :
(3)
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
From the discussion readings: What was the first Internet ‘killer app’?
(1)
_________________________________________________________________
What decimal value does this bit pattern :
(1)
0000 0000 0000 0000 0000 0000 0000 0000
represent (exactly) in the IEEE 754 format ? ______________________
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
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
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.
Does the MIPS assemble language allow for arithmetic with 1-byte and 2-byte operands?
(2) Yes / No ? Why ?
_______________________________________________________________________
_______________________________________________________________________ 28) Natural languages are clear and concise, and therefore suitable for use as programming languages.
(1) (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.
(1) ( 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 : ________________________________________________________________
_____________________________________________________________________
What is RAID 1 ? ________________________________________________
(2)
________________________________________________________________________
Which of the following is a primary characteristic of System Software ?
(1)
It is totally machine independent.
Will run on any PC or Unix machine.
Supports the operation of a specific computer.
Calculates employee paychecks.
What is the primary purpose of Pass One of the Two-pass Linker/Loader ? ___________
(2)
________________________________________________________________________
A process that is BLOCKED must wait for an event to occur before it can resume processing.
(1) ( True / False )
35) Given two programs that are multiprogrammed in a single processor computer:
(2) 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?
________________________________________________________________________
________________________________________________________________________
The purpose of the Main Frame Operating System Job Scheduler is to assign resourses (2) to waiting program processes. The Scheduler has a priority scheme. List the names of two of these schemes.
____________________________________________________________________
____________________________________________________________________
The Grammar describes the (A) SEMANTICS or (B) SYNTAX of the (1) programming language.
The I / O Channel causes an I / O Interrupt when the I / O process completes.
(1) ( True / False )
The purpose of Interrupts and the Interrupt Processing is to (1)Stop the computer when a fault occurs.
Slow down the processing of programs.
Enable the operating system to efficiently process several concurrent programs.
Given this binary bit pattern, what is the MIPS instruction as Assembly Language:
(3)
1000 1101 0010 1000 0000 0100 1011 0000
One of the two basic functions of any Operating System is to provide the programming (1) run-time environment. What is the other basic function ?
_______________________________________________________________________
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.
In a few phrases, describe these components of a compiler.
(3)
SCANNER -
_________________________________________________________
PARSER -
_________________________________________________________
CODE GENERATOR -
_________________________________________________________
From the discussion readings: What is Ubuntu?
(1)
_________________________________________________________________
Machine independent code optimization uses many techniques. List two of the methods (2) discussed in the presentation that you did not use in problem #42 (on previous page).
__________________________________
__________________________________
Match the following terms with the most correct
(8)
_____ 1) CHANNEL PROGRAM A) Set of programs in a Circular Wait.
_____ 2) CONTEXT SWITCHING B) Set mask to prevent Interrupt Processing
_____ 3) DEAD - LOCK C) Register containing interrupt mask
_____ 4) DISPATCHING D) Set of instructions for special i/o
_____ 5) STORAGE PROTECTION KEY E) Select next program to process by CPU
_____ 6) INHIBIT INTERRUPT F) Data area used by the Memory Manager _____ 7) PAGE TABLE MAP G) Saving / restoring registers by Interrupt Processor.
_____ 8) PROGRAM STATUS WORD H) Half byte used for memory access control.
Is memory-protection hardware necessary on a machine that uses a Virtual (demand-paged) (2) Memory Management system ? Yes / No ? Why ?
____________________________________________________________
____________________________________________________________
In many operating systems, the Timer Interrupt (the assigned time interval is used up) is assigned (2) a lower priority than the Operating System Service Request Why is this done?
____________________________________________________________
____________________________________________________________
Once the operating system detects that a Deadlock has occured,
(2) how does it resolve the conflict between the processes ? List two methods.
__________________________________________________________
__________________________________________________________
What actions must the Operating System perform when an interrupt is recognized ?
(2)
A)___________________________________________________________
B)___________________________________________________________
Is it ever safe (you do not lose data values ) for a MIPS user program to use registers $k0 or $k1 ?
(2) Yes / No ? Why ?
_____________________________________________________________________
_____________________________________________________________________
The Textbook, page 36, discusses the Classic CPU Performance Equation. Fill in the blanks:
(2)
Given the following Simplified Pascal grammar :
(3)
< 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.
(1) (True / False)
Data Security consists of a number of methods and techniques. Name two.
(2)
( Extra credit for more than two. Max : 4 extra points.)
____________________________ ______________________________
____________________________ ______________________________
____________________________ ______________________________
Don’t forget to complete the online Course Evaluation Survey.
It is the only method to provide the feedback for improving the course.