syedshan
Advanced Member level 1
- Joined
- Feb 27, 2012
- Messages
- 463
- Helped
- 27
- Reputation
- 54
- Reaction score
- 26
- Trophy points
- 1,308
- Location
- Jeonju, South Korea
- Activity points
- 5,134
Dear all,
Hope every member of the forum is in best of health and peace
I was wondering that using all possible cases in if-else is necessary to avoid any parasitic latch. But When we have no other condition but to retain the value then what
to do since I think it will also cause the parasitic latch to occur...Please see the following code
In this case. since address is itself a reg, hence I understand no need to place the 'address <= address' with else but what else should I do so that I can avoid hidden latch.
Also what difference that latch can create...
Many thanks and Regards,
Shan
Hope every member of the forum is in best of health and peace
I was wondering that using all possible cases in if-else is necessary to avoid any parasitic latch. But When we have no other condition but to retain the value then what
to do since I think it will also cause the parasitic latch to occur...Please see the following code
Code:
reg [x:0] address;
always@(posedge clk)
if(rst) address <= 10'd0;
else
if(m_en)
address <= address + 1'b1;
else address <= address;
In this case. since address is itself a reg, hence I understand no need to place the 'address <= address' with else but what else should I do so that I can avoid hidden latch.
Also what difference that latch can create...
Many thanks and Regards,
Shan