1 Introduction (No Marks)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Lab 01

• Monday Sections: September 13, 2021


• Tuesday Sections: September 14, 2021
• Wednesday Sections: September 15, 2021
• Thursday Sections: September 16, 2021
• Friday Sections: September 17, 2021

1 Introduction (no marks)


The labs in CPSC 121 have a standard marking scheme. All labs are out
of 10. Two of the marks are for the pre-lab, which you are required to
complete before coming to lab. Five marks are for the items marked TODO
in red - so, if you complete the pre-lab and the basic lab activities, you will
get 70%. To get 90%, there is a Further Analysis question, denoted with
TODO (further analysis) and a survey to complete at the end of the lab.
The final mark is for returning the Magic Box in proper conditions.
For full credit on further analysis questions, you are required to give
a thoughtful, detailed response to your TAs. If you are having difficulty
coming up with the correct response, ask your TAs for guidance. You can
additionally get a bonus mark for the Challenge Problem. Be sure to get
checked off by a TA for all TODO items.

2 Icebreaker (1 mark)
When you arrive at the lab, your TAs will lead an icebreaker activity so that
you can get to know your labmates. This will help you find a partner for
the lab. The labs are meant to be done in pairs; you may change your lab
partner in subsequent weeks if you choose.
TODO 1 Completing the activity is worth one mark. Once you have
found a partner, your TA will give you a Magic Box for you to do the rest of
the lab.

1
3 Wiring a Gate (1 mark)
Upon getting your Magic Box kit from your TA, you will want to place your
circuit board (the green one) beside the bread board (the white one). Let’s
start with looking closely at the breadboard. You’ll notice that it has symbols
on the edge: + - a b c d e f g h i j + -.
The breadboard is divided into three parts:

1. two long columns; these run the length of the breadboard and have the
blue and red lines

2. the central grid, which is sandwiched in between those two long columns

In the central grid, the columns are labeled by a letter, and the rows are
numbered; every 5th row has its number beside it. This allows us to refer to
specific holes on the grid, like 5e in the picture.

In the central grid, all the holes in each row are connected, stopping at
the divide in the centre (it’s called "the gutter"). So, if we connect something
to 5b, and something else to 5a, those two things will be connected through
the breadboard. But, 5h will not be connected to either of them.

The two "rails", the columns between the red and blue lines, work differ-
ently. They are connected down the columns. We can see this if we strip the
layering underneath the breadboard, and look at it upside down:

2
Now, let’s start the wiring:

1. It is convention that rails are used for power (5 Volts) and ground.
Power and ground work as HIGH and LOW in our physical circuits,
and like TRUE and FALSE in logic. Every logic gate needs these to
work, so we always start wiring by connecting our rails to the circuit
board. Red is always used for power, and black is always used
for ground. Do not use these colours for anything else! Following
this convention will make it easier for you and your TAs to see that
you have properly powered and grounded your chip, especially as your
circuits become more complex. Your TAs will deduct 1 mark if
you do not follow this convention.

3
2. Since the two sides are independent of each other, we then
connect them. Now the two blue rails are grounded, and the two red
rails are powered:

3. Next, we want to wire an OR gate. To do so, find the integrated


circuit (IC) with the label 74LS32 on the second line of the
chip. Before wiring any IC for the first time, look it up in the User’s

4
Manual to find out how to wire it. Get out a copy of the User’s Manual
now, and find the entry for the Quad 2-Input OR Gate.
You can use the pdf version of the manual on Canvas. The entry will
look like this:

4. In the User’s Manual, we see that pin 14 needs to be connected to


power, pin 7 to ground, and that the chip contains four OR gates. We
will be using the upper right hand one. Next, we will find the physical
chip. The 74LS32 chip looks like this:

5
5. We want to place it so that the notch is on the left. From there, we
want to power and ground the chip. Almost all ICs take power to
the top left pin and ground to the lower right pin, but always check
the User’s Manual first! A powered 74LS32 chip will look like this:

6. We have powered the chip with a small red wire, and grounded it with
a small black wire. The colour of the wires is used so that other
people can look at the circuit and immediately see that we are
powering and grounding. This is especially useful when debugging
circuits.
Our next task is to add inputs to our circuit. We will control the
OR gate using the switches near the bottom left corner of the circuit
board. Connect the first wire (in this case a green one) from a
switch to the first input of the OR gate (pin 13 on the chip).
The choice of colour for these wires is open to anything other than
red and black. Connect a second wire (in this case an orange
one) from a switch to the second input of the OR gate (pin
12 on the chip). Refer to the User’s Manual for where these inputs
are located on the chips.
A note about switches and corresponding values: If the top half
of the switch is pressed down, the circuit is closed and the switch is in
the ON position. This corresponds to a value of 1, or TRUE. Likewise,

