Combinational latch?????????

Status
Not open for further replies.
Hi,

Below is an example of combinational latch:

Code:
module com_latch (a, b, c);

input a, b;
output c;

reg c;

always @(a or b)
begin
      if(a) 
            c <= b; // no else statement
end

endmodule

This piece of verilog code will infer a latch or combinational latch.
This is not a good coding style. Unless, u intent to do this.

Hope it helps.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…