$29
Lab dates and times:
Section 1:
10.10.2020 Saturday
Even (08:30-10:00), Odd
(10:00-11:30)
Section 2:
10.10.2020 Saturday
Even (15:30-17:00), Odd
(17:00-18:30)
Section 3:
11.10.2020 Sunday
Odd (15:30-17:00), Even (17:00-18:30)
Section 4:
09.10.2020 Friday
Even (08:30-10:00), Odd
(10:00-11:30)
Section 5:
05.10.2020 Monday
Odd (13:30-15:00), Even (15:00-16:30)
Section 6:
06.10.2020 Tuesday
Even (13:30-15:00), Odd
(15:00-16:30)
Location: EA Z04 (in the EA building, straight ahead past the elevators)
Each student should attend the time block depending on their student id. A student with student id 22050977 from section 4 should attend lab at 10:00 am on Friday for example.
Preliminary Work (30 pts)
(You should do this part before coming to lab).
Physical gates are built out of transistors, and require physical signals that use correct voltage levels for inputs and produce physical signals with correct voltage levels for outputs. To work correctly, the transistor circuits that comprise a gate must have connections to a voltage supply and to ground. For example, in the case of 74-series logic circuits used in this lab, the supply voltage (Vcc) must be 5 volts. In these integrated circuit packages, several gates are contained. Search Google specifying that gate number and its function (e.g. "7486 XOR gate") for pin connection diagrams, such as the pin diagram shown in Figure 1. You must have the pin diagrams for each gate you want to use, in order to do the following tasks. You can find pinout of rest of 74-series gates here: http://www.qsl.net/on7pc/datasheet/ttl7400/7400family.pdf. Other gates you need today are: 7408 quad 2-input AND gate, 7432 quad 2-input OR gate, and 7404 six INVERTER.
Figure 1: 7486 Quad 2-input XOR gates
First, read the document posted in Moodle: “Circuit Schematic versus Logic Diagram”. Then, using the logic diagram of Half Adder in Figure 2, draw a circuit schematic of the digital circuit you will
1
build. This should include pin numbers marked on the inputs and outputs of all the gates, part numbers (IC’s code) of the IC package marked on each gate, plus power and ground connections marked on the side of the drawing. After that, draw the circuit schematics for Half Subtractor shown in Figure 3 and Lab Calculator given in Figure 4. Upload your schematics to Moodle as a pdf file before your lab session starts. Late submissions won’t be accepted. You are advised to draw using tools like draw.io, but you are allowed to draw by hand and then scan/take a photo, as long as it is readable.
Figure 2: Half Adder
Figure 3: Half Subtractor
Control Input
Function
Function
Output
Output
C
Y
Z
0
A + B
Half Adder
Sum (S)
Carry Out (Co)
1
A – B
Half Subtractor
Difference (D)
Borrow out (Bo)
2
Figure 4: Lab Calculator
Recommendations
In CS223 labs, you build circuits by ICs and later by FPGA. It is better to obey some simple rules to avoid damaging electronic parts or confusing yourself with debugging your circuit.
• Avoid touching IC or FPGA pins directly by your hand. Static electricity of your body can damage them permanently.
• The white board which you setup your circuit on it, is called “breadboard”. Search in internet and find out how its pins are connected internally.
• Postpone connecting power pins (Vcc and ground) to last step. Check circuit connections and if everything seems ok then connect power pins.
• For easier debugging of circuits, always follow a wire color convention. For example, always use black or white wire for ground and red wire for Vcc.
• If LED’s light is weak, or if the IC’s package is very hot (you can touch plastic part) you have a problem in the power pin connections (short circuit, connecting Vcc wire to ground pin, etc).
Part 1: Building Half Adder & Subtractor (40 pts)
(1) Ask the TA or Tutor to come and check your schematics. Do not proceed to the next step until you have verified that your circuit schematics are correct, and the TA or Tutor has approved them.
(2) Using your circuit schematics for half adder and half subtractor, build the circuits step-by-step, following the Digital Circuit Suggestions document given in Moodle and recommendations above. Connect the inputs to switches on the logic board. Connect the outputs of your logic circuits to LEDs on the logic board. Don't forget to connect VCC power and GND ground to the VCC and GND pins of IC packages.
(3) Make a test probe by connecting another LED on the logic board to one end of a long wire, whose other end will be used to touch circuit points and “see” the logic values. A full voltage level ~5 V will cause the LED to shine brightly; a 0 V level will not light up the LED. A low light output from the LED means that the voltage being sensed is in between logic 0 and logic 1, meaning something is WRONG with your circuit.
(4) Now draw the truth tables for the 2-input 2-output logic circuits that you have made and fill in the left-hand (input) side in standard binary counting order. For each row, apply the input combinations by adjusting the switches, and measure the output. Use this information to complete the truth table, filling in the right-hand (output) side.
3
(5) Compare your measured truth tables that you obtained from the circuits, with the ones given below. If there are no discrepancies, then it means that your logic circuits have worked as predicted. Ask the TA or Tutor to come and verify this. When the TA or Tutor has checked your circuits, you are done with this part.
Figure 5: Truth table of a half adder Figure 6: Truth table of a half subtractor
Part 2: Building Lab Calculator (30 pts)
(1) Ask the TA or Tutor to come and check your schematic for the lab calculator. Do not proceed to the next step until you have verified that your circuit schematic is correct, and the TA or Tutor has approved it.
(2) Using your circuit schematic, build the circuit following the Digital Circuit Suggestions given in Moodle. Connect the inputs to switches on the logic board. Connect the outputs of your logic circuit to LEDs on the logic board. Don't forget to connect VCC power and GND ground to the VCC and GND pins of IC packages.
(3) As you did in Part 1, test and verify that your built circuit is working correctly as a calculator that produces the outputs of a half adder or half subtractor depending on the value of C input. Compare your measured truth table with the one given below. If there are no discrepancies, then it means that your logic circuit is working correctly, ask the TA or Tutor to come and verify this. When the TA or Tutor has checked your circuit, you are done with this part.
C
A
B
Y
Z
0
0
0
0
0
0
0
1
1
0
0
1
0
1
0
0
1
1
0
1
1
0
0
0
0
1
0
1
1
1
1
1
0
1
0
1
1
1
0
0
Figure 7: Truth table of the Lab Calculator
Clean Up
(1) Clean up your lab station, and return all the parts, wires, the Beti trainer board, etc. Leave your lab workstation for others the way you would like to find it.
(2) CONGRATULATIONS! You are finished with Lab #1 and are one step closer to becoming a computer engineer.
LAB POLICIES
1. There are three computers in each row in the lab. Don’t use middle computers, unless you are allowed by lab coordinator.
4
2. You borrow a lab-board containing the development board, connectors, etc. in the beginning. The lab coordinator takes your signature. When you are done, return it to his/her, otherwise you will be responsible and lose points.
3. Each lab-board has a number. You must always use the same board throughout the semester.
4. You must be in the lab, working on the lab, from the time lab starts until you finish and leave. (bathroom and snack breaks are the exception to this rule). Absence from the lab, at any time, is counted as absence from the whole lab that day.
5. No cell phone usage during lab. Tell friends not to call during the lab hours--you are busy learning how digital circuits work !
6. Internet usage is permitted only to lab-related technical sites. No Facebook, Twitter, email, news, video games, etc--you are busy learning how digital circuits work !
7. If you come to lab later than 20 minutes, you will lose that session completely.
8. When you are done, DO NOT return IC parts into the IC boxes where you’ve taken them first.
Just put them inside your Lab-board box. Lab coordinator will check and return them later.
5