concatenate two bit_vector 
Author Message
 concatenate two bit_vector

i have a two variables (a and b) with their type are bit_vector(4
downto 0)
how can i concatentate these two variables and store the result into a
variable c with its type is bit_vector(9 downto 0)

thank you.

regards
yccheok



Wed, 07 Sep 2005 11:30:27 GMT  
 concatenate two bit_vector
Very easy;

c <= a & b;  -- a is assigned into upper 5 bits, b into lower 5 bits.

Niv.



Quote:
> i have a two variables (a and b) with their type are bit_vector(4
> downto 0)
> how can i concatentate these two variables and store the result into a
> variable c with its type is bit_vector(9 downto 0)

> thank you.

> regards
> yccheok



Wed, 07 Sep 2005 16:46:54 GMT  
 concatenate two bit_vector
Part 2: Ah, a variable, didn't read properly.

So;      c := a & b;

Niv.



Quote:
> i have a two variables (a and b) with their type are bit_vector(4
> downto 0)
> how can i concatentate these two variables and store the result into a
> variable c with its type is bit_vector(9 downto 0)

> thank you.

> regards
> yccheok



Wed, 07 Sep 2005 16:48:05 GMT  
 concatenate two bit_vector

Quote:
> i have a two variables (a and b) with their type are bit_vector(4
> downto 0)
> how can i concatentate these two variables and store the result into a
> variable c with its type is bit_vector(9 downto 0)

> thank you.

> regards
> yccheok

Just use the concatenation operator & as in

c:= a & b; or
c:= b & a; depending on whether you want a or b to be in the most
significant position.
Cheers
Yves



Wed, 07 Sep 2005 21:22:16 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Adding up two operands in BIT_VECTOR

2. concatenate two variables in a variable

3. Concatenating two RTF strings

4. Concatenating two (or more) DBF files

5. Haskell: concatenating two (Maybe String) objects

6. concatenate two points in 3d space

7. Q: concatenate two strings

8. read two sets of data from two spread sheet files to two arrays problem

9. How to convert an integervariable to bit_vector?

10. unsigned to bit_vector

11. concat bit into bit_vector

12. std_logic_vector vs bit_vector

 

 
Powered by phpBB® Forum Software