CSC103 Homework 2 2017
--D. Thiebaut (talk) 10:47, 22 September 2017 (EDT)
This assignment is due on October 1st, at 11:55 p.m. You can work in pairs on this assignment, but if you do, you must submit screen captures that show both names (as you did in the lab). Both students in a pair must submit 2 screen captures and answer the multiple question on Moodle!
Contents
Problem 1: Logic Designing an Ice Cream Picker
Use the logic.ly/demo logic-design simulator to implement a circuit we will implant in the brain of our ice cream fetching robot.
Our robot has only one task in its robot life: go to the nearest convenience store and pick a pint of ice cream with the following characteristics:
- It must contain vanilla and some fruit
- It cannot contain lemon
- It does not contain any nuts
- It may or may not contain chocolate
We create 5 boolean variables: vanilla, fruit, lemon, nuts, and chocolate. The robot should pick a pint that makes the following expression True:
take_pint = ((vanilla and fruit) and ((not lemon) and (not nuts)) and (chocolate or (not chocolate) )
Assume that we find a pint of vanilla-chocolate with hazelnut swirl, the 5 boolean variables for this particular ice-cream would be:
- vanilla is true
- fruit is true
- lemon is false
- nuts is true
- chocolate is true
Substituting true or false for the different boolean variables we get this for take_pint:
take_pint = (( true and true ) and ((not false) and (not true)) and ( true or (not true )) = (( true ) and (( true ) and ( false ) and ( true or false )) = ( true and true and false and true ) = ( true and false ) = false
So our robot should not take that particular pint of ice cream.
Your Assignment
Translate the logic expression for take_pint into a logic diagram that you will wire-up on logic.ly/demo. Your design will be something like the image below, where I have blurred my solution design, but kept visible the input variables (all labeled) and the take_pint output. In my diagram I have set the variables vanilla, fruit, lemon, nuts and chocolate to the values used in the example above, and you see that the light bulb is off, indicating that the robot should not take the pint.
Make sure you add your name or names at as a label on your diagram, so that the screen captures will show who submitted the file.
The following submissions should be done on Moodle:
- Submit a screen capture of your design where you will have set vanilla ON, fruit ON, lemon OFF, nuts ON, and chocolate ON.
- Submit a second screen capture showing your full design, along with the light bulb when you set vanilla and chocolate ON, and the others OFF.
Problem 2: Mystery Circuit
Does the output of the circuit above behave the same as:
- a and b
- a or b
- (not a) and b
- a and (not b)
- not a
Answer this question on Moodle.
<showonlyafter after="20171005 12:00" before="20171231 00:00">
Solutions
Problem 1
Problem 2
The mystery output behaves the same as (a and b). </showonlyafter>