Reputation: 227
The initial problem starts like this. There are 6 states. At each state when w=1 move to the next state, when w=0 then stay at the current state. At each state display a number using a standard 7 led display (BCD). Those numbers are 8 -> 1 -> 9 -> 4 -> 2 -> 2.
So here is my attempt at this problem. I start with a state table: From left to right y2,y1,y0
w=0 w=1 a b c d e f g
000|000 001 1 1 1 1 1 1 1
001|001 010 0 1 1 0 0 0 0
010|010 011 1 1 1 1 0 1 1
011|011 100 0 1 1 0 0 1 1
100|100 101 1 1 0 1 1 0 1
101|101 000 1 1 0 1 1 0 1
Then Yo Y1 & Y2 equations are made using karnaugh maps
y1.y0 _ _
w.y2 00 01 11 10 Y0 = w.y0 + w.y0
00 0 1 1 0
01 0 1 d d
11 1 0 d d
10 1 0 0 1
y1.y0 _ _ _ _
w.y2 00 01 11 10 Y1 = w.y1 + w.y2.y1.y0 + w.y1.y0
00 0 0 1 1
01 0 0 d d
11 0 0 d d
10 0 1 0 1
y1.y0 _ _ _ _
w.y2 00 01 11 10 Y2 = w.y2 + y2.y1.y0 + w.y1.y0
00 0 0 0 0
01 1 1 d d
11 1 0 d d
10 0 0 1 0
Then the outputs need addition maps created.
Y1.Y0 _ _
Y2 00 01 11 10 a = Y2 + Y0.Y2
0 1 0 0 1
1 1 1 d d
Y1.Y0
Y2 00 01 11 10 b = 1
0 1 1 1 1
1 1 1 d d
Y1.Y0 _
Y2 00 01 11 10 c = Y2
0 1 1 1 1
1 0 0 d d
Y1.Y0 _ _
Y2 00 01 11 10 d = Y2 + Y0.Y2
0 1 0 0 1
1 1 1 d d
Y1.Y0 _ _ _
Y2 00 01 11 10 e = Y2 + Y0.Y1.Y2
0 1 0 0 0
1 1 1 d d
Y1.Y0 _ _
Y2 00 01 11 10 f = Y2.Y0 + Y1
0 1 0 1 1
1 0 0 d d
Y1.Y0 _ _
Y2 00 01 11 10 g = Y1 + Y2 + Y1.Y0
0 1 0 1 1
1 1 1 d d
Currently I am using a 3 bit D flip flop counter to create the 6 inputs.
The display shows.
_ _ _
|_| | |_| |_| |
|_| | _| | |_ _
Is there a mistake with the logic or is it possible that the counter could be creating this problem?
Upvotes: 5
Views: 875
Reputation: 531
As I understand, your state machine has 6 states? And in last two states the same digit need to be displayed?
I think it is possible to made it with T flip-flops.
1) Connect each output of T flip-flop to input of next, three flip-flops needed to hold 6 states.
2) You need the "reset circuit" that resets all triggers when combination on outputs is equal to 110 (6). So, the output on w=1 of T flip-flops will be next: 000 w 001 w 010 w 011 w 100 w 101 w 110->000* w 001 etc (*reset moves flip-flops to init state). This is the first function: RST.
3) You need to create an encoder do convert codes from 0 to 5 to 7 signals to LED display.
So, the biuilt ruth table will looks like next:
#TABLE: t3,t2,t1 => a,b,c,d,e,f,g,RST
000 => 11111110
001 => 01100000
010 => 11110110
011 => 01100110
100 => 11011010
101 => 11011010
110 => 00000001
111 => 00000000
Create 8 K-Maps and minimize them, or use any other minimization method. I got this results:
a = t3 !t2 | !t3 !t1;
b = !t3 | t3 !t2;
c = !t3;
d = t3 !t2 | !t3 !t1;
e = !t2 !t1 | t3 !t2;
f = !t3 t2 | !t3 !t1;
g = !t3 t2 | t3 !t2 | !t3 !t1;
RST = t3 t2 !t1;
Upvotes: 0
Reputation: 227
Typing out the entire question again assisted myself in figuring out the part that was done wrong.
The problem was in the Y2 Karnaugh Map.
By looking at the outputs I was able to see which pins were not working and trace them back to the source of the error.
Upvotes: 1