关于计数求和的问题,modelsim仿真sum没到15就复位了
时间:10-02
整理:3721RD
点击:
clc1~clc5外部脉冲输入,cs和LED为数码管显示输出,
-- Quartus II VHDL Template
-- 计数统计
library ieee;
use ieee.std_logic_1164.all;
entity exp6 is
port
(
clc1,clc2,clc3,clc4,clc5 : in std_logic;
cs,LED :out std_logic_vector(7 downto 0)
);
end exp6;
-- 统计模块
architecture tongji of exp6 is
begin
cs =15 then
c1:=0;
c2:=0;
c3:=0;
c4:=0;
c5:=0;
end if;
case sum is
when 0 => LED LED LED LED LED LED LED LED LED LED LED LED LED LED LED LED LED<="11000000";
end case;
end process;
end tongji;
-- Quartus II VHDL Template
-- 计数统计
library ieee;
use ieee.std_logic_1164.all;
entity exp6 is
port
(
clc1,clc2,clc3,clc4,clc5 : in std_logic;
cs,LED :out std_logic_vector(7 downto 0)
);
end exp6;
-- 统计模块
architecture tongji of exp6 is
begin
cs =15 then
c1:=0;
c2:=0;
c3:=0;
c4:=0;
c5:=0;
end if;
case sum is
when 0 => LED LED LED LED LED LED LED LED LED LED LED LED LED LED LED LED LED<="11000000";
end case;
end process;
end tongji;
太多的边沿判断语句了,这样不好,实际的时候可能编译不过去!
这样啊,那有没有办法能够实现计数和求和功能啊。