野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 212|回复: 0

[altera] FPGA日常

[复制链接]
发表于 2024-7-5 13:30:06 | 显示全部楼层 |阅读模式
`timescale  1ns/1ns

module tb_mux2_1();

reg     in_1;
reg     in_2;
reg     sel;

wire    out;

initial
        begin
            in_1 <= 1'b0;
            in_2 <= 1'b0;
            sel  <= 1'b0;
        end

always #10 in_1 <= ($random) % 2;
always #10 in_2 <= ($random) % 2;
always #10 sel  <= ($random) % 2;

initial
    begin
        $timeformat(-9,0,"ns",6);
        $monitor("@Time : %t in_1 : %b in_2 : %b sel : %b out : %b",$time,in_1,in_2,sel,out);
    end

mux2_1  mux2_1_inst
(
    .in_1(in_1),
    .in_2(in_2),
    .sel(sel),
    .out(out)

);

endmodule

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-9-8 11:12 , Processed in 0.140688 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表