完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
用FPGA做一个秒表 能实现存读取数据的功能,要求保存三组数据
这是我的存储器的模块,硬件运行时无法实现以上功能,请问哪里出错了?非常感谢 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_arith.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity latch is Port ( savein : in STD_LOGIC; readin : in STD_LOGIC; overin : in STD_LOGIC; number_in1 : in STD_LOGIC_VECTOR (3 downto 0); number_in2 : in STD_LOGIC_VECTOR (3 downto 0); number_in3 : in STD_LOGIC_VECTOR (3 downto 0); number_in4 : in STD_LOGIC_VECTOR (3 downto 0); number_in5 : in STD_LOGIC_VECTOR (3 downto 0); number_in6 : in STD_LOGIC_VECTOR (3 downto 0); overout : out STD_LOGIC; number_out1 : out STD_LOGIC_VECTOR (3 downto 0); number_out2 : out STD_LOGIC_VECTOR (3 downto 0); number_out3 : out STD_LOGIC_VECTOR (3 downto 0); number_out4 : out STD_LOGIC_VECTOR (3 downto 0); number_out5 : out STD_LOGIC_VECTOR (3 downto 0); number_out6 : out STD_LOGIC_VECTOR (3 downto 0)); end latch; architecture Behavioral of latch is signal cnt : STD_LOGIC_VECTOR (2 downto 0); signal num : STD_LOGIC_VECTOR (2 downto 0); signal number01,number02,number03,number04,number05,number06 : STD_LOGIC_VECTOR (3 downto 0); signal number11,number12,number13,number14,number15,number16 : STD_LOGIC_VECTOR (3 downto 0); signal number21,number22,number23,number24,number25,number26 : STD_LOGIC_VECTOR (3 downto 0); begin process(savein) begin if rising_edge(savein) then if cnt<"010" then cnt<=cnt+1; else cnt<="000"; end if; end if; end process; process(readin) begin if rising_edge(readin) then if num<"010" then num<=num+1; else num<="000"; end if; end if; end process; process(cnt,num) begin case cnt is when "000" =>number01<=number_in1; number02<=number_in2; number03<=number_in3; number04<=number_in4; number05<=number_in5; number06<=number_in6; when "001" =>number11<=number_in1; number12<=number_in2; number13<=number_in3; number14<=number_in4; number15<=number_in5; number16<=number_in6; when "010" =>number21<=number_in1; number22<=number_in2; number23<=number_in3; number24<=number_in4; number25<=number_in5; number26<=number_in6; when others=>number_out1<=number_in1; number_out2<=number_in2; number_out3<=number_in3; number_out4<=number_in4; number_out5<=number_in5; number_out6<=number_in6; end case; case num is when "000" =>number_out1<=number01; number_out2<=number02; number_out3<=number03; number_out4<=number04; number_out5<=number05; number_out6<=number06; when "001" =>number_out1<=number11; number_out2<=number12; number_out3<=number13; number_out4<=number14; number_out5<=number15; number_out6<=number16; when "010" =>number_out1<=number21; number_out2<=number22; number_out3<=number23; number_out4<=number24; number_out5<=number25; number_out6<=number26; when others =>number_out1<=number_in1; number_out2<=number_in2; number_out3<=number_in3; number_out4<=number_in4; number_out5<=number_in5; number_out6<=number_in6; end case; end process; end Behavioral;
|
|
相关推荐
2个回答
|
|
|
|
|
|
程序是可以的啊,看看是不是其他地方的问题啊,
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1476 浏览 1 评论
1266 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
1471 浏览 0 评论
920 浏览 0 评论
2272 浏览 0 评论
1442 浏览 35 评论
5626 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 21:09 , Processed in 0.685842 second(s), Total 75, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号