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.

42 lines
1.7 KiB
Coq

module led( // io
input key, // wire
output reg led // always,
);
reg [5:0]v_reg; // 线, 6bit
wire [5: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