A
anupamaasok
Guest
i am doing a single precision floating point multiplier.my code goes like
this
entity multiplier is
port(frac_A,frac_B:in std_logic_vector(23 downto 0);
s_A,s_B:in std_logic;
e_A,e_B:in std_logic_vector(7 downto 0);
frac_Rut std_logic_vector(23 downto 0);
s_Rut std_logic;
e_Rut std_logic_vector(7 downto 0);
ovrflowut std_logic;
clk:in std_logic;
reset:in std_logic;
zfut std_logic
);
end multiplier;
architecture Behavioral of multiplier is
signal mux:std_logic_vector(23 downto 0);
signal e_int:std_logic_vector(8 downto 0);
signal sel:std_logic_vector(1 downto 0);
signal e_intr:std_logic_vector(8 downto 0);
signal l:std_logic:='1';
signal S:std_logic_vector(23 downto 0);
signal sum:std_logic_vector(48 downto 0);
signal A:std_logic_vector(23 downto 0);
signal P:std_logic_vector(48 downto 0);
signal k:std_logic_vector(4 downto 0);
begin
s_R<=s_A xor s_B;
e_intr<=('0'& e_A) +('0' & e_B)-"001111111" ;
process(reset,clk)
variable i:integer;
variable n:std_logic;
begin
if reset='1' then
A<=(others=>'0');
P<=(others=>'0');
elsif (clk'event and clk='1' )then
if l = '1' then
A <= frac_A;
S <= (not A)+'1';
P <= "000000000000000000000000" & frac_B & '0';
l <= '0';
k <= "00000";
else
P <= sum;
for i in 0 to 47 loop
P(i)<=P(i+1);
end loop;
P(48)<='0';
end if;
sel(0)<=P(0);
sel(1)<=P(1);
case sel is
when "00"=>mux<=(others=>'0');
when "01"=>mux<=A;
when "10"=>mux<=S;
when "11"=>mux<=(others=>'0');
when others=>mux<=(others=>'0');
end case;
if k="10111" then
if P(48) = '1' then
e_int <= e_intr+'1';
else
e_int <= e_intr;
for i in 0 to 47 loop
P(i+1) <= P(i);
end loop;
end if;
e_R(7 downto 0) <= e_int(7 downto 0);
ovrflow<=e_int(8);
frac_R(23 downto 0)<=P(48 downto 25);
n:='0';
for i in 0 to 48 loop
n:=n nor P(i);
end loop;
zf<=n;
else
sum <= P +(mux & "0000000000000000000000000" );
k<= k+'1';
end if;
end if;
end process;
end Behavioral;
although i have used the signal sum it is always showing a warning error
saying its not used.the warning errors shown are
ARNING:Xst:646 - Signal <sum> is assigned but never used.
WARNING:Xst:1426 - The value init of the FF/Latch l hinder the constant
cleaning in the block multiplier.
what should i do? please help me....
--
Message posted using http://www.talkaboutprogramming.com/group/comp.lang.vhdl/
More information at http://www.talkaboutprogramming.com/faq.html
this
entity multiplier is
port(frac_A,frac_B:in std_logic_vector(23 downto 0);
s_A,s_B:in std_logic;
e_A,e_B:in std_logic_vector(7 downto 0);
frac_Rut std_logic_vector(23 downto 0);
s_Rut std_logic;
e_Rut std_logic_vector(7 downto 0);
ovrflowut std_logic;
clk:in std_logic;
reset:in std_logic;
zfut std_logic
);
end multiplier;
architecture Behavioral of multiplier is
signal mux:std_logic_vector(23 downto 0);
signal e_int:std_logic_vector(8 downto 0);
signal sel:std_logic_vector(1 downto 0);
signal e_intr:std_logic_vector(8 downto 0);
signal l:std_logic:='1';
signal S:std_logic_vector(23 downto 0);
signal sum:std_logic_vector(48 downto 0);
signal A:std_logic_vector(23 downto 0);
signal P:std_logic_vector(48 downto 0);
signal k:std_logic_vector(4 downto 0);
begin
s_R<=s_A xor s_B;
e_intr<=('0'& e_A) +('0' & e_B)-"001111111" ;
process(reset,clk)
variable i:integer;
variable n:std_logic;
begin
if reset='1' then
A<=(others=>'0');
P<=(others=>'0');
elsif (clk'event and clk='1' )then
if l = '1' then
A <= frac_A;
S <= (not A)+'1';
P <= "000000000000000000000000" & frac_B & '0';
l <= '0';
k <= "00000";
else
P <= sum;
for i in 0 to 47 loop
P(i)<=P(i+1);
end loop;
P(48)<='0';
end if;
sel(0)<=P(0);
sel(1)<=P(1);
case sel is
when "00"=>mux<=(others=>'0');
when "01"=>mux<=A;
when "10"=>mux<=S;
when "11"=>mux<=(others=>'0');
when others=>mux<=(others=>'0');
end case;
if k="10111" then
if P(48) = '1' then
e_int <= e_intr+'1';
else
e_int <= e_intr;
for i in 0 to 47 loop
P(i+1) <= P(i);
end loop;
end if;
e_R(7 downto 0) <= e_int(7 downto 0);
ovrflow<=e_int(8);
frac_R(23 downto 0)<=P(48 downto 25);
n:='0';
for i in 0 to 48 loop
n:=n nor P(i);
end loop;
zf<=n;
else
sum <= P +(mux & "0000000000000000000000000" );
k<= k+'1';
end if;
end if;
end process;
end Behavioral;
although i have used the signal sum it is always showing a warning error
saying its not used.the warning errors shown are
ARNING:Xst:646 - Signal <sum> is assigned but never used.
WARNING:Xst:1426 - The value init of the FF/Latch l hinder the constant
cleaning in the block multiplier.
what should i do? please help me....
--
Message posted using http://www.talkaboutprogramming.com/group/comp.lang.vhdl/
More information at http://www.talkaboutprogramming.com/faq.html