Zero Consecutive Count Block:
- Add a digital counter (constructed from D flip-flops) that increments with each input "0".
- Use combinational logic (AND/OR gates) to detect when the counter reaches three consecutive zeros so that the circuit knows the next zero could trigger a substitution.
Pulse Generation & Substitution Logic:
- For a “1” input:
- Route the signal through an XOR gate with the stored polarity to create an output pulse of the proper sign.
- Reset the zero counter.
- For a “0” input:
- Use the counter output plus combinational logic (AND/OR) to condition when four consecutive zeros occur.
- Generate a violation pulse (using additional XOR gates to match the required polarity transition) on the fourth zero while enforcing the rule (B00V pattern).
- Allow normal zero outputs when fewer than four zeros occur.