在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1848|回复: 1

[求助] 帮忙看下手动输入值,然后进行倒计时的程序,小弟刚刚开始学,希望大家帮帮忙

[复制链接]
发表于 2012-10-10 09:10:37 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

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

entity jian60 is
port(clk:in std_logic;
     start:in std_logic;--倒计时开始
     reset:in std_logic;--复位信号
     daojishi:in std_logic;--倒计时使能
     shishuru,geshuru:in std_logic_vector(3 downto 0);
     coutut std_logic;
     shi,geut std_logic_vector(3 downto 0));  
end;

architecture a of jian60 is
signal i,j:std_logic_vector(3 downto 0);
begin
process(clk,daojishi,start)
  begin
  if (reset='1') then i<="0000";j<="0000";
  elsif (daojishi='1' and start='0') then
    i<=shishuru;
    j<=geshuru;
  elsif rising_edge(clk) then
   if start='1' then
    if j="0000" then j<="1001";
     if i="0000" then cout<='1';i<="0101";
          else i<=i-1;cout<='0';   
     end if;
    else j<=j-1;
end if;   
end if;
end if;
shi<=i;
ge<=j;
end process;
end;

报错:Only one clock enable signal can be defined for a  flipflop
发表于 2012-10-10 10:52:58 | 显示全部楼层
你觉得你这样的代码能综合成怎么样的电路?想不出来就打回去重写代码。
标准写法是这样的
if (!rst)
...
elsif rising_edge(clk) then
  if xxx then
    ...
  else
    ...
  end if;
end if;
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-6 09:09 , Processed in 0.033597 second(s), 11 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表