MFM

From CPCWiki - THE Amstrad CPC encyclopedia!
Revision as of 09:58, 29 July 2018 by Arnoldemu (Talk | contribs)

Jump to: navigation, search

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).

Syncing

In order to read the data correctly and to ensure the bits are in the expected order a specific bit pattern is used for syncing. When this pattern is recognised then all data following is synced and will always read the same.

This special value is 4489 and has the following properties.

  • 4489 is an encoded version of the data byte A1 and has bit 7 set. It doesn't matter what the value of the previous byte is, the first clock of 4489 will always be 0. Therefore the pattern 4489 can't be influenced by data around it.
  • To make the value special, it has a "missing clock". What this means is that one of the clocks is forced to 0. The equivalent A1 byte encoded to MFM without the missing clock is different, therefore it is unique.