我想了解的Verilog代码此位的3位精矿..Verilog的2个变量
reg [2:0] SYNC;
always @(posedge clk) SYNC <= {SYNC[1:0], ASYNC};
wire SYNC_risingedge = (SYNC[2:1] == 2'b01);
wire SYNC_fallingedge = (SYNC[2:1] == 2'b10);
wire SYNC_on = ~SYNC[1];
从我的理解。 3位寄存器被设置(同步) 当时钟上升时,同步等于位1和0与当前值(异步)的组合。 SYNC_risingedge等于(同步)位2和1并且二进制值'01' SYNC_fallingedge等于(同步)位2和1并且二进制值'10' SYNC_on等于同步。
我的问题是在引号内的行旁边。
reg [2:0] SYNC;
always @(posedge clk) SYNC <= {SYNC[1:0], ASYNC}; *"does this mean that it concentrates the state of ASYNC with only bits 1 and 0?"*
wire SYNC_risingedge = (SYNC[2:1] == 2'b01); *"is the binary number 01 placed only in bits 2 and 1? if so, how does it affect the previous line?"*
wire SYNC_fallingedge = (SYNC[2:1] == 2'b10); *"same question as previous line"*
wire SYNC_on = ~SYNC[1]; *"What does the [1] mean in ~SYNC[1]?"*
我搜遍了网络,寻找Verilog语法来理解这一点的代码,但总结出来了。 任何援助,将不胜感激。
谢谢!,你是非常有帮助的。 – user2525855