Difference between revisions of "CSC270 Final Exam 2011"
Line 34: | Line 34: | ||
<onlydft> | <onlydft> | ||
− | ==Problem #1: No 7442 chips (0. | + | There are 4 problems, worth a maximum of 4 points total. |
+ | |||
+ | ==Problem #1: No 7442 chips (0.7 points)== | ||
This problem does not need wiring. Only a paper answer is required. | This problem does not need wiring. Only a paper answer is required. | ||
Line 41: | Line 43: | ||
− | ==Problem #2: 1/2 second delay (0. | + | ==Problem #2: 1/2 second delay (0.7 points)== |
This problem does not need wiring. Only a paper answer is required. | This problem does not need wiring. Only a paper answer is required. | ||
Line 49: | Line 51: | ||
Explain how you would design a similar solution, but when the delay is now 0.5 seconds. You can use whatever is available in FH143. | Explain how you would design a similar solution, but when the delay is now 0.5 seconds. You can use whatever is available in FH143. | ||
− | ==Problem #3: Input AND Output port== | + | ==Problem #3: Input AND Output port (0.7 points)== |
<center>[[Image:BidirectionalPort.png|400px]]</center> | <center>[[Image:BidirectionalPort.png|400px]]</center> | ||
+ | |||
+ | <br /> | ||
+ | You may have noticed that the Arduino has a very nice way to deal with digital inputs and outputs. A pin on one of the connectors can be an input or an output. The same wire going into the connector can be used as an output wire or an input wire. | ||
+ | |||
+ | You have to figure out how to create the same kind of flexibility for the 6811 system. Your part is to figure out what hides under the big question mark in the diagram above. | ||
+ | |||
+ | Below is an explanation of how the software interacts with the software to make this bi-directional port works. | ||
+ | |||
+ | ===An output port=== | ||
+ | |||
+ | Assume we want to use the wire linking the box with the question mark and the peripheral as an output signal. | ||
+ | |||
+ | In other word we want to send a bit from the computer to the peripheral through our port. | ||
+ | |||
+ | * The first thing that needs to be done is for the program controlling the data exchange to make our port an '''output port'''. This is done by writing a 1 at Address 8000: | ||
+ | |||
+ | LDAA #01 ; set output port in output mode | ||
+ | STAA 8000 ; set port as an output port | ||
+ | |||
+ | * Then, we we want to the output signal high, we execute this code: | ||
+ | |||
+ | LDAA #01 ; set the output signal high | ||
+ | STAA 9000 | ||
+ | |||
+ | * When we want to set the output signal low, we execute this code: | ||
+ | |||
+ | LDAA #00 ; set the output signal low | ||
+ | STAA 9000 | ||
+ | |||
+ | ===An input port=== | ||
+ | |||
+ | Assume that we now want the signal connecting the peripheral to the question-mark box to be an input signal for the 6811. | ||
+ | |||
+ | * Our program would need to initialize the port as an input port first: | ||
+ | |||
+ | LDAA #00 ; set output port in input mode | ||
+ | STAA 8000 ; set port as an input port | ||
+ | |||
+ | * When we want to read the value of the data bit sent by the peripheral, we can execute this: | ||
+ | |||
+ | LDAA 9000 ; get data from port | ||
+ | ANDA #01 ; clear all bits except LSB | ||
+ | |||
+ | :Now the bit that is coming from the peripheral is in the Least-Significant bit of Acca. | ||
+ | |||
+ | ===Your assignment=== | ||
+ | |||
+ | Draw the schematics of the circuit in the box with a question mark. No explanations required, unless you feel you need to explain how your circuit works. | ||
Revision as of 16:45, 25 April 2011
--D. Thiebaut 10:24, 13 April 2011 (EDT)
This final exam is take-home. It is open-books, open-notes, and open-Web. It is due a week after it is made available, at 4:00 p.m. on Wed. May 4, 2011.
You cannot discuss the details of this exam with anyone except your instructor. No question will be answered in person after 2:30 a.m. on 4/29/11. Instead, if you have questions regarding the exam, you are to send them via email to thiebaut@cs.smith.edu, and the question and its answer will be broadcast back to the hole class via email.
The exam is given under the rules of the Smith College Honor Code.
Make sure you reference all work/resources you use to answer the questions below.