码迷,mamicode.com
首页 > 其他好文 > 详细

Verilog (一) assignment

时间:2016-03-06 06:37:00      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:

Verilog

  case-sensitive, all keywords are lowercase

 

1  continuous assignment  

assign  data_left  =  data_right;  // right drive left(net)

例 1)  mux

assign  data_out  =  select ? data_in1 : data_in0;

技术分享

2  procedural assignment

1)  blocking ("=")

     execute sequential

2)  nonblocking ("<=")

     read (right)  -> schedule (left) ->  execute (<=)

例 2)  synchronizer

技术分享

技术分享
reg  [1:0]  data_sync;

always @ (posedge clk or posedge rst)
begin
  if (rst)
        data_sync  <=  2b00;
  else
        data_sync  <= {data_sync[0], data_in};
end

assign  data_out  =  data_sync[1];

synchronizer
synchronizer

Verilog (一) assignment

标签:

原文地址:http://www.cnblogs.com/xinxue/p/5246441.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!