module MarkSpaceTimer 
  #(parameter TIME_WIDTH = 16)
   (input  wire clock,				// 20 µs (50 KHz) clock
    input  wire rawInput,			// Raw Morse code signal
    output reg [TIME_WIDTH-1 : 0] eventType,	// MARK (1) or SPACE (0)
    output reg [TIME_WIDTH-1 : 0] eventDuration,// Length of mark or space, in
						//  20 µs units
    output reg newEvent);			// Pulsed once for each event