2024-05-01 04:48:10 +00:00
|
|
|
module pixgen #(
|
|
|
|
parameter integer X_DEPTH = 9,
|
|
|
|
parameter integer Y_DEPTH = 9,
|
|
|
|
parameter integer RGB_DEPTH = 24
|
|
|
|
) (
|
|
|
|
input clk,
|
|
|
|
input start,
|
|
|
|
input [X_DEPTH-1:0] x,
|
|
|
|
input [Y_DEPTH-1:0] y,
|
2024-05-03 01:30:51 +00:00
|
|
|
input [7:0] frame,
|
2024-05-01 04:48:10 +00:00
|
|
|
output reg [RGB_DEPTH-1:0] rgb,
|
|
|
|
output reg done
|
|
|
|
);
|
|
|
|
|
|
|
|
// given x and y inputs, create an rgb output
|
|
|
|
|
|
|
|
always @(posedge clk) begin
|
|
|
|
if (start) begin
|
|
|
|
done <= 1;
|
2024-05-03 01:30:51 +00:00
|
|
|
rgb <= { x[6:0], 1'b0, frame, y[5:0], 2'b0};
|
2024-05-01 04:48:10 +00:00
|
|
|
end
|
|
|
|
else done <= 0;
|
|
|
|
end
|
|
|
|
|
|
|
|
endmodule
|