Difference between revisions of "CSC270 Final Exam 2011"

From dftwiki3
Jump to: navigation, search
(Arduino/Ubuntu CD)
 
(9 intermediate revisions by the same user not shown)
Line 13: Line 13:
 
<br />
 
<br />
  
<onlydft>
+
 
  
 
<!-- ========================================================== -->
 
<!-- ========================================================== -->
Line 33: Line 33:
 
Finally, you will need to make an appointment with your instructor to demonstrate how your circuit works.
 
Finally, you will need to make an appointment with your instructor to demonstrate how your circuit works.
  
<onlydft>
+
  
 
<bluebox>
 
<bluebox>
Line 58: Line 58:
  
 
A program and/or a logic diagram showing your solution are all that is needed to answer this question.  If you cannot come up with a satisfactory solution, explain what you think could be a solution.   
 
A program and/or a logic diagram showing your solution are all that is needed to answer this question.  If you cannot come up with a satisfactory solution, explain what you think could be a solution.   
 +
  
 
==Problem #3: Bidirectional Input AND Output port (1 point)==
 
==Problem #3: Bidirectional Input AND Output port (1 point)==
Line 134: Line 135:
  
 
===Reduced-Point options===
 
===Reduced-Point options===
* 1.5 points for demonstrating the error-free exchange of a nybble.
+
* 1 point for demonstrating the error-free exchange of a nybble.
* 1 point for demonstrating the error-free exchange of a bit.
+
* 0.5 points for demonstrating the error-free exchange of a bit.
  
 
<!-- ========================================================== -->
 
<!-- ========================================================== -->
Line 144: Line 145:
 
* State your assumptions.  If you find yourself missing information and need specific conditions, then set them up for yourself.  State what conditions under which you are answering the question.
 
* State your assumptions.  If you find yourself missing information and need specific conditions, then set them up for yourself.  State what conditions under which you are answering the question.
  
 +
==Arduino/Ubuntu CD==
 +
 +
In case you cannot install the Arduino IDE on your laptop, take one of the Arduino-Ubuntu DVDs in the Arduino plastic drawer (next to the window in FH143), put it in one of the laptops in FH143, and follow these steps
 +
# Turn the laptop on and put the DVD in it
 +
# restart it so that it can boot from the DVD.  Press F12 during this step to get the boot menu, and pick the DVD/CD-Rom
 +
# Ubuntu should start.
 +
# Pick "English" when prompted
 +
# Select "Try Ubuntu" when prompted
 +
# Wait 5 minutes for Ubuntu to load and show the Desktop.
 +
# Start a terminal (Application/Accessories/Terminal)
 +
# type<br /><tt> cd /root/arduino-0010/ </tt><br />
 +
# start the arduino IDE: <br /><tt> ./arduino</tt><br />
 +
# if prompted for a folder to store the sketches, pick the Desktop
 +
# Test it by loading the Blink sketch from File/Sketchbook/Examples/Digital/Blink
 +
# '''Important:''' Save the blink sketch to your Desktop (File/Save As)
 +
# In Tools/Serial Port, select '''/dev/ttyUSB0''' or something that looks close to that
 +
# In Tools/Board, select '''Diecimila'''
 +
# compile it
 +
# upload it to the Arduino.  It should work!
 +
<br />
 +
<br />
 +
:<font color="magenta">'''Important''': When you boot an Ubuntu live-CD on your laptop, Ubuntu takes over your RAM, and does not change anything on your hard disk.  So, when you save your sketch to file in Ubuntu, it saves it in RAM.  This means that when you turn off your laptop, everything in RAM disappears, including your sketch!  So save your sketch to a USB key or save it to a Web service of some kind (dropbox, gmail, your Novell directory, etc.)</font>
  
 
==Submission==
 
==Submission==
Line 151: Line 174:
 
Note that the printer in the administrative offices on the 2nd floor of FH can scan a page and email it to you.  Feel free to use this feature if you have hand-drawn drawings.   
 
Note that the printer in the administrative offices on the 2nd floor of FH can scan a page and email it to you.  Feel free to use this feature if you have hand-drawn drawings.   
  
</onlydft>
+
 
  
 
<br />
 
<br />

Latest revision as of 08:58, 28 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.





You will have to reserve a kit for one 4-hour time-period at a time. There is a shared Google-Doc sign-up sheet made available for this purpose: http://tinyurl.com/3jvy6qk

You cannot sign up for more than one session at a time. In other words, sign up for one session. If at the end of this session you need another session, then, and only then, do you sign up for the second session.


Finally, you will need to make an appointment with your instructor to demonstrate how your circuit works.


There are 4 problems, worth a maximum of 4 points total. 4/4 is A. However, the sum of all the points for all 4 problems is 5 points. Figure out how to best take advantage of this! Note that 5/4 is still A.


Problem #1: No 7442 chips (1 point)

This problem does not need wiring. Only a written answer is required.

