题解 | #使用8线-3线优先编码器Ⅰ实现16线-4线优先编码器#

使用8线-3线优先编码器Ⅰ实现16线-4线优先编码器

http://www.nowcoder.com/practice/dcfa838e43de4744bc976abee96dc566

`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[2] = EI & (I[7] | I[6] | I[5] | I[4]); assign Y[1] = EI & (I[7] | I[6] | ~I[5]&~I[4]&I[3] | ~I[5]&~I[4]&I[2]); assign Y[0] = EI & (I[7] | ~I[6]&I[5] | ~I[6]&~I[4]&I[3] | ~I[6]&~I[4]&~I[2]&I[1]);

assign EO = EI&~I[7]&~I[6]&~I[5]&~I[4]&~I[3]&~I[2]&~I[1]&~I[0];

assign GS = EI&(I[7] | I[6] | I[5] | I[4] | I[3] | I[2] | I[1] | I[0]); //assign GS = EI&(| I);

endmodule

module encoder_164( input [15:0] A , input EI ,

output wire [3:0] L , output wire GS , output wire EO
); wire GSH,EOH,GSL,EOL; wire [2:0] YH,YL; encoder_83 e83h( .I(A[15:8]), .EI(EI), .Y(YH[2:0]), .GS(GSH), .EO(EOH) ); encoder_83 e83l( .I(A[7:0]), .EI(EI & (EOH)), .Y(YL[2:0]), .GS(GSL), .EO(EOL) ); assign L[3]=EI & (GSH); assign L[2:0]=(L[3])?(YH[2:0]):(YL[2:0]); assign GS=GSH | GSL; assign EO=EOH & EOL; endmodule

全部评论

相关推荐

陆续:不可思议 竟然没那就话 那就我来吧 :你是我在牛客见到的最美的女孩
点赞 评论 收藏
分享
06-12 16:00
天津大学 Java
牛客30236098...:腾讯坏事做尽,终面挂是最破防的 上次被挂了后我连简历都不刷了
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
昨天 16:22
主包是26应届生,投大厂简历一直过不了初筛,想问问大家有必要花钱改简历吗
Java抽象带篮子:我之前专门发个帖子说不要付费改简历的,里面还详细写了简历怎么写,你可以去看看
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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