Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > array of signed with unconstrained bit width (suggestions?)

Reply
Thread Tools

array of signed with unconstrained bit width (suggestions?)

 
 
Victor Hannak
Guest
Posts: n/a
 
      11-25-2003
I am creating a component that accepts as input a 2-D array of signed
signals (the numeric_std version of signed) that represent a coefficient
matrix. However, I would like the bit-width of the signed coefficients to
be variable as determined by a generic passed in to the component.

Ideally, I would like to define a type in a package like thus:

type signed_matrix_type is array (0 to 7, 0 to 7) of signed;

And then the component would look like this:

entity matrix_transform is
generic (
coeff_width : natural := ;
port (
matrix_in : in signed_matrix_type(coeff_width-1 downto 0);
matrix_out : out signed_matrix_type(coeff_width-1 downto 0));
end entity matrix_transform;


Obviously, this is incorrect for a variety of reasons. Nevertheless, I
would love to entertain suggestions on how to best implement this component.
Note that the base coefficient type must be signed because I want to
carefully control bit widths throughout the design. Therefore, I do not
want to use integer types/subtypes for the coefficients.

Thanks,

Vic.




 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      11-25-2003
Victor Hannak wrote:
> I am creating a component that accepts as input a 2-D array of signed
> signals (the numeric_std version of signed) that represent a coefficient
> matrix. However, I would like the bit-width of the signed coefficients to
> be variable as determined by a generic passed in to the component.



You might have to package the width
and and vary it with a script or preprocessor.

-- Mike Treseler

library ieee; ----------------------------------------------------------------
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

package matrix_pkg is
constant coeff_width : natural := 8;
type signed_matrix_type is
array (0 to 7, 0 to 7) of signed(coeff_width -1 downto 0);
end package matrix_pkg;

library ieee; ----------------------------------------------------------------
use ieee.std_logic_1164.all;
use work.matrix_pkg.all;

entity matrix_transform is
port (
matrix_in : in signed_matrix_type;
matrix_out : out signed_matrix_type);
end entity matrix_transform;

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Initialization of an unconstrained array object to the null array jens VHDL 3 08-19-2008 02:29 AM
Unconstrained array of unconstrained vector. Amal VHDL 5 03-08-2006 05:02 PM
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM
Using nested, unconstrained array types? Alex Rast VHDL 3 10-06-2003 07:08 PM
Re: Unconstrained 2 D array FE VHDL 0 06-26-2003 12:55 PM



Advertisments