Abstract-We study the optimal maximum likelihood (ML) block decoding of general binary codes sent over two classes of binary additive noise channels with memory. Specifically, we consider the infinite and finite memory Polya contagion and queue-based channel models, which were recently shown to approximate well binary modulated correlated fading channels used with hard-decision demodulation. We establish conditions on the codes and channels parameters under which ML and minimum Hamming distance decoding are equivalent. We also present results on the optimality of classical perfect and quasi-perfect codes when used over the channels under ML decoding. Finally, we briefly apply these results to the dual problem of syndrome source coding with and without side information.Index Terms-Binary channels with finite and infinite memory, Markov noise, ML and minimum distance decoding, block codes, source-channel coding duality, syndrome source coding.