Sunteți pe pagina 1din 3

BEEA M@OPMSSS

Univefsiti
tartelnli kl$ebl-MttKtthrtrisisiri;6ffiftswertitma*sl
. l. State the logic re4uirement for each pin of A20, UDS*, LDS* and PJW* if a processor is
lValaySia
reading a wird of data at location $oescoe
ICOl,POr,C2l
f.jl,IAN-G
At': 0
(rDS*
= 0 LDS*
:0
NW: t (4)
FACULTY OF ELECTRICAL & ELECTRONICS ENGINEf,RING
2. State the number of address lines and data lines for the memory of EPROM 27128
lco1,Por,c2l
Address lines = 14 Data lines
:8 (4)
3. Ifthe instruction ofBEQ . s LABEL is located at address $4020, what is the maximum TABEL
location can be plarfrdl )$4020+$7F = $40A1 )$40A0 (3)
lco2,Pol,c2l
4. Name the last instruction in subroutine )RIS (2)
lco2,Pol,c2l
5. ListthevectoraddressforRESET )$000004-$000007 (3)
lco4Polr,c3l
6. Determine the address register that can be used as stack poioter )A7 (2)
lcor,Por,c2l
7 . It amemory device has 8 Mbytes capacity, calculate the number of address lines available for
TEST 2 - SOLUTION
the memory. )23 Address lines
COURSE : MICROPROCESSORS
COURSf,CODf, : BLE2223
LECTURER : NIK MOHD KAMIL BIN NIK YUSOFF
DATE : 6DECEMBER20I2
DURATION : ||I4HOURS
SESSIONISEMESTf,,R : SESSION 2012/2013 Sf,MESTER I
PROGRAMMECODE : BEE/BEP
INSTRUCTIONS TO CANDIDATE:
l. Answer ALL questions.
2. All the calculations and assumptions must be clearly state.d.
3. Candidates are not allowed to bring any materials other than the textbook listed below
N.M.KNik Yusoff& H. AMul Aziz,"The Microprocessor: Fundamental Principlesof
Software & Hardwarc using l6-bit Family'', lst ed., Penerbit UMP,20l2
DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO
This examination paper consists of FOUR (4) printed pages including front page
(2)
I
lco1,Po1,c2l
Y*WHilffifldd1ffif,tffi$Bft*iffil
l. If two EPROMs ST27C512 are used and the initial address of the EPROM is $I23ABC, what is
the end address of EPROM? )$l23ABC+$20M0-l
:
$|43ABB O)
lco4,Porr,c3l
2. Iladdress lines ofA23-A21 are connected respectively to C, B and A of74138 with C is MSB,
what is the possible address range for the device ifY4+ is chosen? Assume enable pins E1*,
E2* and E3 are connected to GND, AS* and A20 respctively.
)A23= 1,A22=0,A2 I
:0,A20:
I, then the address ranqe will be $900000-$9FFFFF. (5)
lco4Pou,c3l
3. Calculate the value ofSP ifthe following program is executed
lco2,Por,c2l
oRG $400
START MOVEA +S3OOO,SP
MOVEM.L DO-D2/AO-A2/A4.A6, -
(SP)
)!P:$3000-$24:$2FDC (s)
4. Write a program to multiply the content of A0 with 0.0125. Store the result of integer value in
register D2.
EXG
frau
'cy'V
9. Write a program to perform following Boolean function as shown in Figure I
$9123
$1234
S?Afi?
Figure I
MAVE.B $7234,D0
MOVE.B D0,D7
oR.B $9123,D0
NAT.B DO
EOR.B $4554,DL
NOT.B D1
ANID.B D7,DO
NOT.B DO
r4ovB.B D0,$2345
END
ffi
ICO3,FO4C5|
lc03,Po2,csl
A0,D2
#84 , D2
(s)
Obtain the content of register A0, D0 and Dl if the following program is executed.
lco2,Pol,czl
oRG $1000
START MOVEO #STC, DO
MOVEA.L *TABLE+4,A0
MOVE.L 5(A0,D0),D4
MOVE.L -
(A0),D0 A0=$ 00002 000
; DO=SEFFFEEEC
; A0:$0 000200 4
; D4=$3738394L
; D0=S31323334
ORG
TABTE DC.B
LOOPl
rooP2
$2 000
'123456789A8CDEE0',
+$10, D2
#r"00, D5
*1, D5
LOOP2
*1,D2
LOOPl
(6)
The content ofvarious registers and memories are summarized as follow
D0=$EEEDEFED, D1=$9010ABCD, D2=SDCBA7865, A0=$00005002
{$5000) = 1"122 3344 5566 7788 99AA BBcc DDEE FE00
Obtain the new content ofregisters D0, Dl and D2 ifthe following codes are executed
[co2,Por,c2l
BCHG,B *2,D0
EOR.W 10 (A0)
, D1
AND.B -(AO),D2
(6)
If the following program is executed, how many times the instruction suBo-w *1, D5 will be
executed ?
tco2,Pol,c2l
(8)
MOVE.B
MOVE.W
SUBQ.W
BNE
SUBQ. B
BNE
)16(100)=1600 tbnes (5)
Ifthe RESET program is located between $12340 - $I2FFF, write a directive assembler so that
the program is executed when the RESET switch is activated.
Ico3,po4csl
ORG $4
Dc.L $00012340
(5)
; D2=$DCBA7820
(vi)
(vii)
IfDl=$SABCDEF0,givethevalueofDlifinstructionMOVE.w $IBFEDC,D1 isexecuted
t Dt =$9ABCI7FF O)
Develop a program to produce an upward counter (00,01,02...09,@,01..) at the segment if the
content ofthe input switches (buffer) changes
At8
419
m
421
AS
M
m3
SWITCH EQU
REPEAT CLR.B
CLR. B
AGAIN AIP.B
BEQ
MOW.B
MOVE. B
ADDO.B
A'PI .B
BEQ
BRA
$28000 1"
$ 180000
DO
D1
SWITCH,DO
AGAIN
SWITCH,DO
D7, SEGMENT
#$10 , Dl
#$90 , Dl
REPEAT
AGA.TN
(s280001-S2BFFFF)
($780000-$TBFFnE)
tl
fl_il. il=
Figure 2
By referring to Figure 2, answer the following question (Assume the data bus contains $FFFF if
it is not triggered by any devices)
lc(x,Folr,c3l
If Yl2* is connected to the CS* of 2 RAM62256, determine the address range for the memory
)$3o0ooo-$33FFFF ($3qFFFF) (s)
Explain the significant ofthe RAM in a subroutine ) To store PC andother registers during
subroatine so that the program can return to the main program (3)
Write a directive assembler to initialize stack pointer
) oRG s0
DC.L $3L0000 0R
) r"lovEA.L #$3loooo,sP
(3)
In your opinion, why Y0* is used for EPROM? Is it possible to choose any other output line of
decoder such as Yl*, Y2, etc ?
) FO* is used
for
EPROM becanse the RESET uector is louted at $OOOOO4-
$OOOOO7. Thus, it is uery ilnpnrtant ta a@ess this location to inform the startirE
address of RESET routirrc (3)
what will be displayed if the instmction MovE. B $1BA09A, $2BcDEF is executed? Assume
'77' is displayed previously )'7,1' (3)
(12)
(0
(ii)
(iiD
(iu)
(v)

S-ar putea să vă placă și