ECS 50: Computer Organization and Machine-Dependent Programming - Exam 1, Spring 2008, Exams of Architecture

The instructions and problems for exam 1 of the ecs 50: computer organization and machine-dependent programming course offered in spring 2008. The exam covers various topics related to computer organization, instruction sets, and memory management. Students are required to read each problem carefully and follow the instructions provided.

Typology: Exams

Pre 2010

Uploaded on 09/17/2009

koofers-user-pxg
koofers-user-pxg 🇺🇸

9 documents

1 / 19

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECS 50: Computer Organization and Machine-Dependent
Programming
Spring 2008
Exam 1
May 8, 2008
Instructions
Read each individual problem appearing on this exam carefully and do only
what is specifically stated.
You have 80 minutes to finish this exam. On your initial pass through
this exam, skip any problems that appear to be overly difficult. Show your
work if you desire partial credit for the short answer questions. No partial
credit will be given for multiple choice questions.
IMPORTANT: Be sure to read and sign the Academic Honesty Statement
that follows:
“In signing this statement, I hereby certify that the work on this exam is my
own and that I have not copied the work of any other student while completing
this exam. I understand that, if I fail to honor this agreement, I will receive
a score of ZERO for this exam and will be subject to possible disciplinary
action.”
Printed Name: .................. Signature: ..................
Date: ...................
Please record the time when you finish the paper here: . . . . . . . . . .
DO NOT BEGIN UNTIL INSTRUCTED TO DO SO.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download ECS 50: Computer Organization and Machine-Dependent Programming - Exam 1, Spring 2008 and more Exams Architecture in PDF only on Docsity!

ECS 50: Computer Organization and Machine-Dependent

Programming

Spring 2008

Exam 1

May 8, 2008

Instructions

Read each individual problem appearing on this exam carefully and do only what is specifically stated.

You have 80 minutes to finish this exam. On your initial pass through this exam, skip any problems that appear to be overly difficult. Show your work if you desire partial credit for the short answer questions. No partial credit will be given for multiple choice questions.

IMPORTANT: Be sure to read and sign the Academic Honesty Statement that follows: “In signing this statement, I hereby certify that the work on this exam is my own and that I have not copied the work of any other student while completing this exam. I understand that, if I fail to honor this agreement, I will receive a score of ZERO for this exam and will be subject to possible disciplinary action.”

Printed Name:.................. Signature:..................

Date:...................

Please record the time when you finish the paper here:..........

DO NOT BEGIN UNTIL INSTRUCTED TO DO SO.

Problem 1.................... MCQ.................... 4 Points

The architecture of a computers refers to which ones of the following?

I. The memory and cache layout. II. The instructions that the processor understands. III. The number and types of functional units. IV. The operating system used for the computer. (a) I only.

(b) I and II only.

(c) I, II and III only.

(d) I, II, III and IV.

Problem 2.................... MCQ.................... 4 Points

Which one of the below is NOT a difference between RISC and CISC com- puters? (a) Instruction size.

(b) The presence of an ALU.

(c) An instruction’s ability to access memory.

(d) The number of registers.

Problem 5.................... MCQ.................... 4 Points

Which one of the following is an invalid instruction? (a) $FFFFFF, because the opcode cannot begin with $FF for operand type instructions.

(b) LDA# 234, because the address 234 has not been specified in hexadeci- mal notation.

(c) STA# 234, because the immediate addressing mode does not make sense for a STA instruction.

(d) JMP $234, because JMP instructions always need an offset and that has to be specified in immediate mode.

Problem 6.................... MCQ.................... 4 Points

What are the four address registers used to store CUSP memory addresses? (a) Program counter, accumulator, index register, control unit.

(b) Program counter, index register, arithmetic logic unit, frame pointer.

(c) Program counter, stack pointer, instruction register, accumulator.

(d) Program counter, index register, stack pointer, frame pointer.

Problem 7.................... MCQ.................... 4 Points

When storing a multibyte object in memory, one should ensure that the first byte of the object is placed at an address (a) where there is enough free memory space to hold the word.

(b) that comes right after the filled up memory locations.

