Disk Line Codes: MFM and CD ROM

.

Disk line codes operate under constraints to conserve data.

The Floppy Disk double-density line code has alternate clock and data pulses, with the clock only present if there is no data either side.

We can design more advanced line codes within the same framework.


//
// (C) 2003 DJ Greaves, cbg.
// HPRLS example: MFM encode and decoder.
//


// Data input - will have a new bit every other clock cycle
  input din;

// Encoder state
  \A s0, s1, s2, s3, s4;


// Encoder FSM
  X(s0) := XFUN("xs0", din, s0, s1, s2, s3, s4);  
  X(s1) := XFUN("xs1", din, s0, s1, s2, s3, s4);  
  X(s2) := XFUN("xs2", din, s0, s1, s2, s3, s4);  
  X(s3) := XFUN("xs3", din, s0, s1, s2, s3, s4);  
  X(s4) := XFUN("xs5", din, s0, s1, s2, s3, s4);  

// One moore output for the encoded stream.
  output r;
  r = XFUN("xsr", s0, s1, s2, s3, s4);  


// Run length limitation - max of three consecutive zeros.
  always ~r => (X(r) \/ X(r, 2) \/ X(r, 3));



// Decoder: demodulate input data and also limit error propagation and latency
   output dout;
   dout = XFUN("xdec", r, X(r), X(r, 2), X(r,3), X(r, 4));


// Want valid output evey other clock cycle, but dont mind about the latency
// in the encoding and decoding process.

  output phaser;
  phaser = XFUN("xphaser", phaser);
  always X(phaser) == ~phaser;

// We could just have written:  X(phaser) = !phaser;

  match0 = din == dout;
  match1 = din == X(dout);
  match2 = din == X(dout, 2);
  match3 = din == X(dout, 3);
  match4 = din == X(dout, 4);

  // we assume the resulting design does not swap around which match it is using!
  always (phaser \/ match0 \/ match1  \/ match2 \/ match3 \/ match4);


// eof

Home.           SRG Talk. 12 March 2003. DJ Greaves. www.cl.cam.ac.uk.