题解 | #优先编码器Ⅰ#

优先编码器Ⅰ

https://www.nowcoder.com/practice/a7068b8f4c824d6a9592f691990b21de

`timescale 1ns/1ns

module encoder_83(
   input      [7:0]       I   ,
   input                  EI  ,
   
   output wire [2:0]      Y   ,
   output wire            GS  ,
   output wire            EO    
);

assign  Y = ~EI? 3'd0:I[7]? 3'd7:I[6]? 3'd6:I[5]? 3'd5:I[4]? 3'd4:
                I[3]? 3'd3:I[2]? 3'd2:I[1]? 3'd1:3'd0;

assign GS = |I && EI;
assign EO = ~|I && EI;

endmodule

全部评论

相关推荐

驼瑞驰_招募评论官版...:一共经历几次握手?
点赞 评论 收藏
分享
爱睡觉的冰箱哥:你是我今晚见过的最美的牛客女孩
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务