(c) that is a multiple of the machine word size and where there is enough free memory space to hold the word.

(d) that is anywhere in the memory.

Problem 8.................... MCQ.................... 4 Points

What does the instruction JEQ AAA accomplish? (a) It loads ACC with PC if PC = 1.

(b) It loads PC with AAA if EQ = 1.

(c) It loads PC with AAA if EQ = 0.

(d) It loads ACC with PC if EQ = 1.

Problem 11................... MCQ................... 4 Points

Which ones of the following are true about what labels allow assembly pro- grammers to do?

I. Create dynamically addressed jump targets. II. Create dynamically addressed data. III. Perform math operations without the accumulator. IV. Perform complex loop operations with significantly fewer instructions (an average reduction in code size of 10% if floating point math is ignored). (a) I only.

(b) I and II only.

(c) I, II and III only.

(d) I, II and IV only.

Problem 12................... MCQ................... 4 Points

What is the purpose of the symbol table? (a) It contains all of the symbols that the processor uses to communicate.

(b) It shows how the program is organized in memory, and whether the mem- ory organization is little-endian or big-endian.

(c) It links memory addresses to the labels used in the program.

(d) It ensures that all symbols used in the code are properly aligned in the memory because accessing memory more than the minimum required number of times is a much worse problem than wasteful usage of memory.

Problem 13................... MCQ................... 4 Points

What is the purpose of object alignment? (a) It is used to allow the processor to communicate with memory.

(b) It is used to make the memory organization either little-endian or big- endian.

(c) It is used to link memory addresses to the labels used in the program.

(d) It ensures that all objects used in the code are properly aligned in the memory because accessing memory more than the minimum required number of times is a much worse problem than wasteful usage of memory.

Problem 14................... MCQ................... 4 Points

What is in the accumulator right after the execution of the program “LDA $000”? Assume that the program starts at address $000. (a) $000001.

(b) $002000.

(c) $042000.

(d) $FFFFFF.

Problem 16................... MCQ................... 4 Points

After the execution of the simple program below, what is the value of Mem[$005]? Assume that the program starts at address $000.

LDA# $ ADA $ STA $ ADA# 100 HLT $ (a) $00005B.

(b) $00003D.

(c) $00805D.

(d) $00803F.

Problem 17................... MCQ................... 4 Points

After the execution of the simple program below, what is the value of Mem[$005]? Assume that the program starts at address $000.

LDA# $ ADA# $ STA $ ADA# 100 HLT $ (a) $00005B.

(b) $00003D.

(c) $00805D.

(d) $00803F.

Problem 19................... MCQ................... 4 Points

Which one of the below is NOT a part of the “short-cut” procedure for finding the 2’s complement of a decimal number? (a) Write the number in the binary form.

(b) Add one.

(c) Invert all bits.

(d) Drop any carry out of LSB.

Problem 20................... MCQ................... 4 Points

Which one of the following is NOT an operate instruction? (a) HLT.

(b) NEGA.

(c) NOP.

(d) LDA.

Problem 21................... MCQ................... 4 Points

Why is it a good idea to use placeholders as jump targets when writing an assembly language program? (a) It gives the next guy more work to do.

(b) The ALU can execute faster with placeholders.

(c) At the time of writing the program, the programmer does not know at what memory address the program will begin.

(d) The address could change while the program is running.

Problem 22................... MCQ................... 4 Points

Which one of the following does not change the LC? (a) .EQU @, $010.

(b) .EQU Increment LC, $010.

(c) .WORD 10.

(d) .BLKW 10.

Problem 25................... MCQ................... 4 Points

Which of these instructions do not modify the OV flag?

I. ADA $ II. TAX III. TXA IV. ADX $ (a) II and IV only.

(b) I, II and IV only.

(c) I, III and IV only.

(d) II only.

Problem 26............... Not an MCQ............... 10 Points

Represent the following decimal numbers in 2’s complement form. Assume an 8-bit word size. 26.1 − 90

Problem 28............... Not an MCQ............... 10 Points

Determine the 24-bit floating point representations of the following decimal numbers.

28.1 0