J
Jack
Guest
hellow?
this is my c term.
i wnat to conver to verilog.
int i,j;
unsigned char * IMAGE;
int ResSquare;
IMAGE = new unsigned char [2048*1536];
for(j=0;j<1536;j++)
{
for(i=0;i<2048;i++)
{
ResSquare= (i-1024)*(i-1024)+(j-768)*(j-768);
if(ResSquare<=100*100)
IMAGE[i+j*2048]=255;
else
IMAGE[i+j*2048]=0;
}
}
how can i optimaze taht "ResSquare= (i-1024)*(i-1024)+(j-768)*(j-768);
".
this is my c term.
i wnat to conver to verilog.
int i,j;
unsigned char * IMAGE;
int ResSquare;
IMAGE = new unsigned char [2048*1536];
for(j=0;j<1536;j++)
{
for(i=0;i<2048;i++)
{
ResSquare= (i-1024)*(i-1024)+(j-768)*(j-768);
if(ResSquare<=100*100)
IMAGE[i+j*2048]=255;
else
IMAGE[i+j*2048]=0;
}
}
how can i optimaze taht "ResSquare= (i-1024)*(i-1024)+(j-768)*(j-768);
".