Systems and methods are provided for encoding and decoding constrained
codes using an enumerative coding graph. The constrained code may contain
run-length and DC level limits. The enumerative coding graph contains a
series of states and each state has two branches that lead to other
states. Each state in the enumerative coding graph is assigned a
cardinality. Configuring the structure of the graph and the cardinalities
associated with each state allow the encoder to generate a code that
conforms to defined constraints.