level 2
icy361
楼主
下面是除法器程序,单独check Syntax没有问题,生成symbol后,跟其他元件画的的原理图,synthesize-XST就出现错误,为“line 45: Operator <DIVIDE> must have constant operands or first operand must be power of 2”,就是if语句那行,望指点
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity pljdivision is
port(
en:in STD_LOGIC;
fx: in STD_LOGIC_VECTOR(15 downto 0);
shang: out STD_LOGIC_VECTOR(15 downto 0)
);
end pljdivision;
architecture Behavioral of pljdivision is
begin
process(en)
begin
if en = '1' then
shang<=CONV_STD_LOGIC_VECTOR(1000000/((conv_integer(fx(15 downto 12)))*1000+(conv_integer(fx(11 downto 8)))*100+ (conv_integer(fx(7 downto 4)))*10+(conv_integer(fx(3 downto 0)))*1),16);
else shang<=fx;
end if;
end process;
end Behavioral;
2013年05月05日 09点05分
1
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity pljdivision is
port(
en:in STD_LOGIC;
fx: in STD_LOGIC_VECTOR(15 downto 0);
shang: out STD_LOGIC_VECTOR(15 downto 0)
);
end pljdivision;
architecture Behavioral of pljdivision is
begin
process(en)
begin
if en = '1' then
shang<=CONV_STD_LOGIC_VECTOR(1000000/((conv_integer(fx(15 downto 12)))*1000+(conv_integer(fx(11 downto 8)))*100+ (conv_integer(fx(7 downto 4)))*10+(conv_integer(fx(3 downto 0)))*1),16);
else shang<=fx;
end if;
end process;
end Behavioral;