program related to sorting by comparing adjacent numbers

Status
Not open for further replies.

welcome2colours

Newbie level 3
Joined
Jan 27, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,305
library ieee;
use ieee.std_logic_1164.all;
entity sort is
port(in0,in1,in2,in3,in4:in integer:=0;
out0,out1,out2,out3,out4ut integer:=0);
end sort;
architecture asort of sort is
type name is array(0 to 4) of integer;
signal x:name;
begin
x(0)<=in0;
x(1)<=in1;
x(2)<=in2;
x(3)<=in3;
x(4)<=in4;
process(in0,in1,in2,in3,in4)
variable temp:integer:=0;
begin
for i in 0 to 3 loop
for j in 0 to 3-i loop
if(x(j)>x(j+1)) then
temp:=x(j+1);
x(j+1)<=x(j);
x(j)<=temp;
end if;
end loop;
end loop;
end process;
out0<=x(0);
out1<=x(1);
out2<=x(2);
out3<=x(3);
out4<=x(4);
end asort;
could any one tell me what changes i have to make this program is giving one error multisource on concurrent assignment
 

The x array is driven from two places, both outside and inside the process.

Is this design something you want to synthesize or only simulate?
 

you're assigning x from the inputs and temp. You can only assign X from one place.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…