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

Reply

VHDL - cant interrupt sub program call ERROR!!!! for conversion.

 
Thread Tools Search this Thread
Old 02-25-2004, 10:08 AM   #1
Default cant interrupt sub program call ERROR!!!! for conversion.


A part for the fullfilment of my B.E degree i am supposed to do a
project.My current project involves the correlation of very high
frequencu data using MAX PLUS II 10.2(2) version. While compilation i
came across an error that is hindering us to proceed us further. The
program goes like this for conversion of std_logic_vetor to integer.
This is part of my program.

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;

entity bv_to_natural is
generic(n:natural :=;--number of bits of data
port (alw: std_logic_vector(n-1 downto 0));--input to be converted to
integer.
end entity;

architecture bv of bv_to_natural is
begin
process
variable int_alw : integer:=0;
begin
for index in 0 to n-1 loop
int_alw:= ((int_alw )+((2**(index))*(alw(index))));
--performing the operation for conversion.
end loop ;
end process;
end architecture bv;



ur suggestion will be of immense help to me.please reply.....


prabhu
  Reply With Quote
Old 02-25-2004, 03:32 PM   #2
Ralf Hildebrandt
 
Posts: n/a
Default Re: cant interrupt sub program call ERROR!!!! for conversion.
prabhu wrote:


> While compilation i
> came across an error that is hindering us to proceed us further. The
> program goes like this for conversion of std_logic_vetor to integer.


> This is part of my program.
>
> library ieee;
> use ieee.std_logic_1164.all;
> use ieee.std_logic_arith.all;
>
> entity bv_to_natural is
> generic(n:natural :=;--number of bits of data
> port (alw: std_logic_vector(n-1 downto 0));--input to be converted to
> integer.
> end entity;


You want to have "alw" converted to type integer, won't you?

I use the following package:
use IEEE.numeric_std.all;

(Package ieee.std_logic_arith.all is not recommended, because, it's not
standardisized.)

With this package the conversion is easy:

alw_int<=to_integer(unsigned(alw));

or, if "alw" is a signed value

alw_int<=to_integer(signed(alw));



With Package ieee.std_logic_arith.all there is a similar way, but I
don't remember the correct names of the conversion functions. Look into
the package.

Ralf



Ralf Hildebrandt
  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

Similar Threads
Thread Thread Starter Forum Replies Last Post
TRADING FEMALE CELEB INTERVIEWS ON DVD stu DVD Video 1 05-26-2008 09:39 AM
This is incredible! jc_ice DVD Video 1 08-13-2006 10:47 AM
Please try this Rob DVD Video 1 08-13-2006 10:43 AM
Been around for a while but very effective Paul A+ Certification 0 02-29-2004 12:14 PM
Re: free email addresses finding program (files included) Leonardo A+ Certification 1 12-05-2003 03:51 PM




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