qq_36663036 2016-11-11 12:39 采纳率: 0%
浏览 1166

EDA数字钟秒钟sec的代码怎么设计

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity cnt60 is
port(clk,clr,rst:in std_logic;
sec1:in std_logic_vector(3 downto 0);
sec0:in std_logic_vector(3 downto 0);
sec11:out std_logic_vector(3 downto 0);
sec00:out std_logic_vector(3 downto 0);
co:out std_logic);

end cnt60;

architecture behav of cnt60 is
signal cnt0:std_logic_vector(3 downto 0);
signal cnt1:std_logic_vector(2 downto 0);
signal clk1:std_logic;

begin

a:process(clk,clr,rst)

begin

if rst='1'then cnt0<="0000";

elsif(clk'event and clk='1')and clr='1'then

if cnt0="1001"then
cnt0<="0000";
clk1<='1';

else
cnt0<=cnt0+1;
clk1<='0';

end if;

end if;

end process a;

b:process(rst,clr,clk1)

begin

if rst='1'then cnt1<="000";
elsif(clk1'event and clk1='1')and clr='1'then
if cnt1="101"then
cnt1<="000";
else
cnt1<=cnt1+1;

end if;

end if;

end process b;

c:process(clk,clk1)

begin

if clk'event and clk='1'then
if cnt1="101" and cnt0="1001"then
co<='1';
else
co<='0';

end if;

end if;

end process c;

co(4 downto 0)<=cnt0;
co(7 downto 4)<=cnt1;

end behav;

求各位大神帮忙看下这代码错在哪里,小白求

  • 写回答

1条回答 默认 最新

  • qq_36663036 2016-11-11 12:56
    关注

    图片说明

    评论

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题