Docsity

Machine Code - Microprocessor Systems - Exam, Exams of Microprocessors

Toggle sidebar
bg1
Cork Institute of Technology
Higher Certificate in Engineering in Electronic Engineering – Award
(NFQ Level 6)
Summer 2006
Microprocessor Systems
(Time: 3 Hours)
Answer Question 1 [40 marks] and any
three other questions [20 marks each]
Maximum available marks is 100
Examiners: Mr. J. J. O’Sullivan
Mr. J. Berry
Dr. R. Ó Dúbhghaill
Q1 (a) Explain briefly what a microprocessor is, and with the aid of a simple block diagram,
describe how it fits into an overall microcomputer.
(b) In relation to computer programming, explain what is meant by the terms assembly
language and machine code, and describe the relationship between them.
(c) In a 68000-based computer, what is meant by bytes, words and longwords?
Below is a line of memory data as printed out on the Flight-68K computer:
400600: 1111 1111 1111 1111 1111 1111 1111 1111
Rewrite the line after all of the instructions below have been executed:
i)
MOVE.W #$47B2,$400604
ii)
MOVE.B #34,$40060D
iii)
MOVE.L #$FEDCBA,$400608
(d) What is a bus? State the function of the address, data and control busses in a computer.
What would be the effect of increasing the address bus from 16 to 20 lines?
(e) Explain briefly what is meant by the term tri-state as applied to logic gates. With the
aid of a simple diagram, explain how such gates can be used to overcome logic conflict.
(f) Why do memory addresses in a 68000-based system increase in twos?
If a 1Kbyte block of memory is to be reserved, starting at $400500, determine the
address of the final byte in this block.
(g) What do you understand by the term input/output port?
Draw a logic diagram of an elementary parallel input port and give a brief description
of its action.
(h) Show how four switches would be connected to an input port on a computer. Explain
the action of this circuit.
pf3
pf4
pf5

Partial preview of the text

Download Machine Code - Microprocessor Systems - Exam and more Exams Microprocessors in PDF only on Docsity!

Cork Institute of Technology

Higher Certificate in Engineering in Electronic Engineering – Award

(NFQ Level 6)

Summer 2006

Microprocessor Systems

(Time: 3 Hours)

Answer Question 1 [40 marks] and any three other questions [20 marks each] Maximum available marks is 100

Examiners: Mr. J. J. O’Sullivan Mr. J. Berry Dr. R. Ó Dúbhghaill

Q1 (a) Explain briefly what a microprocessor is, and with the aid of a simple block diagram, describe how it fits into an overall microcomputer.

(b) In relation to computer programming, explain what is meant by the terms assembly language and machine code , and describe the relationship between them.

(c) In a 68000-based computer, what is meant by bytes, words and longwords? Below is a line of memory data as printed out on the Flight-68K computer: 400600: 1111 1111 1111 1111 1111 1111 1111 1111 Rewrite the line after all of the instructions below have been executed: i) MOVE.W #$47B2,$ ii) MOVE.B #34,$40060D iii) MOVE.L #$FEDCBA,$

(d) What is a bus? State the function of the address, data and control busses in a computer. What would be the effect of increasing the address bus from 16 to 20 lines?

(e) Explain briefly what is meant by the term tri-state as applied to logic gates. With the aid of a simple diagram, explain how such gates can be used to overcome logic conflict.

(f) Why do memory addresses in a 68000-based system increase in twos? If a 1Kbyte block of memory is to be reserved, starting at $400500, determine the address of the final byte in this block.

(g) What do you understand by the term input/output port? Draw a logic diagram of an elementary parallel input port and give a brief description of its action.

(h) Show how four switches would be connected to an input port on a computer. Explain the action of this circuit.

(i) What is meant by the term UART? Draw a simplified block diagram showing the internal structure of such a device and outline the function of each block.

(j) Identify the type of memory chip shown in the pinout diagram, Figure 1, below. Determine the capacity of this chip - show clearly all working.

