Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

N times concatenation

Status
Not open for further replies.

RVSachin

Technical User
Nov 12, 2001
77
IN
I would like to know as to how can I achieve the following in VHDL.

Assume widths of data_in = n and data_out = k*n, where k is a positive integer >2.
I want to concate data_in k times and finally assign it to data_out.

i.e.,
if k = 4 and n = 3 with value of data_in = "100" then
data_out = "100" & "100" & "100" & "100" ;
= "100100100100";

Please help.

[ RVSachin ]
 
library ieee;
use ieee.std_logic_1164.all;

entity temp4 is

generic(K : positive := 4;
N : positive := 3);

port (Din : in std_logic_vector(N-1 downto 0);
Dout : out std_logic_vector((N*K)-1 downto 0));

end temp4;

architecture test of temp4 is

begin

main : process(Din)
begin

for i in 0 to K-1 loop

Dout(N+N*I-1 downto N*I) <= Din;

end loop;

end process;

end test;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top