Previous

Block Statements

A block statement names a set of concurrent statements. Use blocks to organize concurrent statements hierarchically.

The syntax follows.

   label: block   
     { block_declarative_item }   
   begin   
     { concurrent_statement }   
   end block [ label ];

The required label names the block.

A block_declarative_item declares objects local to the block and can be any of the following items.

The order of each concurrent_statement in a block is not significant, because each statement is always active.


NOTE

Foundation Express does not support guarded blocks.


Objects declared in a block are visible to that block and to all blocks nested within. When a child block (inside a parent block) declares an object with the same name as an object in the parent block, the child's declaration overrides that of the parent (inside the child block).

The following example shows nested blocks. The resulting circuit is shown in the figure following the example.

   B1: block   
      signal S: BIT; -- Declaration of "S" in block B1   
   begin   
      S <= A and B;  -- "S" from B1   
   
      B2: block   
         signal S: BIT; -- Declaration of "S" in block B2   
      begin   
         S <= C and D;  -- "S" from B2   
   
         B3: block   
         begin   
            Z <= S;     -- "S" from B2   
         end block B3;   
      end block B2;   
   
     Y <= S;         -- "S" from B1   
   end block B1;

Figure 7.4 Circuit for Nested Blocks

Next