mat7labs的个人空间 https://blog.eetop.cn/1631436 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

乘法器verilog

已有 3126 次阅读| 2020-1-26 16:28 |系统分类:其他

module mux(altremote_reconfig, altremote_busy, in_altremote, in_updatelogic, out_altasmi);
  input altremote_reconfig;
  input altremote_busy;
  input in_altremote;     //This need to be assigned according to the respective outputs from altremote_update that need to be multiplexed
  input in_updatelogic;   //This need to be assigned according to the respective outputs from update logic that need to be multiplexed
  output out_altasmi;
  
  wire out_altasmi;
  reg remote_access;
  
  assign out_altasmi = remote_access? in_altremote: in_updatelogic;
  
always @(posedge altremote_reconfig)
begin
  remote_access <= 1'b1;
end

always @(negedge altremote_busy)
begin
  remote_access <= 1'b0;
end
  
endmodule

module mux_tb ();
  reg altremote_reconfig;
  reg altremote_busy;
  reg in_altremote;     //This need to be assigned according to the respective outputs from altremote_update that need to be multiplexed
  reg in_updatelogic;   //This need to be assigned according to the respective outputs from update logic that need to be multiplexed
  wire out_altasmi;

initial
begin
  altremote_reconfig = 1'b0;
  #150 altremote_reconfig = 1'b1;
  #180  altremote_reconfig = 1'b0;
end

initial
begin
  altremote_busy = 1'b0;
  #20 altremote_busy  = 1'b1;
  #100 altremote_busy  = 1'b0;
  #200 altremote_busy  = 1'b1;
  #300 altremote_busy  = 1'b0;
end

mux muxinst(altremote_reconfig, altremote_busy, in_altremote, in_updatelogic, out_altasmi);

点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 2

    粉丝
  • 0

    好友
  • 3

    获赞
  • 2

    评论
  • 访问数
关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-19 18:18 , Processed in 0.031865 second(s), 18 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部