MFM
MFM
MFM is an acronym for "Modified Frequency Modulation" and is a data encoding used on floppy discs. It is used by the NEC 765.
MFM is stored as flux transitions on the disc. The flux transitions are converted by the read/write head into a 1 or 0.
MFM stores data as a stream of bits with clock bits and data bits interleaved. Clock bits are transmitted first and their value is the NOR of the previous data bit and the current data bit. Data is transmitted starting with bit 7 down to bit 0.
e.g. <clock for bit 7> <bit 7> <clock for bit 6> <bit 6> <clock for bit 5> <bit 5>...
<clock for bit 5> = <bit 6> EOR <bit 5>
Each clock and data bit on disc is 2microseconds in duration which means a full byte is 32 microseconds (2 * 16 bits).
There is a specific bit pattern which is used for syncing. i.e. to ensure the data stream following it is always the same.
This special value is 4489. This is the pattern for clock and data, with a "missing clock" (in reality a single clock bit is forced to 0) and assumes that the data bit proceeding this has a value of 0 so that the first clock bit (bit 15) is 0. The data byte value of 4489 is 0x0a1. It is unique because the corresponding value computed from 0x0a1 has all the correct clocks and bits will not match this value.