Hi,

I am trying to implement a particular code in verilog whose pseudo code is given below. I have problem with the while loop(LINE 7 & 11). I get this error when the while loop is used; Non-constant loop condition not supported for while. Can anybody suggest me an alternative.

Compute: X mod Y

1: G = Split(X;Width(Y ) )//split x in widths of y

2: N = Num(G) - 1// no. of groups that x is split into

3: while N > 0 do

4: T = G[N]

5: for i = Width(Y ) - 1 downto 0 do

6: T = T Y do

16: G[0] = G[0] - Y

return G[0]

Similar questions and discussions