Uploaded by zalak0

Al-Aker - Demo 1 (1)

advertisement
Demo 1 - State Machines and Johnson counters
MTRX1705 - Introduction to Mechatronic Design
Authors name: Zahi Al-Aker
SID: 530478294
Introduction
This lab report is a review of how to make a biased coin toss using a Johnson counter and
555-timer producing a clock signal. The report is split up into 2 parts, one for the 3-bit Johnson
Counter in Lab 5 Part 3 and the other is the week 7 demonstration
For the week 7 demonstration the bias used for the coin is 25% Heads and 75% Tails, as per
my Student ID number in the beginning. Note that all resistors used in this lab report other than
whats mentioned are 1k ohm resistors.
Section 1: Clock Signal
1
The above circuit is the clock signal used for Lab 5 Part 3, with an LED connected from pin 3 to
ground to visually demonstrate the function of the clock signal and serves as a test-point for if
the clock signal is functioning or not. RA and RB resistor values were found using calculations
which are evident in the book to get a 1Hz signal and were the values used to demonstrate Lab
5 Part 3.
1
𝑇
=
0. 693𝑓 =
1
0.693(π‘…π‘Ž + 2𝑅𝑏)𝐢
1
(π‘…π‘Ž + 2𝑅𝑏)𝐢
π‘Žπ‘  𝑓 = 1/𝑇
−6
𝐿𝑒𝑑 𝑓 = 1 π‘Žπ‘›π‘‘ 𝐢 = 100 * 10
0. 693 =
1
−6
(π‘…π‘Ž + 2𝑅𝑏)*100*10
π‘…π‘Ž + 2𝑅𝑏 = 14430Ω
Therefore, we can let Rb = 7k ohm using a potentiometer (can be measured using a multimeter
and Ra equal to a 470 ohm resistor to get an approximate 1Hz value.
1
Taken from the 555m datasheet provided in the week 3 module.
For the demo, the same clock signal is used except there is a button connected from Vcc to the
left hand side of the circuit (i.e. before pin 4). The characteristic of the LED will be such that
when the button is open, the LED will pass directly from Vcc, through the LED and then to
ground, hence making the LED stay turned on. When the button is pressed, the LED will
oscillate between a logic HIGH and logic LOW at a certain frequency, turning ON and OFF.2
Section 2 : Lab 5 Part 3
Section 2.1 : Next State Logic Diagrams (Lab 5)
For Q0*
For Q1*
For Q2*
Section 2.2: State memory diagram
2
The demonstration requires that the ‘coin toss’ be random, hence the clock signal will be at a high
frequency. As a result, after a certain frequency, the LED will remain on even after pressing the button, as
the clock signal acts as a makeshift AC signal.
Section 2.3: Output logic diagram
Section 2.4: State transition table and diagram (Lab 5)
QoQ1Q2
State*
Q0*Q1*Q2*
A
000
B
001
B
001
C
011
C
011
D
111
D
111
E
110
E
110
F
100
F
100
A
000
X
X
X
X
X
X
X
X
Section 2.5 Karnaugh map (Lab 5)
Section 2.6: Final Product
Section 2.7: Questions
1) Did This Process Yield the same structure as the Johnson Counter?
Yes, as in a Johnson Counter, the inputs of Q0, Q1 and Q2 are all connected within the state
memory and between flip flops. As a result, Q0* = Q1 and Q1* = Q2. As for Q2*, the feedback
loop suggests that Q2*’ = Q0, hence Q2 = Q0’ which exactly aligns with the values gotten in the
karnaugh map above
2) What does this teach us?
It teaches us that Karnaugh maps are extremely useful tools in building simple and efficient
state machines from scratch.
Section 3 : Week 6/7 Demo
Section 3.1: State transition table (Demo)
Assigning states
QoQ1Q2
H/T
?
State*
Q0*Q1*Q2*
A
000
H
B
001
B
001
H
C
011
C
011
T
D
010
D
010
T
E
110
E
110
T
F
111
F
111
T
G
101
G
101
T
H
100
H
100
T
A
000
3
State Machine
7-Segment inputs
Qo
Q1
Q2
H/T?
Q0*
Q1*
Q2*
a
b
c
d
e
f
g
0
0
0
H
0
0
1
1
1
0
1
0
0
0
0
0
1
H
0
1
1
1
1
0
1
0
0
0
0
1
0
T
1
1
0
1
1
1
1
0
0
1
0
1
1
T
0
1
0
1
1
1
1
0
0
1
1
0
0
T
0
0
0
1
1
1
1
0
0
1
1
0
1
T
1
0
0
1
1
1
1
0
0
1
1
1
0
T
1
1
1
1
1
1
1
0
0
1
1
1
1
T
1
0
1
1
1
1
1
0
0
1
3
For the 7-seg, we will be using a common anode input, hence when the signal is low, the light turns on
Section 3.2 Karnaugh map for Next State Logic (Demo)
Section 3.3 Next State Logic (Demo)
4
4
Since we are given a 74LS00 (Quad NAND gate IC) and a 74LS14 (Hex inverter with schmitt triggers),
the diagrams presented in this lab report will use NOT and NAND gates ONLY. This is possible by using
De Morgan’s theorem.
Section 3.4 State memory (Demo)
Section 3.5 Output Logic Circuit (Demo)
By Inspection:
H = Q0’Q1’
T = Q0 + Q1
We can use either H or T to create an output logic circuit and will change based on certain
states, but in this case, for easier use, we will use the ‘H’ expression as when H is on, we want
the light to be on.
Section 3.6 - Planning out physical model (combining modular circuits)
5
5
The top diagram covers a smaller space than the bottom one as I am using a smaller breadboard with a
larger one.
For the larger breadboard
Section 3.7 - Final Product
Download