Re: Using iff example


Subject: Re: Using iff example
From: Alec Stanculescu (alec@fintronic.com)
Date: Tue Dec 11 2001 - 09:38:35 PST


Mac,

The example should be:

always @(posedge clock)
   if (reset and !load) count <= count + 1;

always @(posedge clock iff load == 1) //synchronous reset
   if (!reset) count <= 0;
   else count <= d; //gated input

or

always @(posedge clock)
   if (reset and !load) count <= count + 1;

always @(posedge clock iff load == 1 or negedge reset) //asynchronous reset
   if (!reset) count <= 0;
   else if (load) count <= d; //gated input

The reason for the check on load here is that reset could have
transitioned from 1 to X and load could have been 0.

Alec



This archive was generated by hypermail 2b28 : Tue Dec 11 2001 - 09:38:48 PST