Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > A Question About Concatenation in VHDL

Reply
Thread Tools

A Question About Concatenation in VHDL

 
 
Karsus Karsus is offline
Junior Member
Join Date: Nov 2011
Posts: 2
 
      11-22-2011
Hello Everyone, I'm very new to VHDL and to this forum so If my question doesn't belong here or already answered I apologize, here's my question, when we concatenate bits to a vector will it be any faster than a for loop to do it?
Here's an example, imagine we have a sign extension in our system(let say 4 bit to 8 bit)
which of the following code would be faster and safer to use?

Code:
bit8(3 downto 0)<=bit4(3 downto 0);

bit8(7 downto 4)<=bit4(3)&bit4(3)&bit4(3)&bit4(3);
OR,

Code:
bit8(3 downto 0)<=bit4(3 downto 0);

for i in 7 downto 4 loop
	bit8(i)<=bit4(3);
end loop;
Thank you for your help,
 
Reply With Quote
 
 
 
 
jeppe jeppe is offline
Senior Member
Join Date: Mar 2008
Location: Denmark
Posts: 348
 
      11-22-2011
Hi

Please remember - VHDL a Hardware Description Language.

Hence will the result of your code (if not it's for simulation) be a circuit of logic devices
(Properly inside a FPGA)

If both your solutions gives the wanted hardware and functionality (and I beleive it does)
then you shouldn't care.

But I agree that your computer could use, say 0.00001 seconds Synthesizing the code.

Your welcome
 
Reply With Quote
 
 
 
 
Karsus Karsus is offline
Junior Member
Join Date: Nov 2011
Posts: 2
 
      11-22-2011
Hi Jeppe,
Thank you for your answer, I think I should stop treating vhdl as a High level programming language...
 
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
concatenation - VHDL MariuszK VHDL 3 03-26-2010 02:33 PM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
Question about concatenation error colonel Python 4 09-07-2005 06:22 PM
Different concatenation result VJDL93' generates from VHDL'87 bigdipper_gary VHDL 1 01-05-2004 05:20 PM
what's the difference between VHDL 93 CONCATENATION and VHDL 87 CONCATENATION? walala VHDL 3 09-18-2003 04:17 AM



Advertisments