You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.0 KiB
Coq

module led( // io
input key, // wire
output reg led // always,
);
parameter WIDTH = 5; // , , , 使
wire [WIDTH:0] tmp1, tmp2; // 线, WIDTH
reg [WIDTH:0]v_reg; // , 6bit ,
wire [WIDTH:0]v_wire; // 线, 6bit
always @(*) begin // * 表示内部的任何变量发生变化的时候, 就会并行执行该 block
// , reg, , , , 使/
// begin ... end , , begin ... end, always 1!
led = !key; // reg , ,
v_reg[1] = key;
// v_wire[1] = key; // wire , wire线, 使 assign线
end
// assign v_reg[0] = key; // 线, always
assign v_wire[0] = key;
assign v_wire[1] = v_reg[1]; // v_wire 线 1 v_reg1
//
// 1bit,
wire c;
assign c = 1'b1 + 1'b1; // c 1bit, , , c 1'b0
wire a;
wire b;
wire d;
wire s;
assign a = 1'b1;
assign b = 1'b1;
assign {s, d} = a + b; // , s
wire [1:0]ret;
assign {ret[1], ret[0]} = a + b; // 2 ret
endmodule