完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
library ieee;
use ieee.std_logic_1164.all ; use ieee.std_logic_unsigned.all ; entity li is port (clk ,j ,en ,d ,c ,b ,a :in std_logic ;r1 ,r2 :out std_logic) ; end ; architecture behave of li is signal cq ,k ,mo :std_logic_vector (16 downto 0) ; signal cao1 ,cao2 :std_logic ; signal instruction :std_logic_vector (3 downto 0) ; begin instruction <= d &c &b &a ; with instruction select mo <="00000000000000111"when"0001", "00000000000001111"when"0010", "00000000000011111"when"0011", "00000000000111111"when"0100", "00000000001111111"when"0101", "00000000011111111"when"0110", "00000000111111111"when"0111", "00000001111111111"when"1000", "00000011111111111"when"1001", "00000111111111111"when"1010", "00001111111111111"when"1011", "00011111111111111"when"1100", "00111111111111111"when"1101", "01111111111111111"when"1110", "11111111111111111"when"1111", "00000000000000111"when others ; process (clk ,en ,j ,k ,cq) begin if clk'event and clk = '1'then k <= mo ; if en = '1'then if j = '0'then if cq < k then cq <= cq + 1 ; else cq <= ( (others = > '0') ; end if ; else if cq > 0 then cq <= cq - 1 ; else cq <= k ; end if ; end if ; else cq <= ( (others = > '0') ; end if ; end if ; end process ; process (en ,j ,cq ,k) begin if en = '1'then if j = '0'then if cq = k then cao1 <= '1'; else cao1 <= '0'; end if ; cao2 <= '0'; else if cq ="00000000000000000"then cao2 <= '1'; else cao2 <= '0'; end if ; cao1 <= '0'; end if ; else cao1 <= '0';cao2 <= '0'; end if ; end process ; r1 <= cao1 ; r2 <= cao2 ; end behave ; 以上是网上参考的变模计数器的VHDL代码,然而我在使用MAX PLUS 2 编译时却显示: unexpected end of file try using the text editor's syntax coloring command to find the missing delimiter or key word 检查一上午仍然没找到错误的地方,望各位大侠指导 |
|
相关推荐
1 个讨论
|
|
我今天也遇到这个问题,还没有解决
|
|
|
|
|
|
1851 浏览 1 评论
1590 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
1810 浏览 0 评论
968 浏览 0 评论
2586 浏览 0 评论
1592 浏览 41 评论
5818 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-4 17:10 , Processed in 0.513370 second(s), Total 67, Slave 50 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号