完善资料让更多小伙伴认识你,还能领取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的内容,以前玩过,现在太久没用,忘了
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
嵌入式学习-飞凌嵌入式ElfBoard ELF 1板卡-LCD显示图片编程示例之介绍mmap
551 浏览 0 评论
《DNESP32S3使用指南-IDF版_V1.6》第二章 常用的C语言知识点
910 浏览 0 评论
【RA-Eco-RA2E1-48PIN-V1.0开发板试用】(第三篇)ADC采集+PWM输出
575 浏览 0 评论
《DNK210使用指南 -CanMV版 V1.0》第四十五章 人脸识别实验
572 浏览 0 评论
1221 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
11769 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 18:28 , Processed in 0.579446 second(s), Total 75, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号