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.
26 lines
548 B
Coq
26 lines
548 B
Coq
8 months ago
|
module td_led ();
|
||
|
`timescale 1ns/1ns // 睡眠的 单位/精度
|
||
|
|
||
|
reg td_key; // 定义内内部的信号 设置为寄存器类型(按键是在 initial 语句中赋值, 以使用寄存器类型)
|
||
|
wire td_led; // 定义内部的输出信号, 使用 wire 类型
|
||
|
|
||
|
// 信号初始化的设置
|
||
|
initial begin
|
||
|
td_key <= 1'b1; // 不阻塞的设置内部初始值
|
||
|
|
||
|
#200; // 阻塞 200ns
|
||
|
td_key <= 1'b0;
|
||
|
|
||
|
#500;
|
||
|
td_key <= 1'b1;
|
||
|
|
||
|
#1000;
|
||
|
td_key <= 1'b0;
|
||
|
end
|
||
|
|
||
|
// 例化
|
||
|
led u_led(
|
||
|
.key (td_key),
|
||
|
.led (td_led)
|
||
|
);
|
||
|
endmodule
|