Hi I know it is not possible to initiate a module in an always or if loop, however what is the correct way to go about this problem?:
I have a module that has 4 inputs and 3 outputs. It has to complete 16 times, using the three outputs from the previous initiation for 3 of the inputs to the next. The fourth input being a counter.
I would like it to initiate the module at each clock posedge (so using always @ (posedge)).
I thought it would go:
Code:
always @(posdge clk) begin
module(input1,2,3,4,output1,2,3);
assign input1 =output1;
assign input2 =output2;
assign input3 =output3;
assign input4 = input4+1:
end
Hoping it would at each posedge of the clock, cycle through the above?
I tried initiating the module in a task/function as well, not really understanding them either at the moment...
Sorry for being so vague, but I would prefer a general answer than a direct answer, so in the future I know what to do/understand it a bit more.
Thanks for any help!