题解 | #五到一选择器#

五到一选择器

https://www.nowcoder.com/practice/54927c0e26604247aa990cdf03e52953

`timescale 1ns/1ns

module top_module( 
    input [3:0] a, b, c, d, e, 
    input [2:0] sel,
    output  [3:0] out );


  assign out = (sel == 3'b000)?a:( (sel == 3'b001)?b: ( (sel == 3'b010)?c: ( (sel == 3'b011)?d: (  (sel == 3'b100)?e:0 ) ) )   );

endmodule

全部评论

相关推荐

01-16 18:48
四川大学 Java
KalznAsawind:人问他哪一个是pdd,他倒介绍起来了。。。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务