micro p test 2 skema

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 resp€ctively. )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)

Upload: semuty92

Post on 24-Nov-2015

43 views

Category:

Documents


0 download

DESCRIPTION

add

TRANSCRIPT

  • 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 islValaySia reading a wird of data at location $oescoe

    ICOl,POr,C2lf.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,c2lAddress lines = 14 Data lines :8 (4)

    3. Ifthe instruction ofBEQ . s LABEL is located at address $4020, what is the maximum TABELlocation can be plarfrdl )$4020+$7F = $40A1 )$40A0 (3)

    lco2,Pol,c2l4. Name the last instruction in subroutine )RIS (2)

    lco2,Pol,c2l5. ListthevectoraddressforRESET )$000004-$000007 (3)

    lco4Polr,c3l6. Determine the address register that can be used as stack poioter )A7 (2)

    lcor,Por,c2l7 . It amemory device has 8 Mbytes capacity, calculate the number of address lines available for

    TEST 2 - SOLUTION

    the memory. )23 Address lines

    COURSE : MICROPROCESSORSCOURSf,CODf, : BLE2223LECTURER : NIK MOHD KAMIL BIN NIK YUSOFFDATE : 6DECEMBER20I2DURATION : ||I4HOURSSESSIONISEMESTf,,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 PrinciplesofSoftware & 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) Ilco1,Po1,c2l

    Y*WHilffifldd1ffif,tffi$Bft*iffill. 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,c3l3. Calculate the value ofSP ifthe following program is executed

    lco2,Por,c2loRG $400

    START MOVEA +S3OOO,SPMOVEM.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 inregister D2.

    EXGfrau'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,D0MOVE.B D0,D7oR.B $9123,D0NAT.B DOEOR.B $4554,DLNOT.B D1ANID.B D7,DONOT.B DOr4ovB.B D0,$2345END

    ffi

    ICO3,FO4C5|lc03,Po2,cslA0,D2#84 , D2

    (s)

    Obtain the content of register A0, D0 and Dl if the following program is executed.lco2,Pol,czl

    oRG $1000START MOVEO #STC, DO

    MOVEA.L *TABLE+4,A0MOVE.L 5(A0,D0),D4MOVE.L - (A0),D0 A0=$ 00002 000

    ; DO=SEFFFEEEC; A0:$0 000200 4; D4=$3738394L; D0=S31323334

    ORGTABTE DC.B

    LOOPlrooP2

    $2 000'123456789A8CDEE0',

    +$10, D2#r"00, D5*1, D5LOOP2*1,D2LOOPl

    (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 FE00Obtain the new content ofregisters D0, Dl and D2 ifthe following codes are executed

    [co2,Por,c2lBCHG,B *2,D0EOR.W 10 (A0) , D1AND.B

    -(AO),D2 (6)If the following program is executed, how many times the instruction suBo-w *1, D5 will beexecuted ?

    tco2,Pol,c2l

    (8)

    MOVE.BMOVE.WSUBQ.WBNESUBQ. BBNE

    )16(100)=1600 tbnes (5)Ifthe RESET program is located between $12340 - $I2FFF, write a directive assembler so thatthe program is executed when the RESET switch is activated.

    Ico3,po4cslORG $4Dc.L $00012340 (5)

    ; D2=$DCBA7820

  • (vi)

    (vii)

    IfDl=$SABCDEF0,givethevalueofDlifinstructionMOVE.w $IBFEDC,D1 isexecutedt Dt =$9ABCI7FF O)Develop a program to produce an upward counter (00,01,02...09,@,01..) at the segment if thecontent ofthe input switches (buffer) changes

    At8419m421

    ASMm3

    SWITCH EQUREPEAT CLR.B

    CLR. BAGAIN AIP.B

    BEQMOW.BMOVE. BADDO.BA'PI .BBEQBRA

    $28000 1"$ 180000

    DOD1SWITCH,DOAGAINSWITCH,DOD7, SEGMENT#$10 , Dl#$90 , DlREPEATAGA.TN

    (s280001-S2BFFFF)($780000-$TBFFnE)

    tlfl_il. il=

    Figure 2

    By referring to Figure 2, answer the following question (Assume the data bus contains $FFFF ifit is not triggered by any devices)

    lc(x,Folr,c3lIf 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 duringsubroatine so that the program can return to the main program (3)

    Write a directive assembler to initialize stack pointer) oRG s0DC.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 ofdecoder 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 startirEaddress 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)