`timescale 1ns / 1ps
module serializer(
input wire mipi_clk, //200Mhz
input wire pixel_clk, //21,04Mhz
input wire serial_valid ,
input wire [7:0] data_in,
output reg serial_output =0
);
always @(posedge pixel_clk)
begin
[639:0] line_buffer ---> Data is saved to line buffer
end
always @(posedge (mipi_clk / 8) )
begin
line_buffer[0,1,2....,639] ---> Serializer
end
always @(posedge mipi_clk)
begin
line_buffer[0] ---> As you said, we shift the data and give it to the output serially, and this process takes 8 steps.
line_buffer[1] ---> As you said, we shift the data and give it to the output serially, and this process takes 8 steps.
.
.
.
line_buffer[639] ---> As you said, we shift the data and give it to the output serially, and this process takes 8 steps.
end
endmodule