Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Concatenate bits

Thread Tools

Concatenate bits

Posts: n/a
constant size : integer := 32;
datain : in std_logic_vector(9 downto 0);
signal request : std_logic_vector(size-1 downto 0);

Now I wish to set "request" to "datain", like this:
request <= "0000000000000000000000" & datain;
(datain to lower bits, all other bits to zero)

How do I write that w/o all those zeros?
It should also work if I later change "size".

Reply With Quote
joris joris is offline
Senior Member
Join Date: Jan 2009
Posts: 152
Might try something like,
request <= (size - 1 downto 10 => '0') & datain;
Reply With Quote

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
Concatenate/De-Concatenate Carlos VHDL 10 10-24-2012 01:04 PM
Concatenate bits aleksa VHDL 2 02-29-2012 11:06 PM
8-Bits vs 12 or 16 bits/pixel; When does more than 8 bits count ? Al Dykes Digital Photography 3 12-29-2003 07:08 PM
win XP 32 bits on a 64 bits processor.. Abbyss Computer Support 3 11-13-2003 12:39 AM
Concatenate bits, then convert to HEX Abby C Programming 2 10-29-2003 12:29 AM