亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? lwbsaa7113.v

?? FPGA數(shù)字電子系統(tǒng)設(shè)計(jì)與開(kāi)發(fā)實(shí)例導(dǎo)航光盤(pán)內(nèi)附源碼
?? V
字號(hào):
/////////////////////////////////////////////////////////////////////
////                                                             ////
////             LWB rev 1.2 -- SAA7113 Control Logic            ////
////                                                             ////
////                                                             ////
////                 Author: Liu Tao                             ////
////          liutao94@tsinghua.org.cn                           ////
////                                                             ////
////                                                             ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
////                                                             ////
////               Copyright (C) 2003 Liu Tao                    ////
////               liutao94@tsinghua.org.cn                      ////
////                                                             ////
////                                                             ////
/////////////////////////////////////////////////////////////////////

`include "timescale.v"

module LWBSAA7113 (reset,clk,llck,vpo,rst,capture,error,SRAM_CE_,SRAM_OE_,SRAM_WE_,la,ld);

	//=================================================================================
	//input
	//=================================================================================

	    /*___________________________________________________ */
		//reset
		input reset;//
	    /*___________________________________________________ */
		//from saa7113
		input clk;//50MHz clock
		input llck;//SAA7113 video clock (27 MHz)
		input [7:0] vpo;//data from SAA7113
		input [1:0] rst;//real-time video status
		input capture;//flag for grab video data


	//=================================================================================
	//output
	//=================================================================================
	    /*___________________________________________________ */
		//to sram
		output error;//state indicator,to LED
		output SRAM_CE_;
		output SRAM_OE_;
		output SRAM_WE_;
		output [18:0] la;//address bus to sram
		output [7:0] ld;//data bus to sram
		
	//=================================================================================
	//reg
	//=================================================================================

	    /*___________________________________________________ */
		//video in state machine declaration
		reg [3:0] presState;//
		reg [3:0] nextState;//
		reg [3:0] returnState;
		reg [3:0] nextReturnState;

	//=================================================================================
	//parameters
	//=================================================================================

	    /*___________________________________________________ */
		//state declaration
		parameter 	stIdle = 4'b0000;//IDLE STATE,START UP OF A STATE MACHINE,RESET
		parameter	stWaitForEscape = 4'b0001;//CHECK FOR "FF",START OF TIMING REFERENCE CODE
		parameter	stCheckEscape1 = 4'b0010;//CHECK FOR "00",SECOND
		parameter	stCheckEscape2 = 4'b0011;//CHECK FOR "00",THIRD
		parameter	stCheckForNewPage = 4'b0100;//CHECK FOR "01",It is in vertical blanking stage,
		parameter	stCheckForFirstLine = 4'b0101;//CHECK FOR "000",for SAV in valid row
		parameter	stChromaBlue = 4'b0110;//write Cb to sram,here not in use
		parameter	stLumaBlue = 4'b0111;//write Lb to sram
		parameter	stChromaRed = 4'b1000;//write Cr to sram,not in use
		parameter	stLumaRed = 4'b1001;//write Lr to sram,
		parameter	stCheckForEndLine = 4'b1010;//CHECK for end of line
		parameter	stCheckForNewLine = 4'b1011;//CHECK for new line
		parameter	stError = 4'b1100;//ERROR state
	

	//=================================================================================
	//wires
	//=================================================================================

	    /*___________________________________________________ */
		//vpo data from saa7113
		reg [7:0] vpoLatch;//synchronise data on the vpo bus to LLCK
		reg [7:0] luminanceB;
		reg [7:0] luminanceR;
		reg [7:0] chrominanceB;//not use now
		reg [7:0] chrominanceR;//not use now
		reg [7:0] nextLuminanceB;
		reg [7:0] nextLuminanceR;
		reg [7:0] nextChrominanceB;//not use now
		reg [7:0] nextChrominanceR;//not use now

		reg [8:0] grab_cntr_hori;//counter for horizon 720
		reg [8:0] grab_cntr_vert;//counter for vertical 286
		reg clr_grab_cntr;//clear both grab counters
		reg inc_grab_hori;//increment horizontal counter for each 2 pixels
		reg inc_grab_vert;//increment vertical counter and clear horizontal counter
		reg field;//0 for 1st field,1 for 2nd field
		reg nextField;//remember next field

		reg grab;//write current data
		reg nextGrab;

		wire [18:0] grab_addr;
		reg [18:0] write_addr;
		reg [7:0] writeData;
		reg write;
		reg lastwrite;
		reg dowrite;
//		reg capture;//
		reg error;


	//=================================================================================
	//hookup sram interface
	//=================================================================================
	    /*___________________________________________________ */
		//address
		LWBSRAM L_SRAM (
			.clk(clk),
			.reset(reset),
			.doWrite(dowrite),
			.writeAddr(write_addr),
			.writeData(writeData),
			.SRAM_CE_(SRAM_CE_),
			.SRAM_OE_(SRAM_OE_),
			.SRAM_WE_(SRAM_WE_),
			.SRAM_ADDR(la),
			.SRAM_DATA(ld)		
		);



	//=================================================================================
	//Assigning
	//=================================================================================
	    /*___________________________________________________ */
		//address
		assign grab_addr = {grab_cntr_vert,field,grab_cntr_hori};


		//colour calculations:  these have not been fully tested and may need to be edited	
		//These convert the YUV data to RGB
		//	red = ("00" & luminanceB & x"00") + (("01" & x"24") * chrominanceR) - ("00" & x"7D00");
		//	blue <= ("00" & luminanceB & x"00") + (("10" & x"07") * chrominanceB) - ("00" & x"EE80");
		//	green <= ("00" & luminanceB & x"00") + ("00" & x"9200") - (("00" & x"65") * chrominanceB) - (("00" & x"95") * chrominanceR);

	




	//=================================================================================
	//State Machine
	//=================================================================================


	    /*___________________________________________________ */
		//write data to sram

		


	    /*___________________________________________________ */
		//write data to sram
		always @(posedge llck or negedge reset)
			if (!reset)
				begin
					presState <= stIdle;
					grab <= 1'b0;		
					returnState <= stIdle;
					field <= 1'b0;
					grab_cntr_hori <= 1'b0;
					grab_cntr_vert <= 1'b0;

				end
			else 
				begin
					vpoLatch <= vpo;//synchronize asynchronous data
					presState <= nextState;// go to next state
					grab <= nextGrab;//delay so colour can be calculated

					returnState <= nextReturnState;
					field <= nextField;
					chrominanceR <= nextChrominanceR;
					chrominanceB <= nextChrominanceB;
					luminanceR <= nextLuminanceR;			
					luminanceB <= nextLuminanceB;	
					
					if (nextGrab)
						write_addr <= grab_addr;//give write address plenty of setup time

					if (grab)  //note that this is executed 1 cycle after nextGrab is seen to go high.
						begin
//							writeData <= '0' & colour;		-- high colour (15 bit) full colour.  360 double pixels wide.
							writeData <= luminanceR;
							write <= 1'b1;
						end
					else 
						write <= 1'b0;

					// operate on the grab counters for vertical and horizontal movement
					if (clr_grab_cntr)
						begin
							grab_cntr_hori <= 1'b0;
							grab_cntr_vert <= 1'b0;
						end
					else 
						if (inc_grab_hori == 1)
							grab_cntr_hori <= grab_cntr_hori + 1;

						if (inc_grab_vert == 1)
							begin
								grab_cntr_vert <= grab_cntr_vert + 1;
								grab_cntr_hori <= 1'b0; // clear horizontal counter with each new line
							end
				end

	    /*___________________________________________________ */
		//grab data from vpo bus
		always @(presState or vpoLatch or returnState or field or luminanceB or luminanceR or chrominanceB or chrominanceR or capture)
			begin
				//default signal values
				clr_grab_cntr <= 1'b0;
				inc_grab_hori <= 1'b0;
				inc_grab_vert <= 1'b0;

				nextGrab <= 1'b0;
	
				nextReturnState <= returnState;
				nextField <= field;
				nextLuminanceB <= luminanceB;
				nextLuminanceR <= luminanceR;
				nextChrominanceB <= chrominanceB;
				nextChrominanceR <= chrominanceR;	
	
				error <= 1'b0;

				//state machine
				case (presState)
					stIdle://
						if (capture == 1'b1)
							begin
								nextState <= stWaitForEscape;	// Look for an escape sequence
								nextReturnState <= stCheckForNewPage;// Check for start of field 0
							end
						else
							nextState <= stIdle;

					stWaitForEscape://Look for the first character in the sequence, keep looking until found
						if (vpoLatch == 8'hFF)
							nextState <= stCheckEscape1;
						else
							nextState <= stWaitForEscape;

					stCheckEscape1://Second character in the escape sequence is 0
						if (vpoLatch == 8'h00)
							nextState <= stCheckEscape2;
						else
							nextState <= stError;

					stCheckEscape2://Third charcter in the escape sequence is 0.  Go to returnState to check SAV/EAV code
						if (vpoLatch == 8'h00)
							nextState <= returnState;
						else
							nextState <= stError;

					stCheckForNewPage://Wait for an SAV or EAV in field 0 while in the vertical blanking stage
						if (vpoLatch[6:5] == 2'b01) //If it is then wait until the first line of active video
							begin
								nextState <= stWaitForEscape;
								nextReturnState <= stCheckForFirstLine;
								clr_grab_cntr <= 1'b1;//initialise counter
							end
						else  //Look for another SAV/EAV until we find the type we want.
							begin
								nextState <= stWaitForEscape;
								nextReturnState <= stCheckForNewPage;
							end

					stCheckForFirstLine://Wait for an SAV in field 0 while in the active video region
						if (vpoLatch[6:4] == 3'b000)  //start recording data
							begin
								nextState <= stChromaBlue;
								nextField <= 1'b0;//initialise field
							end
						else  //Look for another SAV/EAV until we find the type we want.
							begin
								nextState <= stWaitForEscape;
								nextReturnState <= stCheckForFirstLine;
							end
	
					stChromaBlue://This may be the start of another pair of pixels or the end of data
						if (vpoLatch == 8'hFF) //If the byte is FF then it is the start of the EAV.
							begin
								nextState <= stCheckEscape1;//Go to second state of subroutine
								nextReturnState <= stCheckForEndLine;//Check if this is the last line of the field
							end
						else if (vpoLatch == 8'h00)
							nextState <= stError;			
						else //latch data into register and continue
							begin
								nextState <= stLumaBlue;
								nextChrominanceB <= vpoLatch;
							end

					stLumaBlue://As long as valid data is present continue latching data
						if ((vpoLatch !== 8'hFF) && (vpoLatch !== 8'h00))
							begin
								nextState <= stChromaRed;
								nextLuminanceB <= vpoLatch;
							end
						else
							nextState <= stError;
							
					stChromaRed://As long as valid data is present continue latching data
						if ((vpoLatch !== 8'hFF) && (vpoLatch !== 8'h00))
							begin
								nextState <= stLumaRed;
								nextChrominanceR <= vpoLatch;
							end
						else
							nextState <= stError;

					stLumaRed://As long as valid data is present continue latching data and setup to write current data
						if ((vpoLatch !== 8'hFF) && (vpoLatch !== 8'h00))
							begin
								nextState <= stChromaBlue;
								nextLuminanceR <= vpoLatch;
								nextGrab <= 1'b1;//Set up a write after a delay (see clocked process)
								inc_grab_hori <= 1'b1;//Increment horizontal counter every two pixels
							end
						else
							nextState <= stError;

					stCheckForEndLine://possible conditions here are the end of field 0, end of field 1,or an EAV code indicating a new line in the active region.					
						if (vpoLatch[6:4] == 3'b111) //end of field 1
							nextState <= stIdle;
						else if (vpoLatch[6:4] == 3'b011) //end of field 0
							begin
								clr_grab_cntr <= 1'b1;//reset counter for field 1
								nextState <= stWaitForEscape;
								nextReturnState <= stCheckForNewLine;//start capture at first new line
							end
						else if (vpoLatch[5:4] == 2'b01) //end of line
							begin
								inc_grab_vert <= 1'b1;	// go to next line
								nextState <= stWaitForEscape;
								nextReturnState <= stCheckForNewLine;//capture next line from start
							end
						else // EAV expected but SAV received
							nextState <= stError;

					stCheckForNewLine://Wait until an SAV in the active video range arrives
						if (vpoLatch[5:4] == 2'b00)
							begin
								nextState <= stChromaBlue;// capture next line
								nextField <= vpoLatch[6];
							end
						else	// Wait for another code
							begin
								nextState <= stWaitForEscape;
								nextReturnState <= stCheckForNewLine;
							end

					stError://Wait until another capture is requested before continuing
						if (capture == 1'b1)
							begin
								nextState <= stWaitForEscape;
								nextReturnState <= stCheckForNewPage;
							end
						else
							begin
								nextState <= stError;
								error <= 1'b1;//indicate error on error LED
							end

					default:
						nextState <= stError;

				endcase
			end



	    /*___________________________________________________ */
		//synchronizes writes to the 50MHz clock
		always @(negedge reset or posedge clk)
			if(!reset)
				begin
					dowrite <= 1'b0;
					lastwrite <= 1'b0;
				end
			else
				begin
					lastwrite <= write;
					if (!write && lastwrite)
						dowrite <= 1'b1;
					else
						dowrite <= 1'b0;

				end



endmodule

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲av一区二区嗯嗯嗯啊| 成人爱爱电影网址| 中文字幕免费不卡| 欧美色精品天天在线观看视频| 国内久久婷婷综合| 丝袜美腿亚洲色图| 亚洲日韩欧美一区二区在线| www国产精品av| 欧美精品久久99久久在免费线| 成人一区在线观看| 极品瑜伽女神91| 亚洲成a人v欧美综合天堂下载| 国产在线播放一区三区四| 一区二区三区四区不卡在线| 久久久国际精品| 国产精品白丝在线| 欧美一区二区在线观看| 色综合欧美在线| 成人看片黄a免费看在线| 免费成人性网站| 亚洲成人动漫精品| 亚洲精品欧美在线| 亚洲免费av在线| 中文字幕制服丝袜成人av| 久久午夜羞羞影院免费观看| 3d成人h动漫网站入口| 欧美在线播放高清精品| 91久久免费观看| 色欧美日韩亚洲| 日本二三区不卡| 91免费版pro下载短视频| 99久久精品免费看| www.欧美亚洲| 波多野结衣中文一区| 成人永久免费视频| 欧美一区二区三区在线电影| 亚洲午夜av在线| 亚洲欧美日韩国产成人精品影院 | 一区二区不卡在线播放| 亚洲九九爱视频| 一区二区三区高清不卡| 一区二区三区在线免费| 一级日本不卡的影视| 亚洲国产综合色| 午夜精品在线视频一区| 日韩电影在线看| 国内精品国产成人国产三级粉色 | 成人黄色国产精品网站大全在线免费观看 | 波多野结衣中文字幕一区二区三区| 国产精品影视在线| 顶级嫩模精品视频在线看| av激情亚洲男人天堂| 日本韩国欧美在线| 中文字幕精品在线不卡| 欧美日韩在线免费视频| 在线欧美一区二区| 88在线观看91蜜桃国自产| 日韩一级视频免费观看在线| 日韩精品一区二区三区四区 | 9色porny自拍视频一区二区| 91麻豆精品在线观看| 在线国产电影不卡| 91.成人天堂一区| 久久一区二区视频| 亚洲特黄一级片| 天堂va蜜桃一区二区三区 | 欧美丝袜自拍制服另类| 欧美一级高清片| 中文欧美字幕免费| 亚洲综合一区在线| 免费的成人av| 不卡高清视频专区| 欧美日韩成人一区| 国产情人综合久久777777| 亚洲人吸女人奶水| 日韩va欧美va亚洲va久久| 国产丶欧美丶日本不卡视频| 色综合久久久久综合| 欧美一级夜夜爽| 亚洲欧洲精品一区二区三区| 香港成人在线视频| 国产成人精品午夜视频免费| 欧美性xxxxxx少妇| 久久久午夜精品| 亚洲成人精品在线观看| 国产成人av影院| 欧美精品丝袜久久久中文字幕| 久久久午夜精品理论片中文字幕| 一区二区视频在线看| 国产呦萝稀缺另类资源| 欧美午夜电影网| 国产欧美日韩另类视频免费观看| 亚洲成人免费影院| 成人a区在线观看| 精品国产凹凸成av人导航| 亚洲欧美另类在线| 国产精品一二三区| 欧美福利视频一区| 最新久久zyz资源站| 粉嫩av一区二区三区粉嫩| 91精选在线观看| 亚洲天堂精品视频| 国产传媒欧美日韩成人| 欧美一区二区三级| 一区二区三区中文字幕精品精品| 国产高清在线精品| 亚洲精品一区二区三区香蕉 | 国产一区二区三区四| 欧美久久一区二区| 亚洲一二三四久久| 一区二区三区在线免费| 国产欧美精品一区二区色综合| 亚洲成人免费在线| 91天堂素人约啪| 国产精品污网站| 国产中文字幕一区| 欧美不卡一二三| 爽好多水快深点欧美视频| 欧洲亚洲国产日韩| 亚洲三级在线免费观看| 成人av电影在线观看| 国产欧美一区二区精品性色超碰| 蜜臀精品一区二区三区在线观看 | 一区二区三区四区在线| 97久久超碰国产精品电影| 中文无字幕一区二区三区| 国产精品一卡二| 久久久激情视频| 国产成人午夜片在线观看高清观看| 欧美刺激脚交jootjob| 美女视频免费一区| 欧美大白屁股肥臀xxxxxx| 玖玖九九国产精品| 日韩精品最新网址| 国产一区二区三区高清播放| 精品国产成人在线影院| 国产乱子伦视频一区二区三区 | 久久精品国产久精国产爱| 日韩西西人体444www| 蜜桃免费网站一区二区三区| 欧美成人性福生活免费看| 九九精品视频在线看| 日韩一级片在线观看| 高清久久久久久| 91精品国产综合久久蜜臀| 午夜精品一区二区三区免费视频 | 91福利社在线观看| 亚洲成a人在线观看| 91精品国产麻豆| 久久99国产精品麻豆| 久久久久久久精| 欧美丰满少妇xxxxx高潮对白| 天堂成人免费av电影一区| 日韩免费在线观看| 国产电影一区二区三区| 亚洲欧美在线视频| 欧美日本一区二区| 精品一区二区三区免费毛片爱| 久久久综合九色合综国产精品| 国产99精品国产| 亚洲永久免费视频| 日韩精品一区二区三区在线播放 | 秋霞电影网一区二区| 精品99一区二区| jlzzjlzz亚洲女人18| 亚洲午夜在线视频| 亚洲女子a中天字幕| 99精品欧美一区二区三区小说 | 日韩在线一区二区| 欧美第一区第二区| 99精品欧美一区二区三区综合在线| 亚洲一区av在线| 久久久久久久久一| 精品视频全国免费看| 另类的小说在线视频另类成人小视频在线| 日韩美女在线视频| 色综合久久99| 捆绑变态av一区二区三区| 中文字幕日韩av资源站| 91精品国产入口| jizzjizzjizz欧美| 免费在线一区观看| 中文字幕一区二区视频| 日韩午夜激情免费电影| 99热这里都是精品| 蜜臀精品一区二区三区在线观看 | 亚洲色欲色欲www| 精品久久久久久久久久久院品网| 96av麻豆蜜桃一区二区| 国内一区二区在线| 亚洲超丰满肉感bbw| 欧美高清一级片在线观看| 欧美一区二区观看视频| 91浏览器入口在线观看| 国产一区欧美二区| 日本不卡一区二区| 亚洲激情校园春色| 国产精品福利一区| 精品成人私密视频| 日韩欧美一级特黄在线播放|