Examples of Pin-to-pin and Detailed Descriptions
To implement the second (detailed) module into a device with inverting
outputs, the source file would need to be modified as described in Detailed Module with Inverted Outputs :
When to Use Detailed Descriptions
Using := for Alternative Flip-flop Types
Q1 pin istype 'reg';
Clock,Preset pin;
equations
Q1.clk = Clock;
Q1 := !Q1.fb # Preset;
test_vectors ([Clock,Preset] -> Q1)
[ .c. , 1 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 0 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 1 ] -> 1;
[ .c. , 1 ] -> 1;
end
Q1 pin istype 'reg_D,buffer';
Clock,Preset pin;
equations
Q1.CLK = Clock;
Q1.D = !Q1.Q # Preset;
test_vectors ([Clock,Preset] -> Q1)
[ .c. , 1 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 0 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 1 ] -> 1;
[ .c. , 1 ] -> 1;
end
See Also