Since B is used here on two different procedures, there is an error . Now how to correct this program.
The idea is when posedge B=A; when negedge B=~A. Here however we are summing into one variable B, so is there any way to execute . Just Curious
No physically possible to have a flop stimulated on both edge.
You could create a pure combinational logic
B <= CLK ? A : ~A;
But in this case B is only a wire.
You a clock at double speed to do that.