alangs
Member level 3
can anybody tell me how i can calculate the square of a number without using * operator.plz give me the answer in verilog code by using for loop......
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
int square(int x)
{
int sum = 0;
for(int count = x; count>0; count--)
{
sum = sum + x;
}
return sum;
}