blob: 04910a1f574b17909857d78fe6dc132939f3d90c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/*
* show different ways we can initialize variables
*/
module variable_initialization;
const
N : integer = 1; // this is a constant, exists only during compilation
var
a : integer; // not initialized, defacto initialized in data segment to zero
b : integer := N; // initialized on declaration, initialized in data segment
c : integer; // initialized at runtime to 2, in data segment initialized as zero
d : boolean := true; // a flag
begin
c := 2; // initialized at runtime, in data segment initialized as zero
end
|