Next: Embedded assertions
Up: Basic concepts
Previous: Conditionals
  Contents
In a case where more than one value is assigned to a signal at
exactly the same time, then the following resolution rule applies:
- If all assigned values are equal, then the signal is assigned the common value.
- If any assigned values are unequal, then the signal is assigned X (the undefined value).
This rule can be used, for example, to model a tristate bus. For example:
always
begin
if(enable1) bus = data1;
end
always
begin
if(enable2) bus = data2;
end
In this case, when only one of the two enable signals is true, then the bus
is equal to the corresponding data signal. If both enables are true and
the data values are the same, then bus = data1 = data2. Else bus = X.
2003-01-07