in Digital Logic closed by
1,463 views
1 vote
1 vote

A traffic signal cycles from RED to YELLOW, YELLOW to GREEN and GREEN to RED. In each cycle RED is turned for 100 seconds, YELLOW is turned for 40 seconds and GREEN is turned for 80 seconds. The traffic has to be implemented using FSM. The only input to this FSM is a clock of 10 second period. The minimum number of flip-flops required to implement this FSM is?

 


I know that this is asked earlier in GO but still I have doubt

My solution :

RED is turned for 100 sec , YELLOW is turned for 40 sec and GREEN is turned for 80 sec

CLK period  = 10 sec

 No of flip flop required to count  = 100 / 10 = 10  [ 4 flip flops]

No of flip flops required to count = 40 /10 = 4   [2 FF]

No of flip flops required to count  = 80 /10  = [3FF]

Now there are 3  states RED , GREEN , YELLOW

count is like that

sequence is like this

0 – > 1 – > 2 → 3- >4 → ...->9 – > 0 – > 1 → 2 – >3 ->0 >1 → ..->7

3 different states → no of flip flops required = 2

4+ 2  = 6 FF required

 

in Digital Logic closed by
by
1.5k views

4 Comments

My thought on this:

RED -100s
YELLOW-40s
GREEN-80s
Total 220s and each clock period is of 10s so 22 states have to be there.
We can encode binary bit pattern for each light.
00000-01001 (0-9 state) for RED i.e. when we get bit pattern from 00000-01001, RED led will turn on.
01010-01101 (10-13 state) for YELLOW
01110-10110 (14-21 state) for GREEN
And when state 10111 appears we can reset all the F/Fs (like we do in MOD-5 counter type problems)

Now if you ask how to light up the leds with them, I am guessing that the o/p lines can be fed to a decoder of 5x32. The 5 i/p lines of decoder will be connected to 5 o/p lines of 5 F/Fs. The 1st 22 o/p lines of decoder can be connected to respective colored LEDs like line 0-9 to RED led, 10-13 to YELLOW led and 14-21 to GREEN led.

4
4
Hmm got it
0
0
@minipanda bro supeerrrrrrb explaination
0
0