FONT SIZE : AAA
The most basic decision-making element is the if statement, and this can be used in a very simple manner as shown in the basic example below, where the variable y is checked and depending on its value, the register dout will be assigned the value of a or b.
1 if (y == 1)
2 dout = a;
3 else
4 dout = b;
If the decision making requires more than a single statement per choice, then use the keywords begin and end to wrap up several statements such as:
1 if (y == 1)
2 begin
3 dout = a;
4 cout = d;
5 end
6 else
7 begin
8 dout = b;
9 cout = e;
10 end
Finally, if statements can also be nested to provide multiple options, as can be seen in the following example, where if y=1, then the second nested if checks for the value of the variable x.
1 if (y == 1)
2 begin
3 if ( x == 1)
4 dout = a;
5 else
6 cout = d;
7 end
8 else
9 begin
10 dout = b;
11 cout = e;
12 end
Manufacturer:Xilinx
Product Categories: CPLDs
Lifecycle:Active Active
RoHS:
Manufacturer:Xilinx
Product Categories:
Lifecycle:Obsolete -
RoHS:
Manufacturer:Xilinx
Product Categories:
Lifecycle:Active Active
RoHS: -
Manufacturer:Xilinx
Product Categories: FPGAs (Field Programmable Gate Array)
Lifecycle:Obsolete -
RoHS: No RoHS
Manufacturer:Xilinx
Product Categories: Driver IC
Lifecycle:Any -
RoHS: -
Support