
`timescale 1us / 1ns

module Client (
    input clock,
    input [7:0] dataIn,
    input inputStrobe,
    output [7:0] dataOut
    );

    reg [7:0] dataStore;

    assign dataOut = dataStore + 1;

    always @(posedge clock)		// On rising clock edge
	if (inputStrobe)		// If there is new data ...
	    dataStore <= dataIn;	//  store it locally
    endmodule

/* ///////////////////////////////////////////////////////////////////////// */

`timescale 1us / 1ns

module Server;

    reg sysClock;
    reg [7:0] data;
    reg strobe;

    wire [7:0] inPlusOne;

    Client aClient (sysClock, data, strobe, inPlusOne);

    always begin			// Clock generator
	#1 sysClock <= 0;
	#1 sysClock <= 1;
	end

    initial begin			// Simple testbench to feed a couple
	sysClock <= 1;			//  of bytes to the client
	data <= 0;
	strobe <= 0;

	#6 data <= 1;
	strobe <= 1;
	#2 strobe <= 0;

	#6 data <= 2;
	strobe <= 1;
	#2 strobe <= 0;

	#10 $finish;

	end

    endmodule
