我想了解的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