⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clip.v

📁 一个视频信号输入的verilog源代码
💻 V
字号:
// ================================================================================
// (c) 2004 Altera Corporation. All rights reserved.
// Altera products are protected under numerous U.S. and foreign patents, maskwork
// rights, copyrights and other intellectual property laws.
// 
// This reference design file, and your use thereof, is subject to and governed
// by the terms and conditions of the applicable Altera Reference Design License
// Agreement (either as signed by you, agreed by you upon download or as a
// "click-through" agreement upon installation andor found at www.altera.com).
// By using this reference design file, you indicate your acceptance of such terms
// and conditions between you and Altera Corporation.  In the event that you do
// not agree with such terms and conditions, you may not use the reference design
// file and please promptly destroy any copies you have made.
// 
// This reference design file is being provided on an "as-is" basis and as an
// accommodation and therefore all warranties, representations or guarantees of
// any kind (whether express, implied or statutory) including, without limitation,
// warranties of merchantability, non-infringement, or fitness for a particular
// purpose, are specifically disclaimed.  By making this reference design file
// available, Altera expressly does not recommend, suggest or require that this
// reference design file be used in combination with any other product not
// provided by Altera.
// ================================================================================
//---------------------------------------------------------------------------
// Input clipping
//---------------------------------------------------------------------------
`timescale 1ns/1ns

module clip (
	     clk,

	     // input samples and timing
	     clk_in_en,
	     y_in,
	     cb_in,
	     cr_in,
	     pixel,
	     line,

	     // output samples
	     clk_out_en,
	     y_out,
	     cb_out,
	     cr_out,

	     // clipping registers
	     xclips,
	     xclipe,
	     yclips,
	     yclipe
);

  input clk;		// 27 MHz

  // input samples and timing
  input clk_in_en;
  input [7:0] y_in;
  input [7:0] cb_in;
  input [7:0] cr_in;
  input [9:0] pixel;
  input [8:0] line;
  
  // output samples
  output       clk_out_en;
  output [7:0]  y_out;
  output [7:0]  cb_out;
  output [7:0]  cr_out;

  // clipping registers
  input [9:0]  xclips;
  input [9:0]  xclipe;
  input [8:0]  yclips;
  input [8:0]  yclipe;

  wire 	       clip_x = (pixel < xclips) | (pixel > xclipe);
  wire 	       clip_y = (line < yclips) | (line > yclipe);

  wire 	       clk_out_en = clk_in_en & ~clip_x & ~clip_y;

  wire [7:0]   y_out = y_in;
  wire [7:0]   cb_out = cb_in;
  wire [7:0]   cr_out = cr_in;

endmodule	// clip

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -