0% found this document useful (0 votes)
50 views

ECE365 Exam Mar2012

Uploaded by

loco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

ECE365 Exam Mar2012

Uploaded by

loco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

CONFIDENTIAL EE/MAR2012/ECE365

UNIVERSITI TEKNOLOGI MARA


FINAL EXAMINATION

COURSE MICROPROCESSOR SYSTEMS


COURSE CODE ECE365
EXAMINATION MARCH2012
TIME 2 HOURS

INSTRUCTIONS TP CANDIDATES

1. This question paper consists of TWO (2) parts : PART A (25 Questions)
PART B (3 Questions)

Answer ALL questions from all TWO (2) parts :


i) Answer PART A in the True/False Answer Sheet
ii) Answer PART B in the Answer Booklet. Start each answer on a new page.

Do not bring any material into the examination room unless permission is given by the
invigilator.

Please check to make sure that this examination pack consists of:

i) the Question Paper


ii) an Answer Booklet - provided by the Faculty
iii) a True/False Answer Sheet - provided by the Faculty

DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO


This examination paper consists of10 printed pages
© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL
CONFIDENTIAL 2 EE/MAR 2012/ECE365

PARTA

Mark the correct answer on True/False answer sheet.

1) Register is one of the internal components of a microprocessor.

2) Register is a kind of temporary storage during the execution of the program.

3) Control unit in a microprocessor determines the Operation of a CPU either it reads from
or writes into memory or I/O.

4) Microprocessor understands binary codes.

5) Microprocessor needs an assembler to translate the assembly language to the


machine code.

6) Arithmetic Logic Unit (ALU) in a microprocessor is able to perform addition, subtraction


and several logic Operations.

7) Instructions written in C need an assembler to be translated from high level language


to machine code.

8) Microcomputer Systems can be built with a processor and input/output device without a
bus System and memory.

9) Interrupt is one of the control Signals of a microprocessor.

10 An example of application of the external request to the microprocessor is printing.

11 When the speed of a peripheral is slower than microprocessor, the microprocessor


requests the use of peripheral buses.

12 A microprocessor with 24-bit address bus and 8-bit data bus can address up to
512MB.

13 Supercomputer is designed with a microcontroller.

14 The Controller of aircraft is using both of microprocessor and microcontroller.

15 Secondary storage is directly accessible by a microprocessor.

16 Examples of main memory are hard disk and DVD ROM.

17 Primary memory is commonly used during the execution of the program.

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 3 EE/MAR2012/ECE365

18) HCS12/HC11 is a 32-bit microcontroller.

19) HCS12/HC11 is a RISC microcontroller.

20) HCS12/HC11 has the following features :


i) Input capture (IC)
ii) Output compare (OC)
iii) Synchronous peripheral interface (SPI)
iv) Asynchronous serial communication interface (SCI)

21) Index Register X and Y in HCS12/HC11 are also used in several arithmetic Operations.

22) Stack Pointer (SP) is a 16-bit register holds the address of the next instruction to be
executed.

23) Flags can be built by the combinations of MSI logic gates.

24) Table Q24 shows the prefixes for number bases in HCS12/HC11 :

Table Q24
Base Prefix Example
Binary B 10101111B
Hexadecimal H 2587H

25) Program Counter (PC) increases the value of address that it holds automatically.

(25 marks)

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 4 EE/MAR2012/ECE365

PARTB

QUESTION 1

a) Define the following terms:


i) Microprocessor
ii) Microcontroller
iii) Microprocessor-based Systems
(3 marks)

b) Draw a diagram of a microprocessor-based System. Hence explain the function of


each component.
(6 marks)

c) A microprocessor Chip has 16-bit address bus and 32-bit data bus. Calculate:
i) The minimum and maximum signed data that can be transferred between
microprocessor and memory or I/O. Show your answer in both hexadecimal and
decimal numbers.
ii) The capacity of the memory can be interfaced with the microprocessor chip.
State your answer in bytes.
iii) The starting and final addresses of the memory that can be interfaced with the
microprocessor. Express your answer in hexadecimal numbers only.
iv) Given a 2K x 32 SRAM, design the interfacing circuit by using 3-to-8 decoder as
shown in Figure Q1c, where the starting address of SRAM is 2000H. and show
all your calculations. Determine the final address of SRAM. Use the MREQ RD
i

and WR control Signals accordingly. Hence, determine the final address of


SRAM.

A (MSB) O0 3—
B ° 1 ")
<J

C (LSB)

r* El
L
—c Ü o6 1
E3 o 7 <J
")

3-to-8 Decoder
Figure Q1c
(16 marks)

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 5 EE/MAR2012/ECE365

QUESTION 2

a) Draw a diagram of HCS12 CPU registers and list two (2) features of HCS12.
(5 marks)

b) Identify the addressing modes and constant offset ränge of the following Instructions:
i) INY
ii) LDX #4000
iii) LDAA 0,Y
iv) LDAB -200.X
v) STAA 7.SP+
(5 marks)

c) Write an English comment describing the following Instructions :


i) MOVB #200,$900 (HCS12) / LDAA #200, STAA $900 (HC11);
ii) STAB 4,-Y;
iii) LDAA -260.X ;
iv) DECA;
v) ADDA $2000 ;

(5 marks)

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 6 EE/MAR2012/ECE365

d) HCS12/HC11 supports the addition of data greater than 16-bit. Figure Q2d is a
flowchart of 64-bit multiprecision addition by using looping instructions. The two (2)
values of addition are stored in $800 and $810, and the final result is stored at $900.
Start your program at the address of $800.

Notes:

X #$806 ; load immediate


value of 806H into index register X.

D •* (X) ; load content of memory


pointed by X into double accumulator D.

D < D+(Y) ; add content of D with


content of memory pointed by D and
störe the result in D.

(SP)«- D ; Store content of double


accumulator D into memory pointed by
SP.

X<«- X - l ; decrease content of index


register X.

Figure Q2d
(10 marks)

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 7 EE/MAR2012/ECE365

QUESTION 3

a) A System has four (4) common cathode seven-segment LEDs display which connected
to Port A, Port B, Port P and Port T of HCS12/HC11. This System will display 'HELP'
on the seven-segment LEDs display.
i) Draw a complete circuit of the System.
ii) Determine the corresponding value of 'HELP' at all ports.
iii) Write a complete program.

(12marks)

b) Figure Q3b depicts the circuit connection between eight (8) LEDs with HCS12/HC11.

BO
B1
HCS12/ B2
HC11 B3

B4
B5
B6
B7
J1

Figure Q3b

i) The HCS12/HC11 uses the E-clock signal as a timing reference. If the crystal
oscillator of the HCS12/HC11 is 48MHz, compute the E-clock in Hertz (Hz) and
seconds (s).
ii) Write a füll program to make all LEDs blinking. The delay between turning on
and off is 500ms. Refer to Table Q3b for your Instructions.
(6 marks)

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 8 EE/MAR2012/ECE365

Table Q3b
Mnemonic Instruction cycle
Addressing EXT IDX IDX1 IDX2 INH REL
modes
Dec 4 3 4 5 1 -
Bne - - - - - 3
Dbne - - - - - 3
Beq - - - - - 3
dbeq - - - - - 3

Notes:
EXT : Extended addressing modes
IDX : 5-bit constant offset indexed addressing modes
IDX1 : 9-bit constant offset indexed addressing modes
IDX2 : 16-bit constant offset indexed addressing modes
INH : Inherent mode
REL : Relative mode

c) Figure Q3c shows the connection between DIP switch, LEDs and HCS12/HC11.
Followings are the Instruction sequence for the circuit. Analyze the Output of the
program.

ORG $1000 ;HCS12


BCLR DDRH,$03
BSET DDRB,$F0
BSET DDRJ,$02
BCLR PTJ,$02
AGAIN: MOVB PTH,$2000
BRSET $2000,$03,RESULT1
BACK1: BRCLR $2000,$03,RESULT2
BACK2: BRSET $2000,$01,RESULT3
BACK3: BRSET $2000,$02,RESULT4
BRA AGAIN
RESULT1: MOVB #%11110000, PORTB
BRA BACK1
RESULT2: MOVB #0,PORTB
BRA BACK2
RESULT3: MOVB#%00110000,PORTB
BRA BACK3
RESULT4: MOVB #%11000000,PORTB
BRA AGAIN
END

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 9 EE/MAR2012/ECE365

ORG$1000;HC11
BCLR DDRH,$03
BSET DDRB,$F0
BSET DDRJ,$02
BCLR PTJ,$02
AGAIN: LDAA PTH
STAA $2000
BRSET $2000,$03,RESULT1
BACK1: BRCLR $2000,$03,RESULT2
BACK2: BRSET $2000,$01,RESULT3
BACK3: BRSET $2000,$02,RESULT4
BRA AGAIN
RESULT1: LDAA #%11110000
STAA PORTB
BRA BACK1
RESULT2: LDAA#0
STAA PORTB
BRA BACK2
RESULT3: LDAA #%00110000
STAA PORTB
BRA BACK3
RESULT4: LDAA #% 11000000
STAA PORTB
BRA AGAIN
END

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 10 EE/MAR2012/ECE365

Figure Q3c
(7 Marks)

END OF QUESTION PAPER

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL

You might also like