please help me..

A

anupamaasok

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_R:eek:ut std_logic_vector(23 downto 0);
s_R:eek:ut std_logic;
e_R:eek:ut std_logic_vector(7 downto 0);
ovrflow:eek:ut std_logic;
clk:in std_logic;
reset:in std_logic;
zf:eek:ut 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....
 
P

Pieter Hulshoff

anupamaasok said:
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....

The first warning is incorrect as far as I can see, but might be a result of the
second warning. Within your code, l is only ever assigned as '0'. The only
reason it will ever be '1' is because of your initialisation value; otherwise it
would have been a constant '0'. Perhaps an error in your code?

Kind regards,

Pieter Hulshoff
 
S

Shannon

The error is correct. 'sum' is never used.

Look at your first IF..Then..Else statement. 'l' is always = 1 so the
'Else' clause will never be executed. Your compiler is deleting all
that code since it is not used. That is the only place you use 'sum'
so the error is correct.

Shannon
 
T

Thomas Rouam

The error is correct.  'sum' is never used.

Look at your first IF..Then..Else statement.  'l' is always = 1 so the
'Else' clause will never be executed.  Your compiler is deleting all
that code since it is not used.  That is the only place you use 'sum'
so the error is correct.

Shannon






- Show quoted text -

What Shannon just said is right and wrong.
'sum' is truly never used, but not for thos reasons.
If you look at that IF..Then.Else statement he's talking about, in the
Else part :
P <= sum;
for i in 0 to 47 loop
P(i)<=P(i+1);
end loop;
P(48)<='0';
sum is assigend to P, but then the bits 0 to 47 of P are assigned and
finally the bit 48. sinc P is defined as 48 downto 0, P is entireley
assigned with the for loop and the final 48th bit assignment. These
two assignement "overwrite" the P <= sum assignment. Since that's the
only place where you use sum, it is not used.

Best Regards,

Thomas
 
T

Thomas Stanka

second warning. Within your code, l is only ever assigned as '0'. The only
reason it will ever be '1' is because of your initialisation value; otherwise it
would have been a constant '0'. Perhaps an error in your code?

Signal values in the signal declaration are not relevant for synthesis
(only for simulation). So the signal 'I' should throw the first
warning because its value is not defined.
The signal 'I' should be initialisated during reset.

bye Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top