dcl A bit(1),
D bit(5);
A=1; /* A has value '0'B */
D=1; /* D has value '00010'B */
D='1'B; /* D has value '10000'B */
if A=1 then go to Y;
else go to X;
The branch is to X, because the assignment to A resulted in the following sequence of actions:
For the comparison operation in the IF statement, '0'B and 1 convert to FIXED BINARY and compare arithmetically. They are unequal, giving a result of false for the relationship A=1.
In the first assignment to D, a sequence of actions similar to that described for A takes place, except that the value is extended at the right with a zero, because D has a declared length that is 1 greater than that of the assigned value.