Pulkit Varshney
Member level 5
it's not the full code it's just a part of it. h[p] is number ranging from 0 to 3. My problem is that when i-p<0 than the code within if statement is not executing and i am getting result only when i-p>0. Please, tell me where i am making the mistake?
for(i=0;i<4;i=i+1)
begin
y=0;
for(p=0;p<4;p=p+1)
begin
for(j=0;j<h[p];j=j+1)
if((i-p)<0)
y=y+k[p-i];
else
y=y+k[i-p];
end
o0=y[0];o1=y[1];o2=y[2];o3=y[3];
end
end
for(i=0;i<4;i=i+1)
begin
y=0;
for(p=0;p<4;p=p+1)
begin
for(j=0;j<h[p];j=j+1)
if((i-p)<0)
y=y+k[p-i];
else
y=y+k[i-p];
end
o0=y[0];o1=y[1];o2=y[2];o3=y[3];
end
end