题解 | #优先编码器Ⅰ#
优先编码器Ⅰ
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