Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - please help me..

 
Thread Tools Search this Thread
Old 02-27-2008, 06:33 AM   #1
Default please help me..


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(4<='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(4 = '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(;

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/...omp.lang.vhdl/
More information at http://www.talkaboutprogramming.com/faq.html



anupamaasok
  Reply With Quote
Old 02-27-2008, 08:07 AM   #2
Pieter Hulshoff
 
Posts: n/a
Default Re: please help me..
anupamaasok wrote:
> 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


Pieter Hulshoff
  Reply With Quote
Old 02-29-2008, 05:22 PM   #3
Shannon
 
Posts: n/a
Default Re: please help me..
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


On Feb 27, 12:07*am, Pieter Hulshoff <phuls...@xs4all.nl> wrote:
> anupamaasok wrote:
> > 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




Shannon
  Reply With Quote
Old 03-01-2008, 08:50 AM   #4
Thomas Rouam
 
Posts: n/a
Default Re: please help me..
On Feb 29, 5:22*pm, Shannon <sgo...@sbcglobal.net> wrote:
> 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
>
> On Feb 27, 12:07*am, Pieter Hulshoff <phuls...@xs4all.nl> wrote:
>
>
>
> > anupamaasok wrote:
> > > 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- Hide quoted text -

>
> - 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(4<='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


Thomas Rouam
  Reply With Quote
Old 03-03-2008, 06:29 AM   #5
Thomas Stanka
 
Posts: n/a
Default Re: please help me..
On 27 Feb., 09:07, Pieter Hulshoff <phuls...@xs4all.nl> wrote:
> 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



Thomas Stanka
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46