Subroutine - Computer Architecture - Past Exam, Exams of Computer Architecture and Organization

Main points of this past exam are: Computer Architecture, Software Development, Computer Networking, Push, Pull, Stack, Illustrate, Occurrences, Implement, Bit Memory Mapped

Typology: Exams

2012/2013

Uploaded on 03/27/2013

kaale
kaale 🇮🇳

4.4

(7)

29 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Cork Institute of Technology
Bachelor of Science (Honours) in Software Development and Computer Networking – Stage 2
(Bachelor of Science in Software Development and Computer Networking – Stage 2)
(NFQ – Level 8)
Summer 2005
Computer Architecture
(Time: 3 Hours)
Answer any four questions. Examiner: Mr. S. Lankford
Dr. D. Chambers
Mr. T. Parslow
Mr. P. O’Connor
pf3
pf4
pf5

Partial preview of the text

Download Subroutine - Computer Architecture - Past Exam and more Exams Computer Architecture and Organization in PDF only on Docsity!

Cork Institute of Technology

Bachelor of Science (Honours) in Software Development and Computer Networking – Stage 2 (Bachelor of Science in Software Development and Computer Networking – Stage 2) (NFQ – Level 8)

Summer 2005

Computer Architecture

(Time: 3 Hours)

Answer any four questions. Examiner:^ Dr. D. ChambersMr. S. Lankford Mr. T. Parslow Mr. P. O’Connor

Q1 (a) With appropriate diagrams, illustrate and explain the operation of the stack in the 68000 processor. In your explanation, use either RTL or sample code, to illustrate the push and pull stack operations. [10 marks]

(b) Illustrate and briefly explain what effect the following code samples have on the stack: i) MOVEM.L D0-D2/A0-A4,-(A7) ii) MOVEM.L (A7)+,D0-D2/D4/A4-A iii) RTS [6 marks]

(c) Given the following DATA section: ORG DATA X DS.B 1 Y DS.B 1 NUMS DC.B 1,2,5,5,2,1,5,

Write a subroutine, which processes the NUMS array and checks for the number of occurrences of a digit, which is passed to the subroutine via the stack. Write a 68000 program which uses this subroutine to check for the number of occurrences of the variables X and Y.

It is assumed that, once the program is loaded, the values X =1 and Y = 5 are copied into memory using the memory viewer,

The subroutine is to return the result of the calculation via the stack and then store the answers in registers. The number of occurrences of X is stored in D6 and the number of occurrences of Y is stored in D7 [9 marks]

Q4. (a) Using appropriate diagrams and sample code, explain the following addressing modes:

(i) Address Register Indirect with post incrementing (ii) Address Register Indirect with pre decrementing (iii) Address Register Indirect with displacement (iv) Address Register Indirect with 8-bit Signed displacement and short index (v) Absolute addressing [10 marks]

(b) Briefly describe the operation of the bubble sort and bucket sort algorithms using simple diagrams and tables as appropriate. Explain how the algorithms differ. [5 marks] (c) Using a bucket sort algorithm, write a 68000 program to arrange the numbers in the array, MYNUMS, into ascending order.

MYNUMS DC.B 8,3,5,9,2,7,

The bucket sort algorithm should be implemented in a subroutine , which is invoked by the main program. [10 marks]

Q5. (a) Write an 80x86 program to convert Celsius to Fahrenheit using the following formula:

F = (9/5) * C + 32

The program should be written as a console application, which prompts the user for the Celsius input and outputs the Fahrenheit answer to the console. [10 marks] (b) Briefly describe and illustrate the operation of the stack in the 80x86 processor, by explaining the operation of the following instruction: PUSH EBX Show the following in your illustration: (i) Contents of EBX after instruction execution (ii) Contents of the stack before and after the instruction is executed (iii) Any modifications, which take place to EIP before and after the instruction is executed Assume that the following values are stored in EBX prior to the instruction executing: 09 03 02 07 [6 marks]

(c) Write an 80x86 program, which finds the sum of the squares of 2 floating-point numbers. The program should perform the following: (i) Define two floating point numbers, to be used by the program, in the .DATA section (ii) Calculate the sum of the squares of these 2 floating-point numbers (iii) Store the answer, i.e. the sum of squares answer in the .DATA section of your program NOTE : This program does not require you to take input from or send output to the console. [9 marks]