Sasi Cm
Junior Member level 1
- Joined
- Aug 22, 2013
- Messages
- 19
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 112
Code:
module compare(a,out0,out1,out2,temp,temp1,temp2);
input [0:19]a;
wire [0:4]b;
output [0:1]out0,out1,out2;
reg [0:1]out0,out1,out2;
output [0:4] temp,temp1,temp2;
reg [0:4] temp,temp1,temp2;
always @(a)
begin
assign b[0:4]=a[0:4];
assign temp=b[0:4]^a[5:9];
if(temp[0]!=1&&temp[1]!=1&&temp[2]!=1&&temp[3]!=1&&temp[4]!=1)
begin
out0<=0;
end
else if(temp[0]!=0&&temp[1]!=0&&temp[2]!=0&&temp[3]!=0&&temp[4]!=0)
begin
out0<=10;
b[0:4]<=!a[0:4];
end
else
begin
out0<=11;
b[0:4]<=temp[0:4];
end
assign temp1=a[0:4]^a[10:14];
if(temp1[0]!=1&&temp1[1]!=1&&temp1[2]!=1&&temp1[3]!=1&&temp1[4]!=1)
begin
out1<=0;
end
else if(temp1[0]!=0&&temp1[1]!=0&&temp1[2]!=0&&temp1[3]!=0&&temp1[4]!=0)
begin
out1<=10;
b[0:4]<=!b[0:4];
end
else
begin
out1<=11
b[0:4]<=temp1[0:4];
end
assign temp2=a[0:4]^a[15:19];
if(temp2[0]!=1&&temp2[1]!=1&&temp2[2]!=1&&temp2[3]!=1&&temp2[4]!=1)
begin
out2<=0;
end
else if(temp2[0]!=0&&temp2[1]!=0&&temp2[2]!=0&&temp2[3]!=0&&temp2[4]!=0)
begin
out2<=10;
b[0:4]<=!b[0:4];
end
else
begin
out2<=11
b[0:4]<=temp2[0:4];
end
end
endmodule
I dont know to assign value to b..,Help me to overcome the error....