2012年11月9日 星期五

P6-10 "=" 區塊指定 "<=" 非區塊指定

P6-10 "=" 區塊指定 "<=" 非區塊指定


"=" 區塊指定 Blocking assignment 
..........................
..........................
always @ (posedge Clk)
   begin 
     Q1=W;
     Q2=Q1;
  end
endmoudle


 "<=" 非區塊指定 nonBlocking assignment 
..........................
..........................
always @ (posedge Clk)
   begin 
     Q1<=W;
     Q2<=Q1;
  end
endmoudle





區塊指定 Blocking assignment 

10 module d_latch2 (
11   input      rst_n,
12   input      en,
13   input      d,
14   output reg q
15 );
16 
17 always@(rst_n, en, d, q) begin
18   if (!rst_n) 

19    = 0;
20   else if (en)
21    = d;
22 end
23 
24 endmodule




非區塊指定 nonBlocking assignment 
10 module d_ff (
11   input      clk,
12   input      rst_n,
13   input      en,
14   input      d,
15   output reg q
16 );
17 
18 always@(posedge clk or negedge rst_n)

19   if (!rst_n)
20    <= 0;
21   else if (en)
22     <= d;
23     
24 endmodule

沒有留言:

張貼留言

RFID TI 培訓影片系列

RFID TI 培訓影片系列  https://www.ti.com/zh-tw/video/series/rfid.html 培訓影片系列 RFID 隨著創新技術日益發展,RFID 和 RF 術語越來越容易讓人混淆。本訓練系列詳細介紹了使用案例、權衡技術優缺點,讓您清楚知道該選...