+ All Categories
Home > Documents > Review Prelim 2016 With Answers

Review Prelim 2016 With Answers

Date post: 06-Jul-2018
Category:
Upload: jomar-dordines
View: 217 times
Download: 0 times
Share this document with a friend

of 16

Transcript
  • 8/17/2019 Review Prelim 2016 With Answers

    1/16

    Question 1.

    A. State at least 2 advantages and 2 disadvantages of a microcontroller system over a hard

    wired relay based or digital logic based system. (see slide no. 13)

    B. State at least 4 dierences between a microcontroller and microrocessor. (see slide nos

    3!" 3#" 4$)

    %. State at least one alication when a microrocessor is best s&itable and another

    alication when a microcontroller is best s&itable. (see slide no 42)

    Page 1 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    2/16

    Page 2 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    3/16

    Page 3 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    4/16

    Question 2.

    Sketch the internal RAM map of a typlical 8051 microcontroller showing the following

     A!!ress range

    Register "anks #it$#yte a!!ressa"le

    %eneral purpose area an! a!!resses

    &see sli!e no '()

    Page 4 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    5/16

    Question *.

    +raw a typical "lock !iagram of a computer system showing the following components ,-/ RAM/ RM/ $s/ A!!ress #us/ +ata #us an! ,ontrol #us. &see sli!e no 2*)

    +escri"e each components "riefly. &see sli!e nos 21/ 2()

    Page 5 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    6/16

    Page 6 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    7/16

    Page 7 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    8/16

    Question (.

    +raw a typical "lock !iagram of a microcontroller system showing the following components ,-/ memory &RAM an! -RM)/ $ ports/ programma"le units &counter$timer/ serial an!

    parallel $ ports/ A$+ an! +$A). & see sli!e no. (3)

    Page 8 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    9/16

    Question 5.

    sing the 8051 instruction list/ gi4e eample for the following mo!es of a!!ressing an! eplaininstruction outcome if eecute!

    a6 mme!iate M7 A/ **9

    "6 +irectM7 A/ **9

    Page 9 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    10/16

    c6 n!irect using registers R0 : R1M7 R0/ **9

    M7 A/ ;R0

    !6 n!irect using Acc. A/

    M7 A/ *29

    Page 10 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    11/16

    M7 R0/ ;A

    Question <

    =rite a short program to sol4e the following pro"lem nput 2 num"ers an! y then output theresult of 5y > (.

    =rite !own all the steps in the program "elow.

    ?ine pco!e peran! ,omments

    1 R% 09 S@ @9 -R%RAM ,@R @ 009

    2 M7 -0/ 0BB9 S@ -0 AS -@

    * M7 A/ -0 ,-C 7A? B -0 @ A,, A

    ( M7 #/ 0(9 MM+A@ M7 0(9 @ #

    5 M? A/ # M?@-?C A @ #

    < M7 R0/ A ,-C A @ R0

    ' M7 -1/ 0BB9 S@ -1 AS -@

    8 M7 A/ -1 ,-C 7A? B -1 @ A,, A

    3 M7 #/ 059 MM+A@ M7 0(9 @ #

    10 M? A/ # M?@-?C A @ #

    11 S#, A/ R0 S#@RA,@ =$ ,ARRC A,, A @ R0

    12 M7 -2/ A M7 A @ -2

    1* + + B -R%RAM

    Page 11 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    12/16

    Question '

    =rite a short program to sol4e the following pro"lem nput 2 num"ers an! y then output theresult of 5y > *y.

    =rite !own all the steps in the program "elow.

    ?ine pco!e peran! ,omments

    1 or 

    2

    *

    (

    5

    <

    '

    8

    3

    10

    11

    12

    1*

    1(

    15

    1<

    Page 12 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    13/16

    Question 8

    +raw a flowchart to sol4e the following pro"lems.

     A large reception room uses a centraliDe! air con!itioning system. An , sensor is use! tomeasure the room temperature. An in!ucti4e !oor limit sensor counts the num"er of people that enter the room. @he system uses on$off control to switch on the fan that "lows col! air to the room.

     @here are * mo!es !epen!ing on how many people are in the house.

    f there are more than 10 people in the room an! the measure! temperature is greater than*0E, / it will turn on the fan.

    f there are more than 5 people an! less than 10 people in the room an! the measure!temperature is greater than 25E,/ it will turn on the fan.

    f the num"er of people is less than 5 an! the temperature is greater than 22E,/ it will turn onthe fan.

    Question 1*.

    mplement the algorithm "elow using the 8051 assem"ly co!e.

    1. nput pressure2. ,ompare pressure is pressure greater than 50 psi F

    *. f pressure is greater than 50 psi turn off compressor (. f yes/ repeat step 1G if no procee! to step 55. @urn compressor on.

  • 8/17/2019 Review Prelim 2016 With Answers

    14/16

    Question 3.

    Rea! the following program an! use the 8051 instruction list to i!entify the result & 4alue ) of e4ery instruction. =rite result "esi!e each instructions.

    .C O M M E N T S

    MOV A,#FFH ; ____________________________________ 

    MOV R0,#77H ; ____________________________________ 

    ANL A,R0 ; ____________________________________ 

    MOV 15H,A ; ____________________________________ 

    CPL A ; ____________________________________  

    ORL 15H,#88H ; ____________________________________ 

    ANL A,15H ; ____________________________________ 

    ORL A,R0 ; ____________________________________ 

    CLR A ; ____________________________________  

    ADD A,#0Ch ; ____________________________________ 

    MOV B,#03H ; ____________________________________ 

    MUL AB ; _______________________________________ 

    Page 14 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    15/16

    Question 10. Wih !""!"$%" & h" 8051 'i%!&%&$!&(("!, )$*+"! h" &((&+i$ -

    a) 9ow many ports are a4aila"le F( ports

    HHHHHH...........

    ") =hich port has pull6up resistors F-16p*

    HHHHHH...........

    c) =hich port you prefer to use as input an! why F

    HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

    HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

    !) =hat hea!ecimal 4alue you output to a port to set as input/ an! why Fffh

    HHHHHH...........

    e) =here !oes the ,- store the Ireturn a!!ressI/ when A,A?? instruction is eecute!F

    HHHHHH...........

    f) =hy !o we nee! to write + at the en! of your programF@o tell the compiler where the program will en!

    HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

    g) =hy !o we use R% 00009 at the "eginning of the programFStart the program counter at 0000h

    HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.

    h) =hat is the a!!ress of the stack when 8051 is resetF0'h

    HHHHHH...........

    Page 15 of 16

  • 8/17/2019 Review Prelim 2016 With Answers

    16/16

    i) =hat is the name of the register that contains the stack a!!ressFStack pointer 

    HHHHHH...........

     J) =hat !oes -, is use! for.@he program counter points to the a!!ress of net instruction to "e eecute!

    HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

    Page 16 of 16


Recommended