Modified Frequency Modulation
Encyclopedia
Modified Frequency Modulation, commonly MFM, is a line coding
scheme used to encode the actual data-bits on most floppy disk
formats, hardware examples include Amiga
, most CP/M machines as well as IBM PC compatible
s. Early hard disk drives also used this coding.
MFM is a modification to the original FM (frequency modulation
) scheme for encoding data on single-density floppy disks. Because the minimum spacing between flux transitions is a property of the disk and head design, MFM, which guarantees at most one flux transition per data bit, can be written at higher density than FM, which can require two transitions per data bit. It is used with a data rate of kbit/s ( kbit/s encoded) on industry standard 5¼" and 3½" ordinary and high density diskettes. MFM was also used in early hard disk
designs, before the advent of more efficient types of Run Length Limited (RLL)
coding. Except for the steadily disappearing 880 kiB and 1.4 MiB floppy disk formats, MFM encoding is obsolete.
encoded when written to disk. A 1 bit represents a magnetic transition, and a 0 bit no transition. There are limits on the minimum and maximum number of 0 bits that may appear between consecutive 1 bits.
MFM encoding can be thought of as having data bits separated by clock bits. The basic encoding rule is that (x, y, z, ...) encodes to (x, x NOR
y, y, y NOR z, z, z NOR...). On average this means that each data bit is encoded as two bits on disk, but some delimiters are required at the beginning and end of a sequence, so this limit is never quite reached in practice.
Note that the surrounding clock bits are sometimes known, but sometimes require knowledge of the adjacent data bits. A longer example:
Data: 0 0 0 1 1 0 1 1
Clock: ? 1 1 0 0 0 0 0 0
Encoded: ?0101001010001010
(The bold bits are the data bits, the others are the clock bits.)
Notice that there is a minimum of 1 zero bit between adjacent ones (there are never two adjacent one bits), and the maximum number of zeros in a row is 3. Thus, MFM is a (1,3) RLL
code.
A special “sync mark” is used to allow the disk controller to figure out where the data starts. This sync mark has two important properties: it has no runs of zeros shorter than 1 or longer than 3 (i.e. it follows the (1,3) RLL rules), and it will never occur in any bit position in any encoded data stream. The sync mark used is called an “A1 sync” since the data bits form the hexadecimal
value A1 (10100001).
Data: 1 0 1 0 0 0 0 1
Clock: 0 0 0 1 1 1 0
Encoded: 100010010101001
Sync clock: 0 0 0 1 0 1 0
Sync Mark: 100010010001001
^ Missing clock bit
The shortest possible sync bit pattern, which follows the (1,3) RLL coding rules but cannot be produced by normal MFM coding, is the first 12 encoded bits of the above: 100010010001.
Data: 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1
Clock: 0 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0
Encoded: 01010001001001001000010010001001001000100001
In this system, sync marks are made by inserting additional clock pulses between adjacent zero bits (following the MFM rule) where they would normally be omitted. In particular, the data bit pattern "10001" has a clock pulse inserted in the middle, where it would normally be omitted:
Data: 1 0 0 0 0 1
Normal: 0 1 0 1 0
Sync: 0 1 1 1 0
Line code
In telecommunication, a line code is a code chosen for use within a communications system for baseband transmission purposes...
scheme used to encode the actual data-bits on most floppy disk
Floppy disk
A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...
formats, hardware examples include Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...
, most CP/M machines as well as IBM PC compatible
IBM PC compatible
IBM PC compatible computers are those generally similar to the original IBM PC, XT, and AT. Such computers used to be referred to as PC clones, or IBM clones since they almost exactly duplicated all the significant features of the PC architecture, facilitated by various manufacturers' ability to...
s. Early hard disk drives also used this coding.
MFM is a modification to the original FM (frequency modulation
Frequency modulation
In telecommunications and signal processing, frequency modulation conveys information over a carrier wave by varying its instantaneous frequency. This contrasts with amplitude modulation, in which the amplitude of the carrier is varied while its frequency remains constant...
) scheme for encoding data on single-density floppy disks. Because the minimum spacing between flux transitions is a property of the disk and head design, MFM, which guarantees at most one flux transition per data bit, can be written at higher density than FM, which can require two transitions per data bit. It is used with a data rate of kbit/s ( kbit/s encoded) on industry standard 5¼" and 3½" ordinary and high density diskettes. MFM was also used in early hard disk
Hard disk
A hard disk drive is a non-volatile, random access digital magnetic data storage device. It features rotating rigid platters on a motor-driven spindle within a protective enclosure. Data is magnetically read from and written to the platter by read/write heads that float on a film of air above the...
designs, before the advent of more efficient types of Run Length Limited (RLL)
Run Length Limited
Run length limited or RLL coding is a line coding technique that is used to send arbitrary data over a communications channel with bandwidth limits. This is used in both telecommunication and storage systems which move a medium past a fixed head. Specifically, RLL bounds the length of stretches ...
coding. Except for the steadily disappearing 880 kiB and 1.4 MiB floppy disk formats, MFM encoding is obsolete.
Coding
As is standard when discussing hard drive encoding schemes, MFM encoding produces a bit stream which is NRZINon-return-to-zero
In telecommunication, a non-return-to-zero line code is a binary code in which 1's are represented by one significant condition and 0's are represented by some other significant condition , with no other neutral or rest condition. The pulses have more energy than a RZ code...
encoded when written to disk. A 1 bit represents a magnetic transition, and a 0 bit no transition. There are limits on the minimum and maximum number of 0 bits that may appear between consecutive 1 bits.
MFM encoding can be thought of as having data bits separated by clock bits. The basic encoding rule is that (x, y, z, ...) encodes to (x, x NOR
Logical NOR
In boolean logic, logical nor or joint denial is a truth-functional operator which produces a result that is the negation of logical or. That is, a sentence of the form is true precisely when neither p nor q is true—i.e. when both of p and q are false...
y, y, y NOR z, z, z NOR...). On average this means that each data bit is encoded as two bits on disk, but some delimiters are required at the beginning and end of a sequence, so this limit is never quite reached in practice.
Data | ... 0 0 ... | ... 0 1 ... | ... 1 0 ... | ... 1 1 ... |
---|---|---|---|---|
Clock bits | ...? 1 ?... | ...? 0 0... | ...0 0 ?... | ...0 0 0... |
MFM encoding | ...?010?... | ...?0010... | ...0100?... | ...01010... |
Note that the surrounding clock bits are sometimes known, but sometimes require knowledge of the adjacent data bits. A longer example:
Data: 0 0 0 1 1 0 1 1
Clock: ? 1 1 0 0 0 0 0 0
Encoded: ?0101001010001010
(The bold bits are the data bits, the others are the clock bits.)
Notice that there is a minimum of 1 zero bit between adjacent ones (there are never two adjacent one bits), and the maximum number of zeros in a row is 3. Thus, MFM is a (1,3) RLL
Run Length Limited
Run length limited or RLL coding is a line coding technique that is used to send arbitrary data over a communications channel with bandwidth limits. This is used in both telecommunication and storage systems which move a medium past a fixed head. Specifically, RLL bounds the length of stretches ...
code.
A special “sync mark” is used to allow the disk controller to figure out where the data starts. This sync mark has two important properties: it has no runs of zeros shorter than 1 or longer than 3 (i.e. it follows the (1,3) RLL rules), and it will never occur in any bit position in any encoded data stream. The sync mark used is called an “A1 sync” since the data bits form the hexadecimal
Hexadecimal
In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...
value A1 (10100001).
Data: 1 0 1 0 0 0 0 1
Clock: 0 0 0 1 1 1 0
Encoded: 100010010101001
Sync clock: 0 0 0 1 0 1 0
Sync Mark: 100010010001001
^ Missing clock bit
The shortest possible sync bit pattern, which follows the (1,3) RLL coding rules but cannot be produced by normal MFM coding, is the first 12 encoded bits of the above: 100010010001.
MMFM
MMFM, (Modified Modified Frequency Modulation), also abbreviated M²FM, or M2FM, is similar to MFM, but suppresses additional clock bits, producing a longer maximum run length (a (1,4) RLL code). In particular, a clock pulse is only inserted between a pair of adjacent 0 bits if the first bit of the pair did not have a clock pulse inserted before it. In the example below, clock bits that would have been present in MFM are noted in bold:Data: 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1
Clock: 0 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0
Encoded: 01010001001001001000010010001001001000100001
In this system, sync marks are made by inserting additional clock pulses between adjacent zero bits (following the MFM rule) where they would normally be omitted. In particular, the data bit pattern "10001" has a clock pulse inserted in the middle, where it would normally be omitted:
Data: 1 0 0 0 0 1
Normal: 0 1 0 1 0
Sync: 0 1 1 1 0