Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Creating a new type for STD_LOGIC_VECTOR

Reply
Thread Tools

Creating a new type for STD_LOGIC_VECTOR

 
 
Kwaj
Guest
Posts: n/a
 
      05-04-2004
I would like to create a new type, bit32word, which would be a 16bit
std_logic_vector. I tried the following,

type bit32word is STD_LOGIC_VECTOR(31 DOWNTO 0);

which didn't seem to work. Any ideas??

- Kwaj


 
Reply With Quote
 
 
 
 
Steffen Netz
Guest
Posts: n/a
 
      05-04-2004
Hello Kwaj,

that the typical case for an subtype:
SUBTYPE bit32word IS std_logic_vector(31 DOWNTO 0);
SIGNAL rega : bit32word := (OTHERS=>'0');

You can even get an array of this by the array type:
TYPE romarray IS ARRAY (integer RANGE <>) OF bit32word;
SIGNAL rom_mem : romarray(255 downto 0);

regards,

Steffen

Kwaj wrote:
> I would like to create a new type, bit32word, which would be a 16bit
> std_logic_vector. I tried the following,
>
> type bit32word is STD_LOGIC_VECTOR(31 DOWNTO 0);
>
> which didn't seem to work. Any ideas??
>
> - Kwaj
>
>




--
-----------------------------------------------------------------------------
| Fraunhofer Institut Photonische Microsysteme |
| |
| Fraunhofer Institute for Photonic Microsystems ( Germany ) |
| |
| Steffen Netz | phone : ( +49 ) (0)351/8823-212 |
| Grenzstrasse 28 | fax : ( +49 ) (0)351/8823-266 |
| 01109 Dresden | email : http://www.velocityreviews.com/forums/(E-Mail Removed) |
-----------------------------------------------------------------------------
 
Reply With Quote
 
 
 
 
Riyaz
Guest
Posts: n/a
 
      05-05-2004
Try using subtype instead of type

"Kwaj" <(E-Mail Removed)> wrote in message
news:c77b9b$qh2$(E-Mail Removed)...
> I would like to create a new type, bit32word, which would be a 16bit
> std_logic_vector. I tried the following,
>
> type bit32word is STD_LOGIC_VECTOR(31 DOWNTO 0);
>
> which didn't seem to work. Any ideas??
>
> - Kwaj
>
>



 
Reply With Quote
 
Lee
Guest
Posts: n/a
 
      05-06-2004
Hi,

This is array type that has different syntax with scalar type.

type bit32word is array (31 DOWNTO 0) of STD_LOGIC_VECTOR;

Try it to see if it works.

Regards,

"Riyaz" <(E-Mail Removed)> wrote in message news:<c7ae4n$rhv$(E-Mail Removed)>...
> Try using subtype instead of type
>
> "Kwaj" <(E-Mail Removed)> wrote in message
> news:c77b9b$qh2$(E-Mail Removed)...
> > I would like to create a new type, bit32word, which would be a 16bit
> > std_logic_vector. I tried the following,
> >
> > type bit32word is STD_LOGIC_VECTOR(31 DOWNTO 0);
> >
> > which didn't seem to work. Any ideas??
> >
> > - Kwaj
> >
> >

 
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
inout std_logic_vector to array of std_logic_vector of generic length conversion... Thomas Rouam VHDL 6 11-09-2007 11:49 AM
Type conversion and std_logic_vector incrment Govinda VHDL 0 08-02-2007 06:34 AM
how to convert real type to std_logic_vector ? jing VHDL 1 05-17-2006 05:41 PM
warning message for case statements where the selector signal is of type std_logic_vector profpenguin@shaw.ca VHDL 6 02-11-2005 05:38 AM
'STD_LOGIC_VECTOR ' to 'unsigned' type casting Ben Nguyen VHDL 6 09-20-2003 05:09 PM



Advertisments