`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
//	Tony Kim
//	6.111 Lab2
//
// Module name: PosEdgePulse
// Description: Produces a pulse at positive transitions of `level_in' 
//
//////////////////////////////////////////////////////////////////////////////////
module PosEdgePulse(clk_27mhz, level_in, pulse_out);
    input clk_27mhz;
    input level_in;
    output pulse_out;

	reg prev = 1'b1;
	reg pulse_out;
	
	always @ (posedge clk_27mhz)
	begin
		pulse_out <= level_in && ~prev;
		prev      <= level_in;
	end
endmodule
