EmbDev.net

Forum: FPGA, VHDL & Verilog concatenate operation with generic value


von sreeram s. (sresam89)


Rate this post
useful
not useful
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.please help!!!
Thanks in advance....

von sreeram s. (sresam89)


Rate this post
useful
not useful
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

von Thomas R. (Company: abaxor engineering) (abaxor)


Rate this post
useful
not useful
sreeram sam wrote:
>  num1_reg := "N zeros" & num1;--wherein n is a generic number

num1_reg := (n-1 downto 0 => '0')  & num1;

But you don't need a generic

num1_reg := (num1_reg'high downto num1'length => '0') & num1;

does the same.

Tom

von sreeram s. (sresam89)


Rate this post
useful
not useful
Thomas Reinemann wrote in post >
> num1_reg := (num1_reg'high downto num1'length => '0') & num1;
>
> does the same.

i don know what this statement does!!

num1_reg'high downto num1'length => '0' ??

num1_reg'high ??

num1_reg'length ??

von bko (Guest)


Rate this post
useful
not useful

von sreeram s. (sresam89)


Rate this post
useful
not useful
thanks bko, got sorted it out...

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.