完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL; ENtiTY traffic_control IS PORT( clk :IN STD_LOGIC; c1,c2,c3:OUT STD_LOGIC; w1,w2,w3:IN STD_LOGIC; r1,r2 :OUT STD_LOGIC; y1,y2 :OUT STD_LOGIC; g1,g2 :OUT STD_LOGIC; reset :IN STD_LOGIC); END traffic_control; ARCHITECTURE a OF traffic_control IS TYPE STATE_SPACE IS(S0,S1,S2,S3); SIGNAL state:STATE_SPACE; BEGIN PROCESS(clk) BEGIN IF reset='1' THEN state<= S0; ELSIF(clk'EVENT AND clk='1') THEN CASE state IS WHEN S0=> IF w1='1' THEN state<=S1; END IF; WHEN S1=> IF w2='1' THEN state<=S2; END IF; WHEN S2=> IF w3='1' THEN state<=S3; END IF; WHEN S3=> IF w2='1' THEN state<=S0; END IF; END CASE; END IF; END PROCESS; c1<='1' WHEN state=S0 ELSE '0'; c2<='1' WHEN state=S1 OR state=S3 ELSE '0'; c3<='1' WHEN state=S2 ELSE '0'; r1<='1' WHEN state=S1 OR state=S0 ELSE '0'; y1<='1' WHEN state=S3 ELSE '0'; g1<='1' WHEN state=S2 ELSE '0'; r2<='1' WHEN state=S2 OR state=S3 ELSE '0'; y2<='1' WHEN state=S1 ELSE '0'; g2<='1' WHEN state=S0 ELSE '0'; END a; Error (10500): VHDL syntax error at traffic_control.vhd(15) near text "SIGNALÂ"; expecting "begin", or a declaration statement Error (10500): VHDL syntax error at traffic_control.vhd(17) near text "Â"; expecting "begin", or a declaration statement Error: Quartus II 64-Bit Create Symbol File was unsuccessful. 2 errors, 0 warnings |
|
相关推荐
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1726 浏览 1 评论
1473 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
1686 浏览 0 评论
943 浏览 0 评论
2469 浏览 0 评论
1516 浏览 38 评论
5728 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 18:09 , Processed in 0.584002 second(s), Total 72, Slave 53 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号