traffic light controller
TRANSCRIPT
Traffic light controller• There are four states–NG: north south green–NY: north south yellow– EG: east west green– EY: east west yellow
First take NC : no car on the way Take C :car on the wayThere are four inputs
(NC,NC)(NC,C)(C,NC)(C,C)
format(north south, east west)
• There are four outputs– North south green : east west red– North south yellow : east west red , yellow– North south red : east west green– North south red , yellow : east west yellow
State transitionState Input Next State Output
NG (-, NC) NG (G,R)
NG (-,C) NY (Y, R and Y)
NY (-,-) EG (R,G)
EG (NC,-) EG (R,G)
EG (C,-) EY (R and Y , Y)
EY (-,-) NG (G,R)
format(north south, east w
est)
State Input Nest state output
S S I I N N R Y G R Y G
0 0 - 0 0 0 0 0 1 1 0 0
0 0 - 1 0 1 0 1 0 1 1 0
0 1 - - 1 0 1 0 0 0 0 1
1 0 0 - 1 0 1 0 0 0 0 1
1 0 1 - 1 1 1 1 0 0 1 0
1 1 - - 0 0 0 0 1 1 0 0
0 1 0 1 S0 S1 1 1 1
1 1 1 1
1 1 1 1
S0 S1
I 0 I 101 1000 11
00
01
11
10
1 1
1 1
S0 S1
I 0 I 101 1000 11
00
01
11
10
Ns0
Ns1
=
..
1 1 1 1
1 1 1 1
S0 S1
I 0 I 101 1000 11
00
01
11
10
1 1
1 1
S0 S1
I 0 I 101 1000 11
00
01
11
10
R
Y
𝑅=𝑠1
𝑦=𝑠0 .𝑠1. 𝐼 1+¿ 𝑠0 . 𝑠1 . 𝐼0¿
1 1
1 1 1 1
S0 S1
I 0 I 101 1000 11
00
01
11
10
1 1 1 1
1 1 1 1
S0 S1
I 0 I 101 1000 11
00
01
11
10
G
R1
.+.
𝑅1=¿ 𝑠0⊕𝑠1¿
1 1
1 1
S0 S1
I 0 I 101 1100 10
00
01
10
11
1 1 1 1
1 1
S0 S1
I 0 I 101 1000 11
00
01
11
10
Y1
G1
𝑌 1=𝑠0 .𝑠1 . 𝐼 1+¿ 𝑠0 . 𝑠1 . 𝐼0¿
.+.