Sample Code - Computer Architecture - Past Exam, Exams of Computer Architecture and Organization

Main points of this past exam are: Computer Architecture, Pull Stack Operations, Processor, Push, Passing Parameters, Registers, Value, Reference, Memory Mapped, Subroutine.

Typology: Exams

2012/2013

Uploaded on 03/27/2013

kaale
kaale 🇮🇳

4.4

(7)

29 documents

1 / 4

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
(NFQ Level 8)
Summer 2006
Computer Architecture
(Time: 3 Hours)
Answer any four questions. Examiner: Mr. S. Lankford
Mr. J. Buckley
Dr. A. Kinsella
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. (8 marks)
(b) Briefly explain the following methods of passing parameters to a subroutine. Outline
the advantages and disadvantages of each method and use simple code examples
where appropriate.
i) Passing parameters via registers
ii) Passing parameters by value
iii) Passing parameters by reference (6 marks)
(c) Explain what “Memory Mapped I/O” means? (4 marks)
(d) Using a simple polling loop, write a program to write 128 bytes of data from a table
to an output port. Let $008000 be the location of the port to which data is sent and let
$008002 be the location of the status byte. If the port is ready for data, then bit 0 of
the status byte is a 1. If the port is busy, then bit 0 of the status byte is a 0.
(7 marks)
[Total: 25 marks]
pf3
pf4

Partial preview of the text

Download Sample Code - 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

(NFQ Level 8)

Summer 2006

Computer Architecture

(Time: 3 Hours)

Answer any four questions. Examiner: Mr. S. Lankford Mr. J. Buckley Dr. A. Kinsella

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. (8 marks)

(b) Briefly explain the following methods of passing parameters to a subroutine. Outline the advantages and disadvantages of each method and use simple code examples where appropriate.

i) Passing parameters via registers ii) Passing parameters by value iii) Passing parameters by reference (6 marks)

(c) Explain what “Memory Mapped I/O” means? (4 marks)

(d) Using a simple polling loop, write a program to write 128 bytes of data from a table to an output port. Let $008000 be the location of the port to which data is sent and let $008002 be the location of the status byte. If the port is ready for data, then bit 0 of the status byte is a 1. If the port is busy, then bit 0 of the status byte is a 0. (7 marks)

[Total: 25 marks]

Q2. (a) Explain what it meant by the term DMA and summarise its key points of operation? In your explanation, outline the microprocessor signals required to implement this type of transfer. (5 marks)

(b) Using a Bus Arbitration Cycle flowchart, show how an external device requests the bus of the 68000 processor. In your flowchart, clearly outline the microprocessor signals which are required and explain the operation of the bus arbitration protocol. (10 marks) (c) How might the following code be executed in a theoretical 3 stage pipelined processor? LOAD #40,A ; load 40 in A MOVE A,B ; copy A in B ADD #20,B ; add 20 to B STORE B, 0x300 ; store B into memory cell 0x (10 marks) [Total 25 marks]

Q3. (a) Briefly explain “Interrupt Polling” (i.e. interrupt-driven I/O with device polling). (3 marks) (b) Briefly explain what is meant by a vectored interrupt. (4 marks) (c) Illustrate and explain how interrupt requests can be prioritised using daisy chaining (8 marks) (d) Using a diagram of the 68000 processor, illustrate and explain how a level 5 vectored interrupt is responded to. In your diagram, show the appropriate pins on the 68000, the IRQ and IACK lines, encoders/decoders and any interface logic that is required. (10 marks) [Total 25 marks]

Q5. (a) 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 .DATA 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 NOTE : This program does not require you to take input from or send output to the console. (10 marks)

(b) Write an 80x86 program to find the total sum and average value in an array of numbers, which is input by the user. Clearly outline the design of such a program. In the program, the data and stack areas must be defined. The program should perform the following: i) Accept positive integers from the keyboard. Entering a negative number terminates data input. ii) Counts the number of integers inputted and stores the numbers in an array iii) Finds the total sum and average value of all numbers entered iv) Displays the average value and total sum to the console output. [15 marks] [Total 25 marks]