Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Adding signals of different size

Reply
Thread Tools

Adding signals of different size

 
 
abidbodal abidbodal is offline
Junior Member
Join Date: Jun 2009
Posts: 2
 
      06-29-2009
Can you add two signals and assign them to another signal of a different size?

Here's part of my code:

signal sv16_wh1_0_cnt :std_logic_vector (15 downto 0);
signal sv16_wh1_90_cnt :std_logic_vector (15 downto 0);
signal sv17_wh1_aver :std_logic_vector (16 downto 0);

--this takes place in a clocked process
sv17_wh1_aver <= (sv16_wh1_0_cnt + sv16_wh1_90_cnt) ;
 
Reply With Quote
 
 
 
 
jeppe jeppe is offline
Senior Member
Join Date: Mar 2008
Location: Denmark
Posts: 346
 
      06-29-2009
Try this:

sv17_wh1_aver <= ('0'&sv16_wh1_0_cnt + '0'&sv16_wh1_90_cnt)

You might be forced to use temp variable of the size 16 downto 0
 
Reply With Quote
 
 
 
 
abidbodal abidbodal is offline
Junior Member
Join Date: Jun 2009
Posts: 2
 
      07-01-2009
Thanks, that worked
 
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
Re: Adding internal signals in Modelsim Al VHDL 4 11-13-2006 08:04 AM
Adding different columns to a datagrid from different tables in the database nmsreddi ASP .Net Web Controls 1 06-09-2006 09:03 AM
Adding internal signals in Modelsim ALuPin VHDL 5 01-08-2004 07:35 AM
write signals at different processes default VHDL 3 10-24-2003 07:29 PM
Dynamically adding different controls to different rows in DataGrid does not work Jonas ASP .Net Datagrid Control 0 09-23-2003 02:52 PM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57