freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于fpga的交通燈控制系統(tǒng)的設(shè)計(jì)(參考版)

2024-12-10 02:27本頁面
  

【正文】 /*動(dòng)態(tài)位選 */ dispselect b2v_inst9(.clk(synthesized_wire_20), .d_out(synthesized_wire_17))。 /*顯示數(shù)據(jù)多路選擇 */ dispmux b2v_inst8(.d_in0(synthesized_wire_15), .d_in1(synthesized_wire_16),.sel(synthesized_wire_17),.d_out(synthesized_wire_14))。 /*交通信號(hào)燈的控制 */ control b2v_inst14(.sw1(sw), .rst(reset),.en_in(synthesized_wire_21),.red1(red1),.red2(red2),.yellow1( yellow1),.yellow2(yellow2),.green1(green1),.green2(green2))。 /*55 秒倒計(jì)時(shí) */ counter55 b2v_inst2(.c_clk(synthesized_wire_19), .rst(reset),.c_en(synthesized_wire_7),.c_out(synthesized_wire_0),.d_out0( synthesized_wire_9),.d_out1(synthesized_wire_10))。 /*倒計(jì)時(shí)時(shí)間選擇驅(qū)動(dòng) */ scan b2v_inst(.en_in1(synthesized_wire_0), .en_in0(synthesized_wire_1),.sdata(synthesized_wire_21))。 /*1000 分頻得到 1HZ 時(shí)鐘信號(hào) */ fadiv1hz b2v_inst11(.clk_in(synthesized_wire_20), .clk_out(synthesized_wire_19))。 wire [1:0] synthesized_wire_17。 wire [3:0] synthesized_wire_15。 wire [3:0] synthesized_wire_13。 wire [3:0] synthesized_wire_11。 wire [3:0] synthesized_wire_9。 wire [1:0] synthesized_wire_21。 wire synthesized_wire_3。 wire synthesized_wire_1。 output [1:0] seg_sel。 output green2。 output yellow2。 output red2。 input clk。 /*輸入輸出端口定義 */ input reset。b00000000。b11100110。 //8 439。b1000 : data_out = 839。b11100000。 //6 439。b0110 : data_out = 839。b10110110。 //4 439。b0100 : data_out = 839。b11110010。 //2 439。b0010 : data_out = 839。b01100000。 //0 439。b0000 : data_out = 839。 /*數(shù)據(jù)類型定義 */ reg [7:0] data_out。 /*輸入輸出端口定義 */ output [7:0] data_out。b0000。b10 : d_out = d_in1。b01 : d_out = d_in0。 /*數(shù)據(jù)類型定義 */ reg [3:0] d_out。 input [3:0] d_in0。 /*輸入輸出端口定義 */ output [3:0] d_out。b01。b10) d_out = d_out + 1。 /*數(shù)據(jù)類型定義 */ reg [1:0] d_out。 /*輸入輸出端口定義 */ output [1:0] d_out。b0000。b0000。d_out1 = d_in3。 end 239。b0 : begin d_out0 = d_in0。 reg [3:0] d_out0。 input sel。 input [3:0] d_in1。 input [3:0] d_in3。 /*輸入輸出端口定義 */ output [3:0] d_out1。b1。 end 26 else begin t = 0。 clk _out = 139。 integer t=0。 input clk_in。 end end endmodule /*1HZ 計(jì)數(shù) 時(shí)鐘信號(hào)模塊 fdiv1hz*/ module fdiv1hz(clk_in,clk_out)。 clk_out = 139。b0。 /*always 語句:實(shí)現(xiàn) 10000 分頻 */ always (posedge clk_in) begin if(t9999) //實(shí)際系統(tǒng)分頻值 //if(t19) //仿真時(shí)的分頻值 begin t = t + 1。 /*數(shù)據(jù)類型定義 */ 25 reg clk_out。 /*輸入輸出端口定義 */ output clk_out。b00。b01。 239。b10 : {d_out1,d_out0} = 239。b01。b10 239。 always begin case(d_in) 239。 /*數(shù)據(jù)類型定義 */ reg d_out1。 output d_out0。 end endmodule /*倒計(jì)時(shí)時(shí)間選擇模塊 counterselect*/ module countersel(d_in,d_out1,d_out0)。 assign en_in = en_in1 | en_in0。 /*數(shù)據(jù)類型定義 */ 24 reg [1:0] sdata。 input en_in1。 end endmodule /*倒計(jì)時(shí)時(shí)間選擇驅(qū)動(dòng)模塊 scan*/ module scan(en_in1,en_in0,sdata)。439。b1011。439。b1111)439。 if((dataamp。 d_out1 = 439。 end end end /*加計(jì)數(shù)器的計(jì)數(shù)值到倒計(jì)時(shí)的數(shù)值轉(zhuǎn)換 */ always begin data = 839。 c_out = 139。 end else begin cdata1 = 439。 c_out = 139。 end /*加計(jì)數(shù)器 */ else begin if(cdata0 != 439。 23 cdata0 = 439。 cdata1 = 439。 /*always 語句:實(shí)現(xiàn) 5 秒的自動(dòng)循環(huán)倒計(jì)數(shù) */ always (posedge c_clk) begin /*系統(tǒng)復(fù)位或者未工作狀態(tài) */ if(rst==0||c_en==0) begin c_out = 139。 reg [3:0] cdata0。 reg c_out。 /*數(shù)據(jù)類型定義 */ reg [3:0] d_out1。 input c_clk。 output [3:0] d_out1。 end endmodule /*5秒倒計(jì)時(shí)模塊 counter5*/ module counter05(c_clk,rst,c_en,d_out1,d_out0,c_out)。439。b0110。439。b1111)439。 if((dataamp。439。b1111。439。b1111)439。 if(((data4)amp。 end end end /*加計(jì)數(shù)器的計(jì)數(shù)值到倒計(jì)時(shí)的數(shù)值轉(zhuǎn)換 */ always begin 22 data = 839。 c_out =139。 cdata0 = 439。 end else begin cdata1 = 439。 c_out = 139。 cdata0 = 439。 cdata1 != 439。b1001 amp。b0。b1001) begin cdata0 = cdata0+1。b1。b0000。b0000。 cdata1 == 439。b0101 amp。b0000。b0000。b0。一種是計(jì)數(shù)器采用加計(jì)數(shù)法,然后將加計(jì)數(shù)器的值通過一定的 關(guān)系轉(zhuǎn)換成倒計(jì)數(shù)當(dāng)前的值;另一種方法是直接采用減計(jì)數(shù)器來實(shí)現(xiàn)。 reg [7:0] data。 reg [3:0] cdata1。 reg [3:0] d_out0。 input c_en。 input c_clk。 output [3:0] d_out1。 // 方向 1與方向 2全滅 Endcase end end endmodule /*55 秒倒計(jì)時(shí)模塊 counter55*/ module counter55(c_clk,rst,c_en,d_out1,d_out0,c_out)。 // 方向 1紅燈亮,方向 2黃燈亮 default : {red1,red2,yellow1,yellow2,green1,green2}=639。b11 : {red1,red2,yellow1,yellow2,green1,green2}=639。b100001。 // 方向 1黃燈亮,方向 2紅燈亮 20 239。b01 : {red1,red2,yellow1,yellow2,green1,green2}=639。b010010。 /*系統(tǒng)自動(dòng)運(yùn)行 */ else begin case(en_in) 239。 /*always 語句 :實(shí)現(xiàn)交通燈的總體工作的控制 */ always (en_in||rst||sw1) begin /*系統(tǒng)復(fù)位 */ if(sw1==0||rst==0) {red1,red2,yellow1,yellow2,green1,green2}=639。 input rst。 input [1:0] en_in。 output green1。 output yellow1。 /*輸入輸出端口定義 */ output red1。在綠燈亮了 55 秒后變化為黃燈亮 5秒,然后實(shí)現(xiàn)了十字路口縱橫路放行與禁行的切換控制。 頂層電路如圖 312 所示: 圖 312 頂層電路的接線圖 17 四 結(jié) 論 通過程序仿真,可以看出各個(gè)模塊功能都得到實(shí)現(xiàn)。 頂層電路的設(shè)計(jì)又有幾種常用的方法,在 Verilog HDL 設(shè)計(jì)中主要有兩種:一是用與模塊設(shè)計(jì)一樣的方式,即用 Verilog HDL 語言來編程寫模塊電路的連接關(guān)系,主要是輸入與輸出的連接,從而設(shè)計(jì)出頂層電路;二是利用電路原理圖的
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1