/*
 A simple counter-based strobe pulse stretcher

 Copyright (c) 2006 Dimtel, Inc., All Rights Reserved

 $Id: stretch.v,v 1.1.1.1 2009/02/05 07:20:51 dim Exp $
 $Date: 2009/02/05 07:20:51 $
 $Author: dim $
 $Revision: 1.1.1.1 $
 $Log: stretch.v,v $
 Revision 1.1.1.1  2009/02/05 07:20:51  dim
 Initial import

 Revision 1.1  2007/02/09 00:35:50  dim
 Final 16-bit version of the gateware

*/

module stretch(
  input		clk,
  input		strobe,
  output 	bus_active
);
  reg [15:0] cnt = 16'b0;
  
  assign bus_active = ~(cnt == 16'b0);
  always @(posedge clk) cnt <= (strobe)     ? 16'b1 : 
                               (bus_active) ? cnt + 16'b1 : 16'b0;
endmodule // stretch
