module CrossHairs (clk, BrightRow, BrightCol, ReadData, vcnt, hcnt, PixelDataOut, LaserPoint); // // Input // input clk ; input [7:0] BrightRow ; //Brightest pixel in the image is in this row input [7:0] BrightCol ; //Brightest pixel in the image is in this col input [7:0] ReadData ; //pixel data read from memory input [7:0] vcnt ; //pixel column read from memory input [7:0] hcnt ; //pixel row read from memory input LaserPoint ; // // Output // output [7:0] PixelDataOut ; // // Output registers // reg [7:0] PixelDataOut ; // // Basically, this module determines if the current row and // column being read from memory has a laser point in it. If // it does, then purple cross-hairs are displayed on the image, // otherwise the purple cross-hairs are not displayed. // // Note that there is a one cycle delay from getting the data // from memory and sending the address to memory. Thus, our // row and column will be one pixel out of sync. This can be // fixed at a later date. // always @ (posedge clk) begin if (LaserPoint) //There was a laser point detected in this image begin if ((BrightRow == vcnt ) || (BrightCol == hcnt )) // If the current row == the brightest row in the image, or the current // column == the brightest column in the image, display the pixel as a // purple pixel (this will create the cross hairs). PixelDataOut = 255; else // Otherwise, pass the original pixel data read from memory to the // VGA block. In there, if the pixel data is < 200, the display // will print a black pixel to the screen instead. This is the // way we implement color mapping. Any pixel below 200 is displayed // as a black pixel. if (ReadData > 250) PixelDataOut = ReadData; else PixelDataOut = 0; end else // There is no laser point in the image, so don't display any // purple pixels (this removes the purple cross hairs from // being displayed in the image). PixelDataOut = ReadData; end //end always endmodule