GK-12 Sensors!
Portable Module
Title: Digital Logic and Its Relevance in Digital
Electronics
Author: Ali Shareef
Discipline: Computer Science, Computer
Engineering, Electrical Engineering
Introduction
As the world becomes more and more computer dependent,
it is no longer acceptable to remain ignorant of the fundamentals
of digital electronics. Those who grasp at least the rudimentary
workings of their PCs, PDAs, cell-phones, and other such equipment
will be better able to utilize these machines in their day-to-day
lives.
Objective
Students will learn the basics of digital logic
and gain an intuition of digital electronics.
Foreword
Digital electronics incorporates many different aspects
of mathematics and electronic theory. It may not be reasonable to
expect the students to gain such an understanding in a 1 week or
even a 1 month period. Nevertheless, it is possible to help them
to gain this understanding through presentations and experiments
over a longer period of time.
The following lectures and exercises should be implemented
in the given order, to help build the foundation for understand digital
electronics.
Session1: How Processors Compile
and Execute Programs
(See PowerPoint Presentation "Survey
of Program Compilation and Execution.")
Prerequisites: Students should already know
how to program. They can compile and execute programs, preferably
in C++.
Duration: 1 Day
Introduction:
It is amazing how you can press the power button on
a computer and once it boots up you can do all sorts of cool stuff.
However, when you open up the computer you really can’t tell
how it all works. This module will attempt to reveal some of the
mysteries of the inner workings of a computer. Since this module
is geared towards a computer science class, a program in C++ will
be compiled and the resulting opcode instructions will be examined.
(This module is intended to be used as an introduction
to digital electronics. The Number Systems, Basics of Electronics
Circuit, Introduction to Digital Logic, and The Ultimate 2-Bit Binary
Adder Circuit module can be used in conjunction with this module
to explain digital electronics.)
Objectives:
Students gain an intuition into how computers compile and execute
programs.
Associated Maine Learning Results
Mathematics
A. NUMBERS AND NUMBER SENSE
B. COMPUTATION
Science and Technology
J. INQUIRY AND PROBLEM SOLVING
K. SCIENTIFIC REASONING
Required Equipment:
- Laptop or computer
- Visual Studio 6. 0 or above
- Overhead projector for laptop or computer
Procedure
-
The PowerPoint presentation will familiarize
students with the main components of a computer such as the
memory and the processor.
-
The slides will then describe how the source
code the students write will be translated into a form that
the processor can understand. The program Prog1Demo.cpp
associated with this session should be executed in Visual Studio
in the debugging
mode on the projector so that the students can see
the program execute.
-
Set a breakpoint anywhere in the program.
-
Select the “Build” menu, Select
“Start Debug” option and then click on “Go.”
-
The program will begin to execute. The
program will stop a the breakpoint selected.
-
Go to the “View” menu, select
“Debug Windows”, and click on “Disassembly.”
-
The source code plus the assembly code is
shown in the source window.
-
Describe to the students how each line of
code is translated to the assembly code.
-
Show how the registers are being used by
the program.
-
You can open up the Intel document “ 25366618_InstrSet”
that describes the instruction set of the Pentium 4 processor
and you can explain how the assembly instructions map to
the hexadecimal number opcode values.
- The slides then compare the pros and cons of programming in
a high level language like C++ and assembly.
- Give the quiz.
- Go over the quiz.
Session 2: Number Systems
(See PowerPoint Presentation "Number
Systems.")
Prerequisites: None
Duration: 2-3 Days
Introduction:
This module will give students an intuition of how
number systems work. The students will see how something that they
take for granted took centuries to evolve and refine. The highly
efficient counting methods in use today were not available to people
of bygone ages. Many of the mathematical concepts developed in the
last millennium would not have been possible without the number
system in use today. An efficient number system such as the one
in use today allows ideas to progress beyond the numbers themselves.
This can be seen how the wieldy and cumbersome number systems developed
by people throughout history was an impediment to their mathematical
progress. A number system must be transparent otherwise it will
lead to a stagnation of mathematical thought.
Objectives:
Students will learn how the present number system functions and
the beauty in its efficiency and simplicity.
Associated Maine Learning Results
Mathematics
A. NUMBERS AND NUMBER SENSE
B. COMPUTATION
Science and Technology
J. INQUIRY AND PROBLEM SOLVING
K. SCIENTIFIC REASONING
Required Equipment:
- Laptop or computer
- Overhead projector for laptop or computer
- PowerPoint Presentation: "Number
Systems"
Procedure:
- This session will begin with discussing how the number system
has evolved in human history. It discusses the different number
systems used by different civilizations.
- The slides then describe the base 10 number system.
- The slides then describe the base 8 number system.
- The slides present the base 16 number system.
- The slides then present base 2—binary system.
(It is important to follow this progression because
it allows students time to adjust their thinking. Also be sure
to distribute the file Base_Chart
and the Conversion_Notes
among the students. This will help them to see how the different
numbering systems compare.)
- The slides then discuss methods for converting numbers between
bases. There are two methods to be used, depending upon whether
the base that you are moving to is a larger or smaller base system
than the base you are moving from.
- Show the students the file “People”
for comic relief. See how many students get the joke.
- Give the students the quiz.
- Discuss the quiz.
Note: It is important to
go through this material slowly and to be patient with the students.
It can easily take 2-3 days before students fully grasp the concept
of number systems. It is important to work out examples on the overhead
projector at every step of the way. Call on a student and have them
“assist” you as you work out the conversions or enumerate
the base numerals.
Session 3: Experiment - Basics of
Electronics Circuits
(See PowerPoint presentation "Electronics
Theory.")
Prerequisites: Basic Chemistry
Duration: 3-4 Days
Introduction:
This module will expose students to the theory and
applications of electronics. This module can be used in conjunction
with the GK-12 Sensors! Breadboarding
Lab by Erik McCarthy. Erik’s module provides more
circuit building exercises. This module contains a PowerPoint presentation
that can be used to fully explain the theory behind electronics.
However, it should be noted that this module is geared toward preparing
students for building digital circuits. As a result, only series
circuits are discussed here. Erik’s module is more focused
on circuit theory and as a result discusses a wider range of circuit
topics such as parallel circuits and equivalent resistance.
Objectives:
- Students grasp the electronics theory that gives rise to electronics.
- Students understand the concepts of Current, Voltage, and Resistance.
- Students use breadboards to build circuits.
Associated Maine Learning Results:
Mathematics
B. COMPUTATION
1) Use various techniques to approximate solutions,
determine the reasonableness of answers, and justify the results.
F. MEASUREMENT
1) Use measurement tools and units appropriately
and recognize limitations in the precision of the measurement tools.
H. ALGEBRA CONCEPTS
3) Formulate and solve equations and inequalities.
4) Analyze and explain situations using symbolic representations.
Science and Technology
E. STRUCTURE OF MATTER
1) Trace the development of models of the atom to
the present and describe how each model reflects the scientific
understanding of their time.
5) Describe how atoms are joined by chemical bonding.
6) Compare the physical and chemical characteristics of elements.
H. ENERGY
7) Use mathematics to describe and predict electrical
and magnetic activity (e.g., current, resistance, voltage).
8) Compare and contrast how conductors, semiconductors, and superconductors
work and describe their present and potential uses.
J. INQUIRY AND PROBLEM SOLVING
1) Make accurate observations using appropriate
tools and units of measure.
2) Verify, evaluate, and use results in a purposeful way. This includes
analyzing and interpreting data, making predictions based on observed
patterns, testing solutions against the original problem conditions,
and formulating additional questions.
6) Discover relationships and patterns.
K. SCIENTIFIC REASONING
3) Develop generalizations based on observations.
Required Equipment:
- Laptop or computer
- Overhead projector for laptop or computer
- Breadboards
- Batteries/Power supplies for breadboards
- LEDs
- Heavy gauge wire for breadboards
- Multi-meters
Procedure:
Days 1-2
- Present the PowerPoint slides associated with this module.
(The slides contain lots of information; draw pictures to help
describe what is going on.)
- Ask students questions, some may already know enough to be
able to describe some of these concepts.
- Talk about safe use of electricity.
- Dangers of taking electrical appliances into showers, bath-tubs,
swimming pools.
- Discuss how electrical current passing through the body
may impede the electrical signal controlling the heart and
lead to cardiac arrest.
- Discuss how current passing through muscle tissue causes
the muscle to “flex/clench.” Tell students that
during an electrical shock where a person has “grabbed”
on to an “electrically–live” object, he
will not be able to release the object.
- Tell the students not to build anything that requires power
from the wall socket until they know how to do so properly.
- Discuss safe use of batteries, i.e. do not plug them in
backward, they can explode.
- Discuss safe use of transformers during the lab, i.e. do
not place the connector in one’s mouth, avoid touching
the connector to wet skin, and with metallic object.
- Discuss a news story where the victim dies a horrible death
due to electrocution because of unsafe practices. (Look one
up on the internet. There are plenty.)
- This discussion should take the entire class period.
Days 3-4
- Break up the class in groups of 2-3 students each. In a classroom
setting, have the students form a circle with their desks. The
instructor can be in the middle of this circle and easily assist
and monitor all the groups quickly. In a lab setting with lab
tables, this may be difficult.
- The instructor should build a circuit on a breadboard and have
the student follow along. Explain why the connections that are
made are made.
- Show the students how to use the multi-meters to measure resistance
and voltage.
- Have the students complete Lab1
of this module.
- Assist the students.
- When all the students are finished with the Lab1, go over the
lab and explain the expected results and discuss the last question.
Expected Results:
- This module should familiarize the students with electronics
theory.
- They should be able to use a multi-meter.
- They should be able to build circuits using the breadboard.S
- They should understand the relationship between voltage, current,
and resistance.
Note of Caution: Students
will try to connect the LED to directly to the battery. This will
damage the LED. Monitor students as build the circuit so that they
do not do this.
Session 4: Introduction to Digital
Logic
Prerequisites: Basics of Electronic Circuits
module, Number Systems module
Duration: 4-5 Days
Introduction:
This module will expose students to the theory of
digital electronics. This module should be used in preparation of
the module for building the 2- bit adder circuit. This module will
present the theory behind digital electronics and enable the students
to experiment with the logic gates.
Objectives:
- Students grasp the logic theory that gives rise to digital electronics.
- Students use breadboards to build digital circuits.
Associated Maine Learning Results:
Mathematics
A. NUMBERS AND NUMBER SENSE
1) Describe the structure of the real number system
and identify its appropriate applications and limitations.
B. COMPUTATION
2) Explain operations with number systems other
than base ten. G. PATTERNS, RELATIONS, FUNCTIONS
2) Translate and solve a real-life problem using
symbolic language. H. ALGEBRA CONCEPTS
4) Analyze and explain situations using symbolic
representations. K. MATHEMATICAL COMMUNICATION
1) Restate, create, and use definitions in mathematics
to express understanding, classify figures, and determine the
truth of a proposition or argument.
Science and Technology
J. INQUIRY AND PROBLEM SOLVING
2) Verify, evaluate, and use results in a purposeful
way. This includes analyzing and interpreting data, making predictions
based on observed patterns, testing solutions against the original
problem conditions, and formulating additional questions.
4) Design and construct a device to perform a specific function,
then redesign for improvement (e.g., performance, cost).
K. SCIENTIFIC REASONING
3) Develop generalizations based on observations.
5) Produce inductive and deductive arguments to support conjecture.
Required Equipment:
Procedure:
Days 1-2
- Students learn best when they interact directly with the material
to be covered. Print out enough copies of the "Introduction
to Digital Electronics" and "GK-12
Sensors! Breadboard Tips and Techniques for Digital Circuit Construction"
handouts for every student in the class.
- During the class, have the students read aloud from the "Introduction
to Digital Electronics" handout . In order to move the reader
around the room as quickly as possible, have every other student
read a paragraph out loud. Since the reader is moved quickly around
the room, the students will be more attentive. Once the reader
has moved around the class, the students who were skipped can
read now.
- Work out the examples in the handout with the students.
- Ask students to complete the exercises.
Days 3-4
- Have the class form groups of 2-3 students each. In a classroom
setting, have the students form a circle with their desks. The
instructor can be in the middle of this circle and easily assist
and monitor all the groups quickly. In a lab setting with lab
tables, this may be difficult.
- Plug the extension cord in to a wall socket and connect it to
the power strip. Place the power strip in the circle of the tables
so that all the groups can plug their power transformers can be
connected easily.
- In addition, you can use the power switch on the power strip
to control when the students have power and when they don’t.
- Assign a Digital Electronic Kit to each group.
- Show the students how to connect the dip switch and the resistor
network pack. Make sure that every one has wired this properly,
otherwise this will cause many problems later. Check this document
for more information on proper setup.
- Show the students how to connect an Inverter gate properly.
E.g. power, ground, inputs, and outputs. Use inputs from the dip
switch and connect an LED to the output. Show them how when a
logic “1” or true is entered on the dip switch, a
logic “0” or false is outputted.
- Have the students learn how to wire up the AND, OR, and XOR
gates.
- Use the dip-switch to input logic values to the circuit and
use an LED to display the results of the logic operation.
Day 5
- Form the groups of the day before.
- The students should now know how to hook up the logic gates
properly. Have them complete a Digital
Electronics Lab Worksheet.
Expected Results:
- This module should familiarize students with digital electronics
theory.
- Students should be able to connect logic gates properly.
- Students should be able to translate a logic statement to a
logic diagram and then a logic circuit.
- Students should be able to build logic circuits using the logic
gates.
Notes of Caution:
- Expect to be busy debugging circuits.
Students may wire their circuits incorrectly.
- Note to GK-12 Sensors! Fellows:
The logic gates require 5V power and input. However, the transformer
in the GK-12 Sensors! Electronics Kit outputs an unregulated 8V.
The voltage changes as more and more current is drawn from the
transformer. In order to provide for the 5V use the modified power-connector/voltage
regulator part. The power-connector for the transformer and the
voltage regulator have been hot glued together such that when
it is plugged in to the breadboard, only 5 Volts appears on the
breadboard. Use this part.
- If the power and ground on the logic
gates are switched or
are connected to the input/output pins directly, the logic gate
may “burn up.” In order to prevent this, have students
build their circuits and then inspect them. After making sure
that they are properly wired, okay students to power them up.
Session 5: The Ultimate 2-Bit Binary
Adder Circuit
Prerequisites: Basics of Electronic Circuits
module, Number Systems module,
Introduction to Digital Logic module
Duration: 3-4 Days
Introduction:
This module will help students to grasp how computer and digital
electronics operate. This module should be presented after the two
previous modules associated with digital electronics. In this module
students will be given a circuit diagram for a 2-bit adder and they
are to implement it on the bread-board. This module assumes that
the students have a good grasp of reading logic circuit diagrams
and they are able to build circuits from those diagrams. This will
be a very long module to cover, so be sure that you have enough
time to work on it. The recommendeded way of completing this module
is on consecutive days so that students do not forget the material
between intervening days.
Objectives:
- Students gain an intuition on how computers/digital electronics
work.
- Students be able to read and implement a logic circuit diagram.
Associated Maine Learning Results:
Mathematics
A. NUMBERS AND NUMBER SENSE
1) Describe the structure of the real number system
and identify its appropriate applications and limitations.
B. COMPUTATION
2) Explain operations with number systems other
than base ten.
G. PATTERNS, RELATIONS, FUNCTIONS
2) Translate and solve a real-life problem using
symbolic language.
H. ALGEBRA CONCEPTS
3) Formulate and solve equations and inequalities.
4) Analyze and explain situations using symbolic representations.
K. MATHEMATICAL COMMUNICATION
1) Restate, create, and use definitions in mathematics
to express understanding, classify figures, and determine the
truth of a proposition or argument.
Science and Technology
J. INQUIRY AND PROBLEM SOLVING
2) Verify, evaluate, and use results in a purposeful
way. This includes analyzing and interpreting data, making predictions
based on observed patterns, testing solutions against the original
problem conditions, and formulating additional questions. K.
SCIENTIFIC REASONING
5) Produce inductive and deductive arguments to
support conjecture.
Required Equipment:
Procedure:
Day 1
- Review the material in the Introduction
to Digital Electronics
handout with students, specifically focusing on the adder circuit
discussed at the end of the handout.
- Review the Ripple
Adder handout. Work thorough the exercises.
Days 2-3
- Break up the class in groups of 2-3 students each. In a classroom
setting, have the students form a circle with their desks. The
instructor can be in the middle of this circle and easily assist
and monitor all the groups quickly. In a lab setting with lab
tables, this may be difficult.
- Plug the extension cord in to a wall socket and connect it to
the power strip. Place the power strip in the circle of the tables
so that all the groups can plug their power transformers can be
connected easily.
- In addition, you can use the power switch on the power strip
to control when the students have power and when they don’t.
- Assign a Digital Electronic Kit to each group.
- The students should know how to wire the dip switch and the
resistor network pack. See the Introduction to Digital Logic module.
- Give each group of students a copy of Ripple
Adder 2 handout
and tell them to implement the adder circuit.
Day 4
- The adder circuits of those groups of students who have gotten
it to work can be connected together to form a much larger adder
circuit. Each group of student only builds a 2-bit adder, however,
if four or five groups get their circuits working, then an eight
or ten bit adder can be built. An eight bit adder circuit can
adder two numbers ranging from 0 – 255.
- The adder circuits can be connected together by connecting the
Carry out lines from the last adder to the Carry in lines of the
first adder of another group’s circuit.
- Use only one power supply. All the ground and power lines need
to be connected together.
- Compute the sum of two numbers on the adder circuit.
- Work out the sum on an overhead projector or the board and
show the students that the adder circuit outputs the correct result.
Show the sum operation in both binary and decimal.
Expected Results:
- Once this module is completed the students should have an intuition
of how computers/digital systems operate.
- If the Program Compilation and Execution module was also used
in this class, then mention how program statements are compiled
into opcode which can be represented as binary numbers and executed
on processors.
- They should be able to connect logic gates properly to form
an adder circuit.
- They should be able to explain the working of the adder circuit
and how the sum and the carry values are generated.
Notes of Caution:
- Expect to be busy debugging circuits.
Students may wire up their circuits incorrectly.
- Note to GK-12 Sensors!
Fellows: The logic gates require
5V power and input. However, the transformer in the GK-12 Electronics
Kit outputs an unregulated 8V. The voltage changes as more and
more current is drawn from the transformer. In order to provide
for the 5V use the modified power-connector/voltage regulator
part. The power-connector for the transformer and the voltage
regulator have been hot glued together such that when it is plugged
in to the breadboard, only 5 Volts appears on the breadboard.
Use this part.
- If the power and ground on the logic
gates are switched or are connected to the input/output pins directly,
the logic gate may “burn up.” In order to prevent
this, have the students build their circuit and then inspect it.
After making sure that it is properly wired, allow them to power
it up.
- Each chip contains more than one logic
gate. The logic gates on the same chip can be used for the same
adder. However, for ease of wiring and debugging use separate
sets of chips for each adder.
- The complexity of the circuit being
built may make it difficult to debug a circuit during class. Some
students may have obvious problems which can be solved quickly,
however, there will be students who will have non-obvious problems
with their circuits. At the end of the day take all those circuits
that do not work home and debug them. There will not be enough
time to debug every circuit during the class.
Example of a circuit implementation:
The two adder circuits are separated. The first adder is on the
left and the second adder on the right. The red wires are used to
feed the Carry Out of the first adder to the second adder.
|