library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity sy is
Port ( clk : in std_logic;
reset : in std_logic;
dout : out std_logic_vector(5 downto 0));
end sy;
architecture Behavioral of sy is
signal count: std_logic_vector(5 downto 0);
begin
process(clk,reset,count)
begin
dout<=count;
if reset= '1' then
count <= count+1;
end if;
if count(3 downto 0)="1001" then
count(3 downto 0)<="0000";
count(5 downto 4)<=count(5 downto 4) +1;
else
count(3 downto 0)<=count(3 downto 0)+1;
end if;
if rising_edge(clk) then
if count(3 downto 0)="1001" then
count(3 downto 0)<="0000";
count(5 downto 4)<=count(5 downto 4) +1;
else
count(3 downto 0)<=count(3 downto 0)+1;
end if;
end if;
if count="100011" then
count<="000000";
end if;
end process;
end Behavioral;
老是提示
Error: VHDL error at sy.vhd(25): can't infer register for signal count[5] because signal does not hold its value outside clock edge
Error: VHDL error at sy.vhd(25): can't infer register for signal count[4] because signal does not hold its value outside clock edge
Error: VHDL error at sy.vhd(25): can't infer register for signal count[3] because signal does not hold its value outside clock edge
Error: VHDL error at sy.vhd(25): can't infer register for signal count[2] because signal does not hold its value outside clock edge
Error: VHDL error at sy.vhd(25): can't infer register for signal count[1] because signal does not hold its value outside clock edge
Error: VHDL error at sy.vhd(25): can't infer register for signal count[0] because signal does not hold its value outside clock edge
Error: Can't elaborate user hierarchy
Error: Quartus II Analysis & Synthesis was unsuccessful. 7 errors, 0 warnings
Error: Processing ended: Thu Apr 22 20:30:27 2010
Error: Elapsed time: 00:00:00
Error: Quartus II Full Compilation was unsuccessful. 7 errors, 0 warnings
我实在是无语到了极点啊,迫切需要高手指点,拜托了…………
哦,有一点忘了说,我要实现的是,当reset=1的时候,count自动加一,并且到下边时钟上升沿来的时候再加1,如果高手能帮我再写一个不一样的程序也感谢…………但是输入只能是单脉冲哦 ,我用的是quatusII的编译环境 ,确实挺混乱的,我就是想要达到输入尽量少,同样能实现输出时钟来之前先加1的效果,其实就是调时的效果,还有我觉得这个错误蛮经典的所以想知道解决办法以便以后使用。不行的话也就只好改程序了
vhdl 请各位大虾 帮我改正一下这几个程序的错误
第六个是一个16进制计数器。可以考虑把count改成out类型(话说一般不推荐用buffer的)然后加一个signal给count赋值(就是在process里只操作加的signal而不操作count)。不过要真说他是16进制计数器的话又少了进位、复位信号之类的,总之感觉怪怪的,就那么不停的累加循环。其实真要看语法错误的话最好的...
求大神改改vhdl程序,搞半天逻辑还是错误,,为什么高位m1输出一直是零?我...
你已经设置min1<='0'&m1,最高位当然不变。LIBRARY IEEE;USE IEEE.std_logic_1164.all;USE IEEE.std_logic_unsigned.all;USE IEEE.std_logic_arith.all;ENTITY tsk1 is port (f:in std_logic;min1,min0: out std_logic_vector(3 downto 0));end tsk1;architecture behav of tsk1 is ...
VHDL元件例化语句的问题 u1 u2总是出错
从上面的描述中看不出问题。但是,你必须将cnt10.vhd文件与cnt7.vhd文件一起放在当前工程项目路径下编译。
VHDL中无法解决信号重复引用错误的问题?
这位兄弟,你的程序不是那里出错了,我帮你编译过了,看一下下面,黑色加粗的地方是是改过的。还有就是你要把你全部的程序发过来,才可以帮你解决。目前按照这个程序,只能检查这些错误。 LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY K IS PORT(CLK ,...
vhdl程序说明
这段程序主要是计数器k计到7的时候,根据a取值输出一个周期的载波 if clk'event and clk='1' then ---时钟上升触发 if start='0' then k<=0; ---开始信号,k置为初始0 elsif k=0 then k<=1;m(3)<='1'; m(1)<='0'; aa(1)<=a;bb<=aa;---当k=0,对m(1)、m(3)...
Error (10482): VHDL error at SY.vhd(9): object "STD_VECTOR" is u...
将“SIGNAL COUNT_3:STD_VECTOR(2 DOWNTO 0);”改成“SIGNAL COUNT_3:STD_LOGIC_VECTOR(2 DOWNTO 0);”。
翻译VHDL语言程序,急!!!
这是个模值为10的计数器 在进程里,设了CQL这个变量 RST(RESET)为1时,CQL归零 当时钟CLK上升沿到来,且EN为1时,CQL开始计数(小于9时加一,到9时归零,所以每一轮计10个数);当CQL=9时,输出COUT变为高电平 进程结束,把变量CQL赋给输出端口CQ 不过这个程序有错,CQL明明是4位向量,所以...
VHDL计数
begin if rising_edge(clk) then if en = '1' then count <= "0000000";elsif count < "1111111" then count <= count + '1';else count <= count;end if;end if;end process;当按下按键时,产生EN脉冲,计数器清0,EN无效时,计计数xf数器计数,从0--127共计128个数,当计到127...
谁帮我分析下这个VHDL代码高分!
if phase_counter = attack then --当相位计数器达到起音计数器,执行下段代码。这里需要着重介绍一下,attack、decay 和release 3个参数都是“速度”--也就是说再这里phase_counter实际上是用来控制level增加的速度的计数器,attack数值越小,则level增加越快,声音就提高的越快,波形变陡,同理...
VHDL语言问题!提示end if 错误!!急...
你对buffer端口的理解不足。buffer和in、out一样是一种端口类型,而不是数据类型。buffer端口的特点是输出且允许回读。你定义b的时候写的是out buffer,这是不对的,正确的定义语句为:b : buffer std_logic;另外,结构体(architecture)也有begin和end的,你的程序还少了个begin ——Medied.Lee ...