{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

exam_2_solution - ECE 331 Spring 2008 Exam 2 Total 100...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 6
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE 331 Spring 2008 Exam 2 Total: 100 points Time: 50 Minutes Closed Book — Closed Notes except 68HC12 Instruction Set handed out in class Problem Pa 6 5 Value Score 1 2 21 2 2—3 14 3 4 25 4 5-6 22 5 6-7 18 Total Instructions: 1. Check to make sure you. have all 7 pages. 2. Work only in the space provided. You can use back pages for tin-graded work. 3. Keep your eyes only on your own work. Cheating Will dealt with to the full extent of university policy. 4. Show your work. 5. As a guideline, plan to spend no more than 10 minutes per question. PRINTNAME: SOLUTIONS Section #2 Exam #: 3.. 1/7 1. (21 points) Assemble each of the following instructions into 68HC12 machine code (in hex). If the instruction contains an error, briefly state what the error is. Ewrov— OPercAél for) mg a. ADCA #$DBA b. LDD #$987 CC 00’ g 7 PM: Cl. C. CPX %10, X . . M r‘ _ ' W tY U C/i" m d. PSHA #56 w @rO—ahié‘mw‘ Va"? e. INC$3B4 7a 05 BE}: f. ADDA 0,X+~ g. NEG 3A2 2. (14) Short answers. Use only space provided. a. (3) Briefly explain the difference between an assembly language instruction and a directive. styflgé b. (2) Bit 12 of the D register is also the bit 9; of A register. 0. (3) Explain briefly the difference between a. relative and an absolute address. KW Wmmd 437995,» Lit) Lace «6/6364: &* _ W' w-mg W W aegwetfie W WWW/‘4 <31?) extafilwge {3L -—- C H) — M W Wing/Lye - d. (3) What is the cycle time of a microprocessor with a clock of 4MHz. _, 02V“) (Aim 4 Xlo‘l’ L o. 255 leé SW' ___ (”HM elm-\SWE/‘r ”(1124 em) tbsp/L”) 165*) H P W o > \f‘ .L; L V e. (3) What is the difference between a conditional and an unconditional branch instruction? Give an example for each kind. flPt l1“ gammw ‘ New“ Nut ‘6 m {Erma/“Z: fime 06 i9“ ‘6) m Mfim ? Q! am”? ecc, 6C3, @617) 5LT " ,L flake/v tel/V» MMWWQJ W M (gamete g9. BRA, Leek MP 3/7 3. (25) Fill in the blanks in the following .lst file. (1 point for each blank except relative address displacements which are worth 3 points). A200 1 ORG A200) A200 cc 00 DO 2 START LDD #50 A 20.2 CE0003 3 LDX E 5150 3 A2% CFDOOO £49521 LDS $5,120 00 A209 A8 0 o 5 L1 ADDA 0,X A20B Q3 A3196 DEX A206 26 F6 7 ENE L1 A20B am 05 8 BRA L2 A21 0 0106030608; 9 DATA FCB $1,$B,$3,$6,$8 A215 10 VAL EQU %101 A215 16 B I Do 11 L2 JSR $13100 A218 12 END WJC _ ml Symbol Table 62 124:5 ¥0Y tidal 1 n}. Y- A2250 2 W 35;?” 72W 3 1M 90" b“ > L1 {3103 L2. A215 Dem A210 .1. ohm 21— 2. Li 0 PCT 1“— PCfi—m 10% f3 MG .— A 206 + 2 "Hg/”0P . ., A2001 ~— 31 “’ 0W 5 Z ’5 y _ lllll0\\:FE ; 05000 010 O26 4/7 4. (22) Assume the following register and memory contents. A contains $213 $04A8 contains $35 B contains $75 $04A9 contains $D7 X contains $04A8 $04M contains $89 Y contains $04AA CCR contains $B2 For each of the following instruction sequences, determine if the indicated conditional branch instructions will be “TAKEN” or “NOT TAKEN” assuming they immediately follow the instruction sequence. Each part is independent. A. 3900 ___aoo\ STAA $3000 _ STAB $3001 <&'5 Pt 7Q” comer): 5) LDY 0,X m CPY $04A9 (v) _ at 9180; BRx NEXT 095*)“ BRx=BMI NotToLkms‘ N:\ ‘3 No (Q'SPt-t?) BRX=BGT M 2+(N®V>‘507 (Q-SPES) BRx=BCC Not'l‘odmx (:0? No (I PE) BRx=BRA 3W OOH Ol’Ol [\Ol Dill 35 D7 #7,,4-‘0‘ 0‘“ .‘Oootcol ONE FCB $F3 TWO LDAA #%00101011 ADDA ONE BRX NEXT 5/7 ($5955) BRx=BNE Tm %‘O? (526%) BRx=BPL M N=07 (awe) BRx=BLT MotToJLM NOV-4 ? Mo (1 aye) BRstSR Tame 5. 1%” c:&,V=©,N:0)H:®)1:O (18) Lab related question. A. (4) Illustrate or describe how to make a T flip flop from a JK flip-flop. (N0 PM) 6/7 B. (14) Consider the NAND form equation Kw, X, Y, Z) = [(W‘XY)1(ZWXE)‘]1. to We $5,” Show the wiring diagram to implement this function on the 7400 quad 2-input and the 7410 ’1 4 Mai triple 3—input NAND chips shown below. On the left are inputs W, X, Y and Z. On the right is the output F- Also, include the power and ground connections shown. Please make sure that wiring connections are neat, clear and easy to understand. ...
View Full Document

{[ snackBarMessage ]}