xiaop1 / Verilog-Practice

HDLBits website practices & solutions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

59 Gates.v

M-HHH opened this issue · comments

commented
module top_module( 
    input [3:0] in,
    output [2:0] out_both,
    output [3:1] out_any,
    output [3:0] out_different);
		
    assign out_both      = {{in[3] & in[2]}, {in[2] & in[1]}, {in[1] & in[0]}};
    assign out_any	 = {{in[3] | in[2]}, {in[2] | in[1]}, {in[1] | in[0]}};
    assign out_different = {{in[0] ^ in[3]}, {in[3] ^ in[2]}, {in[2] ^ in[1]}, {in[1] ^ in[0]}};

endmodule
commented

求问60题怎么三句assign来解决啊

commented

还有就是我看不能pull request啊

pull request不晓得,不知道是不是因为设置的问题;
三句assign的话……我没试最近比较忙,有空再看看