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.

113 lines
5.1 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, ,
parameter w_1 = 4'd4; // 4, 4, 0'b0100
wire c;
assign c = 1'b1 + 1'b1; // c 1bit, , , c 1'b0
wire f;
assign f = 1 + 1; // 1, 32, wire 1, f 1'b10
wire [2:0]g;
assign g = 1'b1 + 1'b1; // , 1'b1 + 1'b1 , , g 2'b10
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
//
wire [2:0]l_a;
wire [2:0]l_b;
wire l_c;
assign l_c = l_a && l_b; // l_a, (l_a[0] || l_a[0] || l_a[0]) && (l_ab0] || l_b[0] || l_b[0]) , l_a || l_b ,
//
// ,
wire [4:0] W, V;
assign V = &W; // W, W, V = W[3] & W[2] & W[1] & W[0], A 0b0110, C 4'b0;
//
wire [4:0]U;
assign U = W & V; // U, , 0
// && || ! 10 , | & ^ ~
//
// xz, x
// ,
// , 线, , 使
wire [4:0]Y1;
wire [4:0]Y2;
assign Y1 = 4'b0110;
assign Y2 = Y1 << 2; // , Y24, Y1 Y2, Y2 1000, Y2[3:2] Y1[1:0]
// /, a, b
// [a-: b] aa, b
// [a+: b] a, b
wire [16:0] Slice;
// Slice[6-:3] Slice[6:4]
// Slice[2+:3] Slice[4:2]
//
// !! {A[0], 5} 5 32
// , 使沿沿,
wire my_s;
always @(posedge my_s) begin // 使
end
//
// , 使,
// a_1 1, b_10, a_1b_1, c_1, 2, , ,线 c_1
reg a_1,b_1,c_1;
always @(*) begin
b_1 <= a_1;
c_1 <= b_1 + a_1;
end
endmodule