The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 19th, 2024, 3:40am
Pages: 1
Send Topic Print
concatenate operation (Read 4128 times)
samy
New Member
*
Offline



Posts: 5

concatenate operation
Jun 16th, 2011, 7:19pm
 
dear all,
i want to concatenate a register(of dynamic size as for concatenation)
with n no:of zeros where n is a  generic integer number.

say for eg
num1_reg := "00" & num1;--here only two zeros are only used

i would like to make it something that would work like this

num1_reg := "N zeros" & num1;--wherein n is a generic number

how to make it work..please advice...
thanks in advance
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: concatenate operation
Reply #1 - Jun 17th, 2011, 1:51am
 
Samy,

Which language do you use?

B O E
Back to top
 
 
View Profile   IP Logged
samy
New Member
*
Offline



Posts: 5

Re: concatenate operation
Reply #2 - Jun 17th, 2011, 2:19am
 
VHDL only not verilog
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: concatenate operation
Reply #3 - Jun 17th, 2011, 7:36am
 
Samy,

you could e.g. define a constant zero vector of sufficient size and use an N bit wide sub-vector.

B O E
Back to top
 
 
View Profile   IP Logged
samy
New Member
*
Offline



Posts: 5

Re: concatenate operation
Reply #4 - Jun 17th, 2011, 9:12am
 
thanks boe.tat was of gr8 help

actually tat was not i was lookin for.the type-subtype wont help me b'coz the size of the main type cant be determined unless the n(for the zero's or for the main pgm) is assigned,moreover as you said the a large size for the vector is also not adviced i suppose!!
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.