6
if the bottom half is pressed down, the circuit is open and the switch
is in the OFF position, corresponding to 0 or FALSE.

7. But how can we tell what we are inputting to this gate? If we also
connect those two pins to two LEDs (the lights on the Magic
Box), we can see whether each of these inputs is on or off.

7
8. Now, we also want to see the output of our OR gate. The output of
the gate comes out at pin 11. Connect a wire from pin 11 to a
third LED (as with the yellow wire in the photo below). Now we can
turn on The Magic Box.

9. We see the LEDs illuminate. When a light is on, its value is TRUE;
if it is off, then it is FALSE. If we then turn the switches that we
have connected on and off, we can observe the truth table for the OR
gate by looking at the lights. TODO 2 Try this now, and fill in the
table on a piece of paper:

10. Once you are done this, turn off the Magic Box.

8
4 The Clock (1 mark)
1. Switches are not the only input we have available. In this section, we
will see the "clock output" can be as used as an input to a circuit as
well. First, we must find an inverter, or NOT gate, which has
the label 74LS04. We must also look it up in the User’s Manual to
understand how to wire it:

2. Once you have found this chip, place it in the breadboard with
the notch on the left. Then, add power and ground wires.

9
3. Now, we want to add the input to our inverter. We will use the clock
input, which comes from the switches on the right side of the board. It
looks like this:

4. Turn switches 1 and 2 to OPEN, and switches 3 and 4 to


CLOSED, like above. This creates an electrical wave of 0.7 Hz. The
last three of the connectors, circled in purple above, connect to that
0.7 Hz wave. We will connect one of them to the input of the inverter,
which is pin 13 of the chip.

10
5. Let’s see this wave in action before we do any more wiring. Connect
the input (pin 13) of the NOT chip to an LED. We then turn
on the Magic Box and watch the light go on and off:

6. Turning the Magic Box back off, connect the output of the inverter
to an LED. This is at the pin directly to the right of the input. Here,
we connected a yellow wire from the output to the rightmost LED.

11
7. Turning the Magic Box back on, we now have the two LEDs on the
right flashing on an alternate cycle. TODO 3 Show your circuit to
your TA.

5 Your Own Circuit (2 marks)


Now that you know how to wire ICs, and how to use the clock output to get
electrical waves, you can start wiring on your own. TODO 4 Create your
own pattern of flashing LEDs on your Magic Box, using at least four LEDs.
There are two marks for this: one for the basic wiring of the LEDs; one for
creating a creative way for the lights to flash. As you do this, you are free
to disconnect any, or all, of the wires you had connected in the previous two
sections.

6 Further Analysis Question (1 mark)


We like to finish each lab by having you reflect on what you’ve seen and done,
and to have you think a bit further about it. For full credit, a thoughtful,
detailed response is required. If you are having difficulty coming up with
the correct response, ask your TAs for guidance.

12
The questions are fairly open ended, so you are free to focus on particular
components of each question, and partial credit may be available.
TODO 5 (further analysis) Think back to that 74LS32 (OR) chip
you checked the truth table for. Do you think it behaves exactly like the
mathematical OR gates you’ve seen in class? Why or why not? If not, what
are some differences between the physical chip and the mathematical model?
Hint: What acts the input and output for each model?

7 Survey (1 mark)
TODO 6 To help us improve these labs both this term and for future offer-
ings, complete the survey here1 . After you submit your survey, you will get
a confirmation page; show that to your TA.

8 Magic Box Cleanup (1 mark)


TODO 7 Before leaving the lab, show your Magic Box to your TA..

9 Challenge Problem (Bonus Marks)


All labs contain a challenge problem. It is recommended that you attempt
it if you have time left after completing the rest of the lab. Thorough and
systematic attempts, whether successful or not, will be rewarded with a bonus
mark.
TODO 8 (challenge) Have a look at the LS175 chip, which the User’s
Manual refers to as a memory chip. Read the manual entry and try to get it
working on your breadboard. Connect it to some switches, your clock output,
and some LEDs, and investigate the chip’s behaviour. What do you think it
does?

1
https://goo.gl/forms/gWpe4ASNvylpbUBB2

13

You might also like