完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
船舶控制:1正车指令;2倒车指令;档位(3前进+1,4后退+1,5停止);控制指令:(6驾控,7集控,8机控);9紧急停车;10越控;11消音;12试验;一共12个按键,帮忙把下面程序改一下,谢谢谢谢。。。。。
LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.std_logic_arith.ALL; USE ieee.std_logic_unsigned.ALL; ENtiTY anjian IS PORT( pq:in std_logic_vector(1 to 12); clk:in std_logic; clr:in std_logic; aa: out std_logic_vector(7 downto 0) ); END anjian; ARCHITECTURE anjian_encoder OF anjian IS BEGIN PROCESS(clk,clr) BEGIN IF (clk'event and clk='1')THEN IF (clr='1' ) THEN aa<="00000000"; ELSE CASE pq IS WHEN "100010000000"=> aa <="00010001"; WHEN "100001000000"=> aa <="00010010"; WHEN "100000100000"=> aa <="00010011"; WHEN "100000010000"=> aa <="00010100"; WHEN "100000001000"=> aa <="00010101"; WHEN "100000000100"=> aa <="00010110"; WHEN "100000000010"=> aa <="00010111"; WHEN "100000000001"=> aa <="00011000"; WHEN "010010000000"=>aa<="00100001"; WHEN "010001000000"=>aa<="00100010"; WHEN "010000100000"=>aa<="00100011"; WHEN "010000010000"=>aa<="00100100"; WHEN "010000001000"=>aa<="00100101"; WHEN "010000000100"=>aa<="00100110"; WHEN "010000000010"=>aa<="00100111"; WHEN "010000000001"=>aa<="00101000"; WHEN "001010000000"=>aa<="00110001"; WHEN "001001000000"=>aa<="00110010"; WHEN "001000100000"=>aa<="00110011"; WHEN "001000010000"=>aa<="00110100"; WHEN "001000001000"=>aa<="00110101"; WHEN "001000000100"=>aa<="00110110"; WHEN "001000000010"=>aa<="00110111"; WHEN "001000000001"=>aa<="00111000"; WHEN "000110000000"=>aa<="01000001"; WHEN "000101000000"=>aa<="01000010"; WHEN "000100100000"=>aa<="01000011"; WHEN "000100010000"=>aa<="01000100"; WHEN "000100001000"=>aa<="01000101"; WHEN "000100000100"=>aa<="01000110"; WHEN "000100000010"=>aa<="01000111"; WHEN "000100000001"=>aa<="01001000"; WHEN "110010000000"=>aa<="01010001"; WHEN "001101000000"=>aa<="01010010"; WHEN OTHERS =>aa<="00000000"; END CASE; END IF; END IF; END PROCESS; END anjian_encoder; |
|
相关推荐
2个回答
|
|
这不是EDA吗,你发错地方了吧
|
|
|
|
FPGA的内容,以前玩过,现在太久没用,忘了
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
298 浏览 1 评论
《DNESP32S3使用指南-IDF版_V1.6》第二十六章 INFRARED_RECEPTION实验
309 浏览 0 评论
826 浏览 0 评论
求助一下关于51系列单片机的Timer0的计时问题,TH0、TL0+1的时间是怎么算的?
1911 浏览 2 评论
【RA-Eco-RA4E2-64PIN-V1.0开发板试用】开箱+Keil环境搭建+点灯+点亮OLED
1427 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
12031 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 02:53 , Processed in 0.494208 second(s), Total 71, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号