To create a three-bit counter, we can now write, for example:
clear : boolean; count : array 2..0 of boolean; carry : array 3..0 of boolean; bit0 : counter_bit(carry[0], clear, count[0], carry[1]); bit1 : counter_bit(carry[1], clear, count[1], carry[2]); bit2 : counter_bit(carry[2], clear, count[2], carry[3]);
Here, three instances of the module ``counter_bit'' are created. These instances have names ``bit0'', ``bit1'', ``bit2''. Each instance is, in effect, a copy of the definitions in module ``counter_bit''. However, all the signal names referenced in the instance are prefixed with the instance name, so that they are unique to that instance. For example, the signals in module instance ``bit0'' are:
bit0.carry_in bit0.clear bit0.bit_out bit0.carry_out