VHDL程序那位帮忙看下我这个程序哪里错了呀,编译的时候,说Error (10517): VHDL type mismatch error at /315jizhi.vhd(9): std_logic_vector type does not match integer literal功能是实现316进制计数程序如下:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY cnt315 IS PORT(clk , clrn : IN STD_LOGIC; q : out std_logic); END cnt315;ARCHITECTURE one OF cnt315 IS SIGNAL q1 : STD_LOGIC_vector RANGE 0 TO 3; SIGNAL q2 : BIT_vector RANGE
问题描述:
VHDL程序
那位帮忙看下我这个程序哪里错了呀,编译的时候,说Error (10517): VHDL type mismatch error at /315jizhi.vhd(9): std_logic_vector type does not match integer literal
功能是实现316进制计数
程序如下:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY cnt315 IS
PORT(clk , clrn : IN STD_LOGIC;
q : out std_logic);
END cnt315;
ARCHITECTURE one OF cnt315 IS
SIGNAL q1 : STD_LOGIC_vector RANGE 0 TO 3;
SIGNAL q2 : BIT_vector RANGE 0 TO 3;
SIGNAL q3 : BIT_vector RANGE 0 TO 3;
BEGIN
PROCESS(clk,clrn)
variable cnt : integer range 0 to 315;
begin
if(clrn = '1') then q1
答
std_logic_vector type does not match integer literal这个错误是说std_logic_vector类型与整形不匹配 主要原因是因为你的q1