Situation: You come to the lab ready to wire up your solution to a problem requiring you to implement a 3-bit output port for the 6811 and you discover that all the 7442 circuits have been taken away. You only have a limited time, and you cannot order or buy new ones. Your only solution is to use whatever is in the lab (FH143) to make your port work. Explain your solution to circumvent this unfortunate turn of events.

A logic diagram showing your solution is all that is needed to answer this question. If you cannot come up with a satisfactory solution, explain what you think could be a solution.


Problem #2: 1/2 second delay (1 point)

This problem does not need wiring. Only a written answer is required.

In a recent lab you had to design an output port and activate two LEDs in such a way that the LEDs would change state every second.

Explain how you would design a similar solution, but with a delay of 0.5 seconds. You can edit the software or modify the hardware, or both. If you want to modify the hardware, you can only use whatever can be found in FH143.

A program and/or a logic diagram showing your solution are all that is needed to answer this question. If you cannot come up with a satisfactory solution, explain what you think could be a solution.


Problem #3: Bidirectional Input AND Output port (1 point)

This problem does not need wiring. Only a written answer is required.

BidirectionalPort.png


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 used for input or for 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 assignment 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 hardware 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 D0 of Acca to 1
	STAA	8000	; set port as an output port
  • Then, if we want to output a high signal, we execute this code:
	LDAA	#01	; set  D0 of Acca to 1
	STAA	9000	; send Acca to output port
  • When we want to set the output signal low, we execute this code:
	LDAA	#00	; set D0 of Acca to 0
	STAA	9000  ; send Acca to output port

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 D0 of Acca to 0
	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 the bits except for the 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.


Problem #4: Analysis, Design, Wiring, Testing, Operation (2 points)

This problem requires wiring and demonstration of correct operation.

Create a digital electronic circuit that will allow the Heathkit to exchange one byte with the Arduino. You are free to pick the direction of the transfer. You are free to decide how to send the byte (serially or in parallel). You are free to create your own protocol.

When your circuit is wired up and working, you need to demonstrate its correct operation to your instructor. You will be asked to demonstrate the transfer of a particular byte. For example you may be asked "Show that 41 hex can be sent from one system to the other." You will then have to reprogram the sending system with 41, and restart it. Then, without changing anything in the receiving system, we will demonstrate that 41 has been correctly received. You are free to decide how to demonstrate this.

Assistance

You cannot ask anybody to help you debug the wiring. No debugging help from the instructor. The goal of this problem is for you to show that you can go from the formulation of a problem to a working hardware solution on your own.


Requirements

You do not need to write a report. The schematics of your circuit, nicely labeled (hand-drawings are fine), and the listing of the programs, well formatted, are necessary and sufficient.

Reduced-Point options

  • 1 point for demonstrating the error-free exchange of a nybble.
  • 0.5 points for demonstrating the error-free exchange of a bit.

Recommendations

  • State your assumptions. If you find yourself missing information and need specific conditions, then set them up for yourself. State what conditions under which you are answering the question.

Arduino/Ubuntu CD

In case you cannot install the Arduino IDE on your laptop, take one of the Arduino-Ubuntu DVDs in the Arduino plastic drawer (next to the window in FH143), put it in one of the laptops in FH143, and follow these steps

  1. Turn the laptop on and put the DVD in it
  2. restart it so that it can boot from the DVD. Press F12 during this step to get the boot menu, and pick the DVD/CD-Rom
  3. Ubuntu should start.
  4. Pick "English" when prompted
  5. Select "Try Ubuntu" when prompted
  6. Wait 5 minutes for Ubuntu to load and show the Desktop.
  7. Start a terminal (Application/Accessories/Terminal)
  8. type
    cd /root/arduino-0010/
  9. start the arduino IDE:
    ./arduino
  10. if prompted for a folder to store the sketches, pick the Desktop
  11. Test it by loading the Blink sketch from File/Sketchbook/Examples/Digital/Blink
  12. Important: Save the blink sketch to your Desktop (File/Save As)
  13. In Tools/Serial Port, select /dev/ttyUSB0 or something that looks close to that
  14. In Tools/Board, select Diecimila
  15. compile it
  16. upload it to the Arduino. It should work!



Important: When you boot an Ubuntu live-CD on your laptop, Ubuntu takes over your RAM, and does not change anything on your hard disk. So, when you save your sketch to file in Ubuntu, it saves it in RAM. This means that when you turn off your laptop, everything in RAM disappears, including your sketch! So save your sketch to a USB key or save it to a Web service of some kind (dropbox, gmail, your Novell directory, etc.)

Submission

Please submit a pdf with all your answers and email it to thiebaut@cs.smith.edu before the deadline. Write Final Exam in the subject line of the message. In case the Smith server is down, email it to your instructor's gmail address.

Note that the printer in the administrative offices on the 2nd floor of FH can scan a page and email it to you. Feel free to use this feature if you have hand-drawn drawings.