Adding signals of different size

Joined
Jun 29, 2009
Messages
2
Reaction score
0
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) ;
 
Joined
Mar 10, 2008
Messages
348
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top