用VHDL编写的计数器,能通过语法检测,但不可以综合,哪里出错了?
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/08/03 11:47:41
用VHDL编写的计数器,能通过语法检测,但不可以综合,哪里出错了?
提示 Variable i :std_logic_vector (7 downto 0) 中的“i” 有以下错误:
“
Signal i cannot be synthesized,bad synchronous description.The description style you are using to describe a synchronous element (register,memory,etc.) is not supported in the current software release.”
Library ieee;
Use ieee.std_logic_1164.all;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
Entity counter is
port(clk ,cw,increment,reset:in std_logic;
led :out std_logic_vector (7 downto 0) );
End counter;
Architecture counter of counter is
Begin
Process(clk ,cw,increment,reset)
Variable i :std_logic_vector (7 downto 0);
Begin
If(reset'event and reset = '1') then
i := "00000000";
elsIf(clk'event and clk = '1') then
If(increment'event and increment = '1') then
If(cw = '1') then
i := i + 1;
elsIf(cw = '0') then
i := i - 1;
End if;
Else null;
End if;
End if;
led
提示 Variable i :std_logic_vector (7 downto 0) 中的“i” 有以下错误:
“
Signal i cannot be synthesized,bad synchronous description.The description style you are using to describe a synchronous element (register,memory,etc.) is not supported in the current software release.”
Library ieee;
Use ieee.std_logic_1164.all;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
Entity counter is
port(clk ,cw,increment,reset:in std_logic;
led :out std_logic_vector (7 downto 0) );
End counter;
Architecture counter of counter is
Begin
Process(clk ,cw,increment,reset)
Variable i :std_logic_vector (7 downto 0);
Begin
If(reset'event and reset = '1') then
i := "00000000";
elsIf(clk'event and clk = '1') then
If(increment'event and increment = '1') then
If(cw = '1') then
i := i + 1;
elsIf(cw = '0') then
i := i - 1;
End if;
Else null;
End if;
End if;
led
![用VHDL编写的计数器,能通过语法检测,但不可以综合,哪里出错了?](/uploads/image/z/16116639-15-9.jpg?t=%E7%94%A8VHDL%E7%BC%96%E5%86%99%E7%9A%84%E8%AE%A1%E6%95%B0%E5%99%A8%2C%E8%83%BD%E9%80%9A%E8%BF%87%E8%AF%AD%E6%B3%95%E6%A3%80%E6%B5%8B%2C%E4%BD%86%E4%B8%8D%E5%8F%AF%E4%BB%A5%E7%BB%BC%E5%90%88%2C%E5%93%AA%E9%87%8C%E5%87%BA%E9%94%99%E4%BA%86%3F)
oh my god!你连用了三个时钟上升沿,难怪会说你bad synchronous description.
程序改正如下:
Library ieee;
Use ieee.std_logic_1164.all;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
Entity counter is
port(clk ,cw,increment,reset:in std_logic;
led :out std_logic_vector (7 downto 0) );
End counter;
Architecture art of counter is注意这里结构体名最好不要与实体名一致
Begin
Process(clk ,cw,increment,reset)
Variable i :std_logic_vector (7 downto 0);
Begin
If reset='1' then --复位不能用其上升沿,直接=1就可以了
i := "00000000";
elsIf(clk'event and clk = '1') then
If(increment = '1') then--这个使能位也一样,
If(cw = '1') then
i := i + 1;
elsIf(cw = '0') then
i := i - 1;
End if;
Else null;
End if;
End if;
led
程序改正如下:
Library ieee;
Use ieee.std_logic_1164.all;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
Entity counter is
port(clk ,cw,increment,reset:in std_logic;
led :out std_logic_vector (7 downto 0) );
End counter;
Architecture art of counter is注意这里结构体名最好不要与实体名一致
Begin
Process(clk ,cw,increment,reset)
Variable i :std_logic_vector (7 downto 0);
Begin
If reset='1' then --复位不能用其上升沿,直接=1就可以了
i := "00000000";
elsIf(clk'event and clk = '1') then
If(increment = '1') then--这个使能位也一样,
If(cw = '1') then
i := i + 1;
elsIf(cw = '0') then
i := i - 1;
End if;
Else null;
End if;
End if;
led
vhdl伪随机数求用vhdL语言编写一段产生1-7随机数字的程序
用VHDL语言编写下列题目要求的程序.
编写一个用矩形法求定积分,这个程序哪里出错了.答案总是显示0
给电池充电电路中,能检测到电池接上 但没电流通过.是哪里的毛病/
C语言在数组中求出素数的个数和素数之和(不可以用函数)还有我写的那一段哪里出错了,素数之和一直都不对
出租车计价器设计最好用VHDL编写
出租车计价器设计要求用VHDL编写
vhdl 16位二进制计数器不能计数
用c编写一个程序,总是出错,请大家帮忙看下哪里有错误?
VHDL程序那位帮忙看下我这个程序哪里错了呀,编译的时候,说Error (10517): VHDL type misma
matlab函数,哪里出错了?
高数题 请问哪里出错了