基于BT1120协议生成SDI(HDMI)彩条

always @(posedge clk_148p5MHz or posedge rst) begin
	if (rst) begin
		vbank_end<=1'b0;		
	end
	else if (row_cnt=='d41   && col_cnt==TOTAL_COL) begin
		vbank_end<=1'b1;	
	end
	else begin
		vbank_end<=1'b0;
	end
end

always @(posedge clk_148p5MHz or posedge rst) begin
	if (rst) begin
		actvideo_end<=1'b0;		
	end
	else if (row_cnt=='d1121 && col_cnt==TOTAL_COL) begin
		actvideo_end<=1'b1;	
	end
	else begin
		actvideo_end<=1'b0;	
	end
end

always @(posedge clk_148p5MHz or posedge rst) begin
	if (rst) begin
		current_state<=VBANK;
	end
	else  begin
		current_state<=next_state;
	end
end

always @(*) begin
	case (current_state)
		VBANK:begin
			if(vbank_end==1'b1)begin
				next_state=ACTVIDEO;
			end
			else begin
				next_state=VBANK;
			end
		end
		ACTVIDEO:begin
			if (actvideo_end==1'b1)begin
				next_state=VBANK;
			end
			else begin
				next_state=ACTVIDEO;
			end
		end
	endcase 
end 

基于BT1120协议生成SDI(HDMI)彩条_第1张图片

你可能感兴趣的:(fpga开发)