Trace Table - Microprocessor Systems - Exam, Exams of Microprocessors

Main points of this exam paper are: Trace Table, Block Diagram, Simple, Function, Main Parts, Each Block, Von Neumann, Simple Diagrams, Architecture, Purpose Microcomputers

Typology: Exams

2012/2013

Uploaded on 04/13/2013

kajol-ajay
kajol-ajay 🇮🇳

4.9

(7)

90 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CORK INSTITUTE OF TECHNOLOGY
INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ
Semester 1 Examinations 2012/13
Module Title: Microprocessor Systems 1
Module Code: ELTR6016
School: Mechanical, Electrical and Process Engineering
Programme Title: Bachelor of Engineering in Electronic Engineering Yr 2
Bachelor of Engineering (Hons) in Electronic Systems Engineering Yr 2
Programme Code(s): EELXE_7_Y2
EELES_8_Y2
External Examiner(s): Mr I Kennedy
Mr T O’Brien
Internal Examiner(s): Mr J O’Sullivan
Instructions: Attempt any three questions. All questions carry equal marks.
Ensure you include the Return Sheet with your answer book.
Duration: Two hours
Sitting: Winter 2012
Requirements for this examination: N/A
Note to Candidates: Please check the Programme Title and the Module Title to ensure that you have received
the correct examination paper.
If in doubt please contact an Invigilator.
You are expected to present your material in a neat and tidy fashion.
Start each question on a new page.
Remember that there is plenty of time two hours for three questions.
pf3
pf4
pf5

Partial preview of the text

Download Trace Table - Microprocessor Systems - Exam and more Exams Microprocessors in PDF only on Docsity!

CORK INSTITUTE OF TECHNOLOGY

INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ

Semester 1 Examinations 2012/

Module Title: Microprocessor Systems 1

Module Code: ELTR

School: Mechanical, Electrical and Process Engineering

Programme Title: Bachelor of Engineering in Electronic Engineering – Yr 2

Bachelor of Engineering (Hons) in Electronic Systems Engineering – Yr 2

Programme Code(s): EELXE_7_Y

EELES_8_Y

External Examiner(s): Mr I Kennedy

Mr T O’Brien

Internal Examiner(s): Mr J O’Sullivan

Instructions: Attempt any three questions. All questions carry equal marks.

Ensure you include the Return Sheet with your answer book.

Duration: Two hours

Sitting: Winter 2012

Requirements for this examination: N/A

Note to Candidates: Please check the Programme Title and the Module Title to ensure that you have received

the correct examination paper.

If in doubt please contact an Invigilator.

You are expected to present your material in a neat and tidy fashion.

Start each question on a new page.

Remember that there is plenty of time – two hours for three questions.

Q1 (a) Draw a simple block diagram showing the main parts of a microcomputer.

Briefly outline the function of each block. [4 marks]

(b) General purpose microcomputers are usually found with Von Neumann

architecture while embedded controllers normally have Harvard architecture.

Use simple diagrams to show the difference between both systems and compare

each system in terms of advantages and disadvantages. [4 marks]

(c) In relation to machine instructions, what is meant by the term addressing mode?

Name three addressing modes that can be used with machine instructions for the

PIC24F microcontroller, explain briefly the purpose of each mode used and

provide an example in assembly language of each. [4 marks]

(d) Explain in simple terms how the two’s complement number system is used to

represent both positive and negative numbers in a computer.

Rank in order of magnitude the following 16-bit two’s complement values:

F2A7 5E4B 9D3A 0000 1CF3 B24E

Express the smallest of the above values as a 24-bit hex number. [4 marks]

(e) The PIC24F is given the following instruction: add.w w1,w2,w

If the values 0x4D7B and 0xB285 are held in W1 and W2, determine the result

when the instruction is executed? State whether the result is arithmetically

correct or not and how the processor deals with this situation. [4 marks]

Q2 (a) Briefly describe the difference between high-level and low-level programming

languages. Give an example of each and state any advantages of one over the

other. [3 marks]

(b) What is meant by a cross-assembler and why is it normal to use such an

assembler for the development of software for embedded systems? [3 marks]

(c) An 8-bit signed binary value, X, is held in data memory at location 0x0880. A

program segment is required to check this value and if the value is found to be

negative, to replace it with its positive equivalent.

Draw a flowchart to show how you would tackle this task. [6 marks]

(d) Using the accompanying instruction set, write a program with appropriate

comments to carry out the task on a PIC24F microcontroller. [8 marks]

