Difference between revisions of "CSC270 Homework 8 2011"
(→Problem #1) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
---- | ---- | ||
− | <center> | + | <!--center> |
<font size="+2">Page under construction!</font> | <font size="+2">Page under construction!</font> | ||
<br \>[[File:UnderConstruction.jpg|300px]] | <br \>[[File:UnderConstruction.jpg|300px]] | ||
− | </center> | + | </center--> |
+ | |||
+ | <bluebox> | ||
+ | This assignment is concurrent with Monday 4/18's lecture. It is due on 4/25, during class. You may work on this assignment in groups of at most two people, and submit one assignment with two names. | ||
+ | </bluebox> | ||
=Problem #1= | =Problem #1= | ||
Line 14: | Line 18: | ||
;Question 1 | ;Question 1 | ||
− | :Looking at code we wrote, and assuming a very fast printer that absorbs the data bytes as fast as the computer can generate them, what is the maximum speed at which the computer can output bytes to the peripheral? | + | :Looking at code we wrote, and assuming a very fast printer that absorbs the data bytes as fast as the computer can generate them, what is the maximum speed at which the computer can output bytes to the peripheral? Express the answer in Bytes/sec, KiloBytes/sec, or MegaBytes/sec, whatever is appropriate. |
− | One way to go faster would be to have a sequencer, a finite-state machine, generate the Stobe signal and interact with the peripheral | + | One way to go faster would be to have a sequencer, a finite-state machine, generate the Stobe signal and interact with the peripheral listening to it ACK signal. |
+ | The figure below illustrate how the system would be organized. | ||
<center> | <center> | ||
[[Image:CSC270_6811_ParallelPort_With_FSM.png|500px]] | [[Image:CSC270_6811_ParallelPort_With_FSM.png|500px]] | ||
</center> | </center> | ||
+ | |||
+ | Here is the way the system would work: | ||
+ | # The 6811 picks a character to send to the device (printer) and stores it in the 8-bit register shown as "8 FFs" on the figure. An STAA instruction is used, and in its last cycle, the decoder activates a Yi output which does two things: it loads the character on the data-bus in the 8 flipflops, '''and it activates the preset of the D flipflop''', setting its Q output to 1. | ||
+ | # The Q output going to 1 is picked up by the FSM machine which switches state, and now activates the STB signal, indicating to the device that a new byte is available. | ||
+ | # The microprocessor now keeps on executing a LDAA instruction which allows a signal generated by the FSM to be loaded in the MSB of Acca. As long as this bit is 0, it means that the device handshake is not over. | ||
+ | # The FSM keeps STB high until it sees that the device raises ACK. As long as ACK is not high, the FSM stays in the same state. | ||
+ | # As soon as ACK goes high, the FSM switches state and turns STB down. | ||
+ | # The FSM keeps on waiting until the device drops ACK | ||
+ | # As soon as ACK goes back down, the FSM activates the signal to the 6811 to indicate that the transfer is over. | ||
+ | # At the same time it does so, it activates with another signal the '''CLR''' (clear) input of the flipflop with the NC clock and data inputs, resetting its Q output to 0. | ||
;Question 2 | ;Question 2 | ||
− | : | + | : Implement the FSM. Show its state diagram. Be careful that the FSM has 2 input signals, so that 4 arrows should leave every state. Figure out the number of states, the number of flipflops required to implement it, and the equations of the D inputs as a function of the Q outputs. What signal should we use for the clock signal? |
+ | |||
;Question 3 | ;Question 3 | ||
:How much faster can the 6811 send bytes to the device using this new design? | :How much faster can the 6811 send bytes to the device using this new design? | ||
<br /> | <br /> | ||
+ | ==Problem #2== | ||
+ | |||
+ | [[Image:CSC270_Eprom_die.jpg | right | 200px]] | ||
+ | Using the information from this [http://www.allaboutcircuits.com/vol_4/chpt_16/3.html site] (and/or other sources including Web sites you may find), explain how you would create a FSM for a traffic light (3 lights) where Green stays on for 10 seconds, yellow for 3 seconds, and Red for 8 seconds using the ROM-based sequencer. If the site is down, you can use this [[Media:ROMBasedSequencer.pdf| pdf copy]] instead. | ||
+ | ;Question 1 | ||
+ | : Show the contents of the EPROM and show the wiring of the EPROM to the register. | ||
+ | ===Optional and Extra-Credit=== | ||
+ | |||
+ | How would you modify your design so that a switch could be used by a user to make the FSM operate in one of two modes: in one mode it goes G-->Y-->R-->G, etc, and in the other mode it blinks the Red light on and off. On for 2 seconds, Off for 1 second. | ||
+ | |||
+ | ;Question 2 | ||
+ | : Show the wiring of the [http://en.wikipedia.org/wiki/EPROM EPROM] and clearly show how you would wire the switch to the ROM-based sequencer. Show the contents of the EPROM as well. | ||
<br /> | <br /> | ||
Latest revision as of 17:30, 18 April 2011
--D. Thiebaut 15:59, 13 April 2011 (EDT)
This assignment is concurrent with Monday 4/18's lecture. It is due on 4/25, during class. You may work on this assignment in groups of at most two people, and submit one assignment with two names.
Problem #1
We covered the Handshake Protocole in class, where the computer activates a signal called strobe (STB) and the peripheral responds with a signal called acknowledge (ACK).
We wrote a simple program corresponding to the 6811 sending the character 'A' to the peripheral (the printer).
- Question 1
- Looking at code we wrote, and assuming a very fast printer that absorbs the data bytes as fast as the computer can generate them, what is the maximum speed at which the computer can output bytes to the peripheral? Express the answer in Bytes/sec, KiloBytes/sec, or MegaBytes/sec, whatever is appropriate.
One way to go faster would be to have a sequencer, a finite-state machine, generate the Stobe signal and interact with the peripheral listening to it ACK signal.
The figure below illustrate how the system would be organized.
Here is the way the system would work:
- The 6811 picks a character to send to the device (printer) and stores it in the 8-bit register shown as "8 FFs" on the figure. An STAA instruction is used, and in its last cycle, the decoder activates a Yi output which does two things: it loads the character on the data-bus in the 8 flipflops, and it activates the preset of the D flipflop, setting its Q output to 1.
- The Q output going to 1 is picked up by the FSM machine which switches state, and now activates the STB signal, indicating to the device that a new byte is available.
- The microprocessor now keeps on executing a LDAA instruction which allows a signal generated by the FSM to be loaded in the MSB of Acca. As long as this bit is 0, it means that the device handshake is not over.
- The FSM keeps STB high until it sees that the device raises ACK. As long as ACK is not high, the FSM stays in the same state.
- As soon as ACK goes high, the FSM switches state and turns STB down.
- The FSM keeps on waiting until the device drops ACK
- As soon as ACK goes back down, the FSM activates the signal to the 6811 to indicate that the transfer is over.
- At the same time it does so, it activates with another signal the CLR (clear) input of the flipflop with the NC clock and data inputs, resetting its Q output to 0.
- Question 2
- Implement the FSM. Show its state diagram. Be careful that the FSM has 2 input signals, so that 4 arrows should leave every state. Figure out the number of states, the number of flipflops required to implement it, and the equations of the D inputs as a function of the Q outputs. What signal should we use for the clock signal?
- Question 3
- How much faster can the 6811 send bytes to the device using this new design?
Problem #2
Using the information from this site (and/or other sources including Web sites you may find), explain how you would create a FSM for a traffic light (3 lights) where Green stays on for 10 seconds, yellow for 3 seconds, and Red for 8 seconds using the ROM-based sequencer. If the site is down, you can use this pdf copy instead.
- Question 1
- Show the contents of the EPROM and show the wiring of the EPROM to the register.
Optional and Extra-Credit
How would you modify your design so that a switch could be used by a user to make the FSM operate in one of two modes: in one mode it goes G-->Y-->R-->G, etc, and in the other mode it blinks the Red light on and off. On for 2 seconds, Off for 1 second.
- Question 2
- Show the wiring of the EPROM and clearly show how you would wire the switch to the ROM-based sequencer. Show the contents of the EPROM as well.