Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21604 Discussions

A question about initial value when powering up

Altera_Forum
Honored Contributor II
1,154 Views

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!!!
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
504 Views

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
0 Kudos
Reply