PIC24F Instruction Set

  • ADD add. Wb,Ws,Wd bw (Wb) + (Ws) → Wd * * * * *^1 Mnemonic Syntax Ext Operation DC N OV Z C Cycles #
    • add. #lit10,Wn bw lit10 + (Wn) → Wn * * * * *
    • add. f,wreg bw (f) + (W0) → W0 * * * * *
  • ADDC addc. Wb,Ws,Wd bw (Wb) + (Ws) + (C) → Wd (Add with carry) * * * * *
  • AND and. Wb,Ws,Wd bw (Wb) (Ws) → Wd (Logical AND) * *^1
    • and. #lit10,Wn bw lit10 (Wn) → Wn * *
    • bra label Branch to label unconditionally BRA
    • bra C,label Branch if Carry 1(2)
    • bra NC,label Branch if No Carry 1(2)
    • bra GE,label Branch if Greater than or Equal 1(2)
    • bra GEU,label Branch if Unsigned Greater than or Equal 1(2)
    • bra GT,label Branch if Greater than 1(2)
    • bra GTU,label Branch if Unsigned Greater than 1(2)
    • bra LE,label Branch if Less than or Equal 1 (2)
    • bra LEU,label Branch if Unsigned Less than or Equal 1(2)
    • bra LT,label Branch if Less than 1(2)
    • bra LTU,label Branch if Unsigned Less than 1(2)
    • bra N,label Branch if Negative 1(2)
    • bra NN,label Branch if Not Negative 1(2)
    • bra OV,label Branch if Overflow 1(2)
    • bra NOV,label Branch if No Overflow 1(2)
    • bra Z,label Branch if Zero (Branch if equal to) 1(2)
    • bra NZ,label Branch if Not Zero (Branch if not equal to) 1(2)
  • CALL call label Call subroutine
  • CLR clr. Wd bw 0 → Wd (Clear all bits of Wd)^1
  • COM com. Ws,Wd bw ( ) → Wd (Complement Ws) * *
  • CP cp. Wb,Ws bw (Wb) (Ws) Compare (Wb) with (Ws) * * * * *^1
    • cp. Wb,#lit5 bw (Wb) lit5 Compare (Wb) with lit5 * * * * *
  • DAW daw.b Wn b Decimal adjust (Wn.b) (only for BCD) *
  • EXCH exch Wb,Wn (Wb) (Wn) (Exchange/swap)
  • IOR ior. Wb,Ws,Wd bw (Wb) + (Ws) → Wd (Inclusive-OR) * *^1
    • ior. #lit10,Wn bw lit10 + (Wn) → Wn * *
  • LSR lsr. Ws,Wd bw Logical shift (Ws) one bit right (result in Wd) * * *^1
    • lsr.w Wb,#lit4,Wn w Logical shift (Wb) lit4 bits right (result in Wn) * *
    • mov. Ws,Wd bw (Ws) → Wd^1 MOV
    • mov. #lit16,Wn bw lit16 → Wn
    • mov.w f,Wn w (f) → Wn
    • mov.w Wn,f w (Wn) → f
    • mov. f,wreg bw (f) → W0 * *
    • mov. wreg,f bw (W0) → f^1
  • NEG neg. Ws,Wd bw 0 (Ws) → Wd (Negate/ 2 's comp) * * * * *
  • NOP nop No operation^1
    • nopr No operation
  • POP pop.w Wd w Pop word off stack into Wd
  • PUSH push.w Ws w Push word in Ws onto stack
  • RETFIE retfie Return from interrupt * * * *
  • RETURN return Return from subroutine
  • RLC/RLNC rlc. /rlnc. Ws,Wd bw Rotate (Ws) one bit left, thru carry/no carry * * (*)
  • RRC/RRNC rrc. /rrnc. Ws,Wd bw Rotate (Ws) one bit right, thru carry/no carry * * (*)
  • SE se Ws,Wn Sign-extend byte in Ws (result in Wn) * *
  • SETM setm. Wd bw 0xFFFF → Wd (Set all bits of Wd)
  • SL sl. Ws,Wd bw Shift (Ws) one bit left (result in Wd) * * *^1
    • sl.w Wb,#lit4,Wn w Shift (Wb) lit4 bits left (result in Wn) * *
    • sub. Wb,Ws,Wd bw (Wb) (Ws) → Wd * * * * * SUB
    • sub. Wn,#lit10 bw (Wn) lit10 → Wn * * * * *
    • sub. f,wreg bw (f) (W0) → W0 * * * * *
  • SUBB subb. Wb,Ws,Wd bw (Wb) (Ws) ( ) → Wd (Subtract with borrow) * * * * *
  • SWAP swap.b Wn b Swap nibbles in Wn.b^1
    • swap.w Wn w Swap bytes in Wn
  • XOR xor. Wb,Ws,Wd bw (Wb)  (Ws) → Wd (Exclusive-OR) * *^1
    • xor. #lit10,Wn bw lit10  (Wn) → Wn * *
  • ZE Ze Ws,Wn Zero-extend byte in Ws (result in Wn) 0 *

CORK INSTITUTE OF TECHNOLOGY

INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ

RETURN SHEET

Initial MPU Values

W0: BA98 W1: BA98 W2: BA98 W3: BA

Instruction Result Flags

mov.w #0x7D,w0 W0:

N: 1 OV: 1 Z: 1 C: 1

N: OV: Z: C:

add.b #0xC5,w1 W1:

cp.b w2,#3E W2:

N: OV: Z: C:

N: OV: Z: C:

Figure 1 - Trace Table - Q3(b)

Big endian Little endian

8-bit model 8-bit model 16-bit model 16-bit model

Figure 2 – Q3(c)

Name: Return this sheet with your answer book