{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw6 solutions

# hw6 solutions - Su Andy Homework 6 Due 11:00 pm Inst...

This preview shows pages 1–3. Sign up to view the full content.

Su, Andy – Homework 6 – Due: Oct 23 2007, 11:00 pm – Inst: Valvano 1 This print-out should have 18 questions. Multiple-choice questions may continue on the next column or page – find all choices before answering. The due time is Central time. Homework 6 001 (part 1 of 4) 10 points The following figure shows Mealy finite state machine. There are three states named S1 S2 S3 . There is one input signal, connected to PM0 , which can be high or low. There is a 16-bit time for each state, which contains the time to wait in microseconds. There is a 1-bit output, connected to PT0 . S 1 20 μs S 2 50 μs S 3 10 μs 0/1 1/0 0/0 1/1 0/0 1/0 The following program is supposed to im- plement this Mealy finite state machine. No- tice the sequence of actions performed by this controller is 1) wait, 2) read input, 3) perform output, and 4) go to next state. You may assume the Wait subroutine delays for the number of 250 ns cycles as specified in RegD . org \$ 4000 S1 nnn 80 20us wait fcb 1,0 outputs fdb S2,S3 next states S2 nnn 200 50us wait fcb 0,1 outputs fdb S3,S1 next states S3 nnn ppp 10us wait fcb 0,0 outputs fdb S1,S2 next states FSM lds #\$ 4000 stack bclr DDRM, #\$ 01 PM0 is input bset DDRT, #\$ 01 PT0 is output ldx # S1 State pointer run ldd 2,x+ wait value, inc pt jsr Wait ldab PTM Read input andb #\$ 01 B is 0 or 1 ldaa b,x Out value staa PTT do output lslb 2 bytes/addr abx add 0 or 2 ldx mmm ,x Next bra run org \$ FFFE fdb FSM reset vector What opcode or pseudo opcode should be placed in the nnn position? 1. fdb . correct 2. None of these choices is correct. 3. movb . 4. fcb . 5. movw . 6. rmb . Explanation: The wait times are 16-bit constants. 002 (part 2 of 4) 10 points What value should be placed in the mmm position? 1. 3 . 2. 2 . correct 3. 0 . 4. 4 . 5. 1 . 6. None of these choices is correct. Explanation: You need to add two to skip over the two output bytes. 003 (part 3 of 4) 10 points After running for a while with a constant input value of 0, what pattern of outputs will

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

View Full Document
Su, Andy – Homework 6 – Due: Oct 23 2007, 11:00 pm – Inst: Valvano 2 occur? 1. A repeating pattern of an output high for 50 us, followed by an output low for 30 us. correct 2. A constant high. 3. Cannot be determined from this informa- tion. 4. A constant low. 5. None of these choices is correct. 6. A repeating pattern of an output high for 20 us, followed by an output low for 60 us. Explanation: The FSM loops around clockwise S1 S2 S3 S1 S2... . State S1 makes the output high, and the 50us wait occurs in state S2 . 004 (part 4 of 4) 10 points What value should be placed in the ppp po- sition? 1. None of these choices is correct. 2. 80 . 3. 0 . 4. 40 . correct 5. 10 . 6. 20 . Explanation: 10us/250ns is 40.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}