题解 | #多位信号xnor#

多位信号xnor

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

`timescale 1ns/1ns

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

wire    [24:0]tp1,tp2;
assign  tp1[24:0] = {{5{a}},{5{b}},{5{c}},{5{d}},{5{e}}};
assign  tp2[24:0] = {5{a,b,c,d,e}};

//assign  out = ~(tp1^tp2);
genvar i;
generate
    for(i=0;i<25;i=i+1)begin
        assign out[i] = (tp1[i]==tp2[i])?1'b1:1'b0;
    end
endgenerate

endmodule

全部评论

相关推荐

09-18 20:41
百度_Java
要个offer怎么这...:哈哈哈哈哈哈,我也拿了0x10000000个offer,秋招温啦啦啦,好开心
我的秋招日记
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
09-23 18:40
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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