Re: [問題] Verilog的問題??

看板Electronics作者 (腦殘)時間20年前 (2006/03/22 14:35), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/3 (看更多)
module add8(cin, a, b, s, cout); input cin; input[7:0] a,b; output cout; output[7:0] s; wire[6:0] cy; add fa0(cin,a[0],b[0],s[0],cy[0]); add fa1(cy[0],a[1],b[1],s[1],cy[1]); add fa2(cy[1],a[2],b[2],s[2],cy[2]); add fa3(cy[2],a[3],b[3],s[3],cy[3]); add fa4(cy[3],a[4],b[4],s[4],cy[4]); add fa5(cy[4],a[5],b[5],s[5],cy[5]); add fa6(cy[5],a[6],b[6],s[6],cy[6]); add fa7(cy[6],a[7],b[7],s[7],cout); endmodule module add(cin, a, b, s, cout); input cin; input a, b; output cout; output s; assign {cout,s} = a + b + cin; endmodule //以下為簡易寫法 module add8(cin, a, b, s, cout); input cin; input [7:0] a, b; output cout; output [7:0] s; assign {cout,s} = a + b + cin; endmodule //我是來賺p幣的 //錯了別打我.. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.66.243.100

03/22 15:25, , 1F
謝謝大大...問題解決了^^
03/22 15:25, 1F
文章代碼(AID): #148F114C (Electronics)
文章代碼(AID): #148F114C (Electronics)