P1.2.6 Random Number Generator
P1.2.6 Random Number Generator
In this activity you will use the Circuit Design Software (CDS) to build and test the
complete analog section of the Random Number Generator design.
Equipment
Circuit Design Software (CDS)
Procedure
Shown below is the analog section of the Random Number Generator.
To fix these issues, we must make two simple changes to the circuit. First, replace the
push button switch with an SPST switch. Second, change the 100 f capacitor to 50 f.
These changes are shown below. Also shown are the oscilloscope connections
(highlighted).
1. Using the Circuit Design Software (CDS), enter the modified analog section of
the Random Number Generator shown. Replace the picture above with your
version once finished. Remember to use different color wires to differentiate
each signal. (power, ground, oscilloscope channels)
3. Open the oscilloscope tool and adjust the scale of the time base and channels so
that the three signals are easy to see and measure (see below).
5. After the first few square waves are observed on the output signal, open the
switch. Let the simulation run until the output signal stops oscillating. When the
oscillation stops, stop the simulation. This may take a few minutes.
6. Adjust the oscilloscope to display the third or fourth square wave of the output
signal. Using the oscilloscope’s markers, measure the period of this signal. Use
this data to calculate the frequency. Record your result in the table.
Conclusion
1. When you press the push button of the Random Number Generator, the 555 Timer
oscillates at approximately 65 Hz. If you want the oscillation to start at 100Hz, what
value would you apply to C2?
T = 1/f = 1/100Hz = .01seconds
T = 0.693(RA + 2RB)C
C = T / .693(RA + 2RB)
C = (.01Seconds)/((.693)(10000 ohms + 36000 ohms)))
C = 313 nF
2. The values of R9 & C1 determine the time from when the push button is released to
when the oscillation stops. If you wanted to lengthen this time period, what changes
would you make to one or both of these components? Explain.
Increase the resistance because the lower the current is, the longer time the capacitor
takes to charge. You could also increase the capacitance because then it also takes longer
to charge.
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.
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 5 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 000 and 111 make sense?
Does it matter?
Yes
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.
CLOCK A B C
Initial Values 0 0 1
1st Cycle 1 0 1
2nd Cycle 0 1 1
3rd Cycle 1 0 0
4th Cycle 0 1 0
5th Cycle 1 1 0
6st Cycle 0 0 1
7th Cycle 1 0 1
b) Is the counter counting as expected (see below)? If not, check your circuit to
make sure that it was built correctly. Make any necessary corrections and
repeat steps (a) and (b).
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.
e) Observe the outputs A, B, and C. They should be cycling through the following
pattern:
f) Is the counter counting as expected? If 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 Part 1
and steps (1) and (2) enter the circuit shown below into the Circuit Design
Software (CDS).
b) Link to your multisim file in OneDrive (make sure it is properly shared with
me):
Link: 1.2.6 (3).msjs
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? If 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
4. 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?
The clock signal triggers when it changes from low to high.
Combinational logic is basically what do you want to occur and sequential logic is based on
when you want to do something.