hw6 solutions - Su, Andy Homework 6 Due: Oct 23 2007, 11:00...

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

View Full Document Right Arrow Icon
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 – fnd all choices beFore answering. The due time is Central time. Homework 6 001 (part 1 oF 4) 10 points The Following fgure shows Mealy fnite 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 fnite 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 specifed 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/26/2009 for the course EE 302 taught by Professor Mccann during the Fall '06 term at University of Texas at Austin.

Page1 / 7

hw6 solutions - Su, Andy Homework 6 Due: Oct 23 2007, 11:00...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online