wwwrabbit
Member level 1
In Altera MaxPlus, I have designed the following module. in wave editor, I use "Enter nodes from SNF". how can I initial "initCnt" as b0101, in stead of initial "initCnt0,initCnt1,initCnt2,initCnt3" individually?
another question: may I initial initCnt inside module? like "initial initCnt = 4'b0101;"
thanks
odule test ( clk1, clk2, clk3, initCnt, count );
input clk1, clk2, clk3;
input[3:0] initCnt;
output[3:0] count;
reg [3:0] count1;
reg [3:0] count2;
reg [3:0] count3;
always@( posedge clk1 )
count1 = count1 + 1;
always@( posedge clk2 )
count2 = count2 + 1;
always@( posedge clk3 )
count3 = count3 + 1;
assign count = count1 + count2 + count3 + initCnt;
endmodule
another question: may I initial initCnt inside module? like "initial initCnt = 4'b0101;"
thanks
odule test ( clk1, clk2, clk3, initCnt, count );
input clk1, clk2, clk3;
input[3:0] initCnt;
output[3:0] count;
reg [3:0] count1;
reg [3:0] count2;
reg [3:0] count3;
always@( posedge clk1 )
count1 = count1 + 1;
always@( posedge clk2 )
count2 = count2 + 1;
always@( posedge clk3 )
count3 = count3 + 1;
assign count = count1 + count2 + count3 + initCnt;
endmodule