Forum Discussion
Altera_Forum
Honored Contributor
16 years agoA question about initial value when powering up
Hello everybody!
What is the initial value when I do not give the initial value for a register.For example,the following code : ////////////////////////////////////////////////////////////// module Reset_Delay(iCLK,oRESET); input iCLK; output reg oRESET; reg [19:0] Cont; always@(posedge iCLK) begin if(Cont!=20'hFFFFF) begin Cont <= Cont+1; oRESET <= 1'b0; end else oRESET <= 1'b1; end endmodule /////////////////////////////////////////////// What is the initial value of "Cont" when the device power up.Is this relative with the category of device or ,can be set in QuartusII? Thank you for your help!!!1 Reply
- Altera_Forum
Honored Contributor
The initial value is zero, but I prefer to set it in the code for clarity. In some situation, Quartus may invert the value of signal, but you'll get a warning about it.
P.S.: Some additional thoughts related to POR behaviour can be found in this threads: http://www.alteraforum.com/forum/showthread.php?t=6621 http://www.alteraforum.com/forum/showthread.php?t=18591