| 
		 | 	
   
The Case Statement lists the alternatives that may be activated depending on the value of the variable, group, or expression following the CASE keyword.
The following example shows a Case Statement:
CASE f[].q IS
   WHEN H"00" =>
      addr[] = 0;
      s = a & b;
   WHEN H"01" =>
      count[].d = count[].q + 1;
   WHEN H"02", H"03", H"04" =>
      f[3..0].d = addr[4..1];
   WHEN OTHERS =>
      f[].d = f[].q;
END CASE;
The Case Statement has the following characteristics:
The keywords CASE and IS enclose a Boolean 
      expression, group, or state machine (in 
      the example shown above, f[].q).
The Case Statement is terminated by the keywords END CASE 
      and a semicolon (;).
One or more unique alternatives are listed in the WHEN clauses 
      in the body of the Case Statement. Each WHEN clause begins 
      with the keyword WHEN.
In each alternative WHEN clause, one or more comma-separated 
      constant values are followed by an arrow symbol (=>). In 
      this example, the H"02", H"03", 
      and H"04" constant values are listed in a single 
      WHEN clause; the H"00" and H"01" 
      constant values are listed in separate WHEN clauses.
If the Boolean expression following the CASE keyword evaluates 
      to a specific alternative, all the behavioral statements following the arrow 
      are activated. In the example shown above, if f[].q evaluates 
      to H"01", the Boolean equation count[].d = 
      count[].q + 1 is activated.
When no other alternative is true, the optional keywords WHEN OTHERS 
      define the default alternative. In the example shown above, if f[].q 
      does not equal H"00", H"01", 
      or H"CF", the Boolean equation f[].d = f[].q 
      is activated.
The Defaults Statement defines the default behavior if the WHEN OTHERS 
      clause is not used.
If the Case Statement is used to define the transitions of a state machine, 
      the keywords WHEN OTHERS cannot be used to recover from illegal 
      states of an n-bit state machine unless the state machine contains 
      exactly 2^n states.
Each behavioral statement ends with a semicolon (;).
| 
       - PLDWorld -  | 
    
| 
       
  | 
  
| Created by chm2web html help conversion utility. |