题解 | #数据选择器实现逻辑电路#

数据选择器实现逻辑电路

https://www.nowcoder.com/practice/00b0d01b71234d0b97dd4ab64f522ed9

首先合并冗余项L=A∙B+A∙~C+B∙C=AC '+BC;可以使用C来选择D0和D1;

仅使用低2位选择输入;

`timescale 1ns/1ns

module data_sel(
   input             S0     ,
   input             S1     ,
   input             D0     ,
   input             D1     ,
   input             D2     ,
   input             D3     ,
   
   output wire        Y    
);

assign Y = ~S1 & (~S0&D0 | S0&D1) | S1&(~S0&D2 | S0&D3);
     
endmodule

module sel_exp(
   input             A     ,
   input             B     ,
   input             C     ,
   
   output wire       L            
);

data_sel inst1(
.S0 (C),
.S1 (1'b0),
.D0 (A),
.D1 (B),
.D2 (),
.D3 (),
.Y  (L)
);
endmodule

全部评论

相关推荐

2024-12-26 13:00
太原理工大学 Java
会飞的猿:简历没啥大问题啊,感觉是缺少了实习经历。多投投先找个中小厂过渡一下吧
点赞 评论 收藏
分享
给🐭🐭个面试机会吧:嘿,mvbatis
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务