File

advertisement
Project 1.2.7 Understanding Digital Design:
The Random Number Generator
Introduction
The Random Number Generator will be your first exposure to a fully developed circuit design
that includes an analog section, a digital combinational logic section, and a digital sequential
logic section. Combinational logic and sequential logic are the basic building blocks of all
digital electronics and the topics of study for the majority of this course.
In this activity you will use the Circuit Design Software (CDS) to build and test the complete
digital logic section of the Random Number Generator design.
Equipment
Circuit Design Software (CDS)
Procedure
Since we learned how the digital electronics of the Random Number Generator worked by
analyzing its sequential and combinational logic sections separately, we will construct and
simulate the device the same way. We will begin with the combinational logic section.
1. Using the Circuit Design Software (CDS), enter the combinational logic section of the
Random Number Generator shown below. For testing purposes connect three
switches for the inputs A, B, and C.
Combinational Logic Section – Board Game Counter
© 2014 Project Lead The Way, Inc.
Digital Electronics Project 1.2.7 Understanding Digital Design: Random Number Generator – Page 1
a. Start the simulation.
b. Toggle the switches and complete the truth table shown below.
A
B
C
L1
L2
L3
L4
L5
L6
L7
0
0
0
0
0
1
0
1
0
0
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
1
0
1
0
0
0
1
1
1
0
0
1
0
0
1
1
0
0
1
0
1
0
1
0
1
1
0
1
1
0
1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
c. Did the outputs for the inputs 001 thru 110 display what was expected?YES If
they didn’t, check your circuit to make sure that it was built correctly. Make any
necessary corrections and repeat steps (a) and (b).
d. Did the outputs for the inputs 000 and 111 make sense? No
Does it matter?
No
2. Now that the combinational logic section is working, let’s construct and simulate the
sequential logic section. Using the Circuit Design Software (CDS), enter the sequential
logic section of the Random Number Generator shown below. For the initial analysis,
we will use a switch to generate the signal CLOCK.
© 2014 Project Lead The Way, Inc.
Digital Electronics Project 1.2.7 Understanding Digital Design: Random Number Generator – Page 2
X1
X2
2.5 V
X3
2.5 V
2.5 V
VCC
5V
4
10
U1A
~1PR
VCC
2
4
U1B
~2PR
1Q
5
12
~1Q
6
11
1D
U2A
~1PR
2Q
9
2
~2Q
8
3
2D
1Q
5
~1Q
6
1D
5V
S1
3
1CLK
2CLK
~1CLR
1
~2CLR
74LS74N
13
1CLK
~1CLR
74LS74N
1
74LS74N
Key = Space
GND
U3A
U4A
74LS04N
74LS08N
U4B
74LS08N
Sequential Logic Section – Random Number Generator
Start the simulation.
a) Cycle the input CLOCK several times until the initial value is 001. Cycle the
input CLOCK and record the value of the outputs A, B, and C in the table
shown below. (Remember 1 Cycle = 2 Toggles of the switch)
CLOCK
A
B
C
Initial Values
0
0
1
1st Cycle
0
1
0
2nd Cycle
0
1
1
3rd Cycle
1
0
0
4th Cycle
1
0
1
5th Cycle
1
1
0
6st Cycle
0
0
1
7th Cycle
0
1
0
b) Is the counter counting as expected (see below)? YESIf not, check your circuit
to make sure that it was built correctly. Make any necessary corrections and
repeat steps (a) and (b).
© 2014 Project Lead The Way, Inc.
Digital Electronics Project 1.2.7 Understanding Digital Design: Random Number Generator – Page 3
c) Modify the circuit by replacing the input switch with a CLOCK_VOLTAGE set to
5 volts, 50% duty cycle @ 50 Hz (see below). The CLOCK_VOLTAGE will
continuously toggle the input, causing the output to repeatedly cycle through the
count 001 to 110.
Sequential Logic Section – Random Number Generator
d) Start the simulation.
e) Observe the outputs A, B, and C. They should be cycling through the following
pattern:
f) Is the counter counting as expected? YESIf not, check your circuit to make sure
that it was built correctly.
Make any necessary corrections and repeat steps (e) and (f).
3. Finally, let’s connect the combinational and sequential logic sections together to
complete the Random Number Generator.
a) Using the combinational logic and sequential logic sections created in steps (1)
and (2) enter the circuit shown below into the Circuit Design Software (CDS).
© 2014 Project Lead The Way, Inc.
Digital Electronics Project 1.2.7 Understanding Digital Design: Random Number Generator – Page 4
X1
X2
2.5 V
X3
2.5 V
2.5 V
VCC
5V
4
10
U1A
~1PR
2
V1
3
1CLK
5
12
~1Q
6
11
~1CLR
50 Hz
5V
1
4
U1B
~2PR
1Q
1D
2CLK
9
2
~2Q
8
3
1D
1Q
1CLK
~2CLR
~1Q
5
6
~1CLR
13
74LS74N
U2A
~1PR
2Q
2D
1
74LS74N
GND
74LS74N
U3A
U4A
74LS04N
74LS08N
U4B
74LS08N
U5
U10
R3
U8
U14
180Ω
74LS32N
R5
180Ω
74LS08N
GND
GND
U11
U15
R2
U7
R6
U13
180Ω
74LS08N
180Ω
R4
GND
180Ω
GND
U16
U9
74LS04N
U6
74LS32N
R7
U12
180Ω
R1
180Ω
GND
GND
GND
Combinational & Sequential Logic Section – Random Number Generator
© 2014 Project Lead The Way, Inc.
Digital Electronics Project 1.2.7 Understanding Digital Design: Random Number Generator – Page 5
b) Start the simulation.
c) Observe the outputs L1, L2, L3, L4, L5, L6, and L7. They should be cycling
through the following pattern:
d) Are the outputs working as expected? YESIf they are not, check your circuit to
make sure that it was built correctly. Make any necessary corrections and
repeat steps (b) and (c).
Conclusion
1. The combinational logic used in the Random Number Generator was AOI logic. What
are three gates that are used to implement AOI logic?
Not Gate
And Gate
Or Gate
2. On the 74LS74 D flip-flop, the CLK input has a small triangle. The PR (preset) and
CLR (clear) inputs have a circle. What do these symbols mean?
Triangle means input and circles mean output
3. What is the primary characteristic that differentiates combinational and sequential
logic?
Sequential Logic has a state while combinational logic does not
© 2014 Project Lead The Way, Inc.
Digital Electronics Project 1.2.7 Understanding Digital Design: Random Number Generator – Page 6
Download