GND 9 10 R/W

CS 8 11 D

A2 7 12 D

A1 6 13 D

A0 5 14 D

A3 4 15 A

A4 3 16 A

A5 2 17 A

A6 1 18 Vcc

Figure 1

[4 marks each – 40 marks in total]

Q2 (a) In computer programming, explain what is meant by a subroutine. List a number of advantages of using subroutines in a program. [5 marks]

(b) As part of a computer program, a subroutine is required to implement the multiplication of two 16-bit unsigned numbers, X and Y, using the technique of successive addition. The result Z should be returned as a 32-bit value. Registers D0, D1 and D2 should be used for passing X, Y and Z

i) Write a short paragraph to outline how you plan to accomplish this task. [4 marks]

ii) Draw a flowchart showing all steps in the subroutine. [5 marks]

iii) With the aid of the accompanying 68000 instruction set, write the subroutine in assembly language with appropriate comments throughout. [6 marks]

Q3 (a) Draw a block diagram showing the internal structure of the 68000 MPU, and briefly outline the function of each block. [8 marks]

(b) The 68000 MPU is said to be a 16/32-bit microprocessor - explain fully the meaning of this statement. [3 marks]

(c) What is meant by the term fetch-execute cycle as applied to the execution of program instructions? [3 marks]

(d) Making reference to the block diagram in (a) above, describe in your own words, the fetch-execute cycle for the following instruction: 00400400 A07B0064 ADD.W #100,D0 [6 marks]

A 1 -A 23

D 0 -D 15

LDS

AS

DTACK

R/W

CLK

RESET

D 0 -D 15 D^0 -D^7

D 0 -D 7

DTACK

R/W

CLK

RESET

A 6 -A 23 A^1 -A^5 RS 1 -RS 5

CS MC MPU

Addressdecoder MC PI/T

PA 0 -PA 7

PB 0 -PB 7

PC 0 -PC 7

H 1 H 2 H 3 H 4

PEN

Figure 2

(b) In relation to serial data transmission, explain what is meant by asynchronous data transfer. Draw a diagram to show how a byte of data would appear to the receiving computer, and explain how this computer is able to properly detect and receive this data. [5 marks]

(c) Table 1 below shows a subroutine called INCH, written to input a character via serial Port A of the Flight-68K computer. In relation to the overall task, fully explain the function of each line of the routine. [5 marks]

INCH MOVEA.L #$A00001,A

WAIT MOVE.B 2(A0),D

LSR.B #1,D

BCC WAIT

MOVE.B 6(A0),D

RTS

Table 1

The following information from the Flight-68K manual may be of help to you:

DUART base address: $A Port A status register: $A Port A Rx buffer register: $A

Port A Status Register

Break Frame Parity Overrun TxEMT TxRDY FFULL RxRDY

7 6 5 4 3 2 1 0 SRA

Higher Certificate in Engineering in Electronic Engineering

MICROPROCESSOR SYSTEMS

Summer 2006

BEFORE-AND-AFTER SHEET

Question 4(d)

Name: _______________________ Return with your answer book

X N Z V C

1 1 0 1 0

Registers before Flags before^ Instruction Registers after Flags after D0: 56789ABC D1: 12345678 D0: D749947D D1: 2E8AA8E D0: 264B397E D1: 62B4937E

D0: FEDCBA

1 0 0 1 0 X N Z V C 1 1 1 0 0 X N Z V C

X N Z V C 1 1 0 1 0

MOVE.W D0,D

ADD.W D0,D

CMP.B D0,D

NOT.B D

D0: D1:

X N Z V C

D0: D1:

X N Z V C

D0: D1:

X N Z V C

D0: X N^ Z^ V^ C

D0: 89ABCDEF X N^ Z^ V^ C 0 1 0 1 0

LSR.B #2,D0 D0: X N^ Z^ V^ C