Blocking & Non Blocking
1. Blocking的語法 = //循序式的方式執行程式
JL8051 發表在 痞客邦 留言(0) 人氣(110)
JL8051 發表在 痞客邦 留言(0) 人氣(177)
https://hdlbits.01xz.net/wiki/Zero
JL8051 發表在 痞客邦 留言(0) 人氣(23)
module led_test
(
input clk, // 系統 50 Mhz 時鐘
input key, // 按鈕 1
output [3:0] led // 板子上有 4 顆 LED,宣告為輸出
);
reg [3:0] count;
reg [31:0] timer;
always@(posedge clk)
begin
if(key == 1'b0) // 按下,就累加一
timer <= timer + 24'd1;
else // 放開
timer <= 31'd0;
// 當累加到 0.01 秒,LED 計數器才加一
if(timer == 31'd500_000) // 50_000_000 = 1秒,500_000 = 0.01 秒
count <= count + 4'b0001;
end
assign led = ~ count; // 將 count 綁定到 LED 輸出,並且是相反 (NOT) 輸出
endmodule
JL8051 發表在 痞客邦 留言(0) 人氣(663)

Error (114016): Out of memory in module quartus_map.exe (4904 megabytes used)
記憶體不足
JL8051 發表在 痞客邦 留言(0) 人氣(151)
Verilog for迴圈範例1
reg[31:0]matrix[8:0];
always@(posedge clk)begin
if(reset)
for(idx=0; idx <9; idx = idx +1)begin
matrix[idx] <= 0;
end
end
JL8051 發表在 痞客邦 留言(0) 人氣(5,131)