module SendInfo (BrightRow, BrightCol, Bank, LaserPoint, clk, ReadReg, AddressCom, Row, Col, Send) ; // // Input signals // input [7:0] BrightRow ; input [7:0] BrightCol ; input [1:0] Bank ; input LaserPoint; input clk ; input ReadReg ; input [1:0] AddressCom ; // // Output signals // output [7:0] Row ; output [7:0] Col ; output Send ; // // Registered outputs, local variables, and wires // reg [1:0] PreviousBank ; //Internal variable to keep track of the previous mem bank reg Send ; //Send signal that lets the MicroController know data is ready wire [7:0] Row ; //The row and col info is always on the output lines so wire [7:0] Col ; // we don't need to register these values // Always put the row and col information on the data lines. // This info will only be read by the MicroController if the // send bit is asserted assign Row = BrightRow; assign Col = BrightCol; // We assert the Send bit only when the bank is different than the last // clock cycle and there is a valid laser point in this new image. As // soon as the MicroController sees that the valid bit is set, we need // to clear the Send bit. always @ (posedge clk) begin //Always remember the previous data bank PreviousBank <= Bank; //Set the Send bit so the MicroController will read this good data if ( (PreviousBank != Bank) && (LaserPoint == 1) ) Send = 1; //Reset the Send bit once the MicroController sees that we want it // to read our row and col data. if (ReadReg && (AddressCom == 2) ) Send = 0; end //end always endmodule