Stack - Computer Systems - Exam, Exams of Computer System Design and Architecture

Main points of this past exam are: Stack, Characters, Buffer Area, First Word Found, Storing, Second Word Found, Output, Input, Continuous Letter Characters, Manipulation Required

Typology: Exams

2012/2013

Uploaded on 03/28/2013

bips
bips 🇮🇳

4.8

(5)

72 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 Computer Applications – Stage 3
(Bachelor of Science in Computer Applications – Stage 3)
(NFQ – Level 8)
Autumn 2005
Computer Systems III
(Time: 3 Hours)
Answer question ONE and THREE other questions.
All questions carry equal marks.
Hardware reference guide book is available.
Examiners: Dr. J. Creagh
Dr. D. Chambers
Mr. E. A. Parslow
Mr. P. O’Connor
Q1. (a) Write an 80386 subroutine, which may be called from a C/C++ program to examine a
string.
The first and second words in the string must be returned. Diagram of stack required.
Example: FindFirstTwoWords (Str,Res1,Res2)
The first parameter ‘Str’ represents the string of characters to be examined.
The second parameter ‘Res1’ represents the buffer area for storing the first word found.
The third parameter ‘Res2’ represents the buffer area for storing the second word found.
Sample Data Input Str = ‘1960, The 3 fields.’
Output Res1 = ‘The’
Res2 = ‘fields’
Note 1: ASCII ‘0’ = 30H ‘A’ = 41H ‘a’ = 61H
Note 2 : A word is considered to consist of one or more continuous letter characters.
(16 marks)
(b) Write a detailed report describing stack manipulation required for C/C++ access to 80386
subroutines. Reference to part (a) above is required. (7 marks)
(c) Explain why C/C++ access to 80386 assembly language subroutines may be
useful / necessary. (2 marks)
pf3
pf4

Partial preview of the text

Download Stack - Computer Systems - Exam and more Exams Computer System Design and Architecture in PDF only on Docsity!

Cork Institute of Technology

Bachelor of Science (Honours) in Computer Applications – Stage 3

(Bachelor of Science in Computer Applications – Stage 3)

(NFQ – Level 8)

Autumn 2005

Computer Systems III

(Time: 3 Hours)

Answer question ONE and THREE other questions. All questions carry equal marks.

Hardware reference guide book is available.

Examiners: Dr. J. Creagh Dr. D. Chambers Mr. E. A. Parslow Mr. P. O’Connor

Q1. (a) Write an 80386 subroutine, which may be called from a C/C++ program to examine a string. The first and second words in the string must be returned. Diagram of stack required. Example: FindFirstTwoWords (Str,Res1,Res2) The first parameter ‘Str’ represents the string of characters to be examined. The second parameter ‘Res1’ represents the buffer area for storing the first word found. The third parameter ‘Res2’ represents the buffer area for storing the second word found. Sample Data Input Str = ‘1960, The 3 fields.’ Output Res1 = ‘The’ Res2 = ‘fields’ Note 1: ASCII ‘0’ = 30H ‘A’ = 41H ‘a’ = 61H Note 2 : A word is considered to consist of one or more continuous letter characters. (16 marks)

(b) Write a detailed report describing stack manipulation required for C/C++ access to 80386 subroutines. Reference to part (a) above is required. (7 marks)

(c) Explain why C/C++ access to 80386 assembly language subroutines may be useful / necessary. (2 marks)

Q2. (a) Write a PowerPC 604 assembly language subroutine to compare two strings. The subroutine may be called from a C/C++ program. The comparison is not case sensitive (i.e. the ‘THE’ is considered equal to the ‘the’). Header Comment Required. Note: ASCII ‘0’ = 0x30 ‘A’ = 0x41 ‘a’ = 0x61 (13 marks)

(b) Write 80x86 subroutines to solve the following:

  • Draw a horizontal line
  • Draw a vertical line
  • Draw a rectangle Note (1): Assume graphics 640 x 480 mode is already set up. Note (2): Header Comments required. (12 marks)

Q3. (a) (i) Define the following terms:

  • RISC
  • CISC
  • Pipeline
  • Execution Unit
  • Superscaler (5 marks)

(ii) Briefly describe the main design principles of a RISC processor. (3 marks)

(iii) With reference to the PowerPC 604e, clearly explain how these RISC design principles apply. Examples required. (8 marks)

(b) With aid of examples, describe and compare each of the mapping functions associated with cache design. (9 marks)

Q6. (a) Define the terms:

  • Computer Architecture
  • Computer Organisation (3 marks)

(b) (i) What is meant by “interconnection structures” on a computer? Diagram required. (2 marks) (ii) Describe the following interconnection structures:

  • I/O to memory
  • I/O to switch
  • I/O to bus giving advantages and disadvantages of each. (13 marks)

(c) (i) Briefly describe the PCI bus. Give an example of a typical desktop system. (5 marks) (ii) Recently PCIe was introduced. Why is it required? (2 marks)