2013年12月13日 星期五

8 bits 二進位加法器 適用於DE2-70


module _8bit_adder(SW,LEDR);
 input [17:0]SW;
 output [17:0]LEDR ;

adder8 (.S(LEDR[7:0]),    //Sum-> LEDR[7:0] 8bitd
       .Cout(LEDR[8]),       //Carry_out -->LEDR[8]
       .A(SW[15:8]),          //A 8bit input
       .B(SW[7:0]),            //B 8bit inpur
       .Cin(SW[17]));         // Carry in SW[17]

endmodule



//****8bits Binary Adder******
module adder8(S, Cout, A, B, Cin);
  output [7:0] S;   //8-bit sum
  output Cout;    //Carry out
  input [7:0] A, B; //8-bit Inputs A , B 
  input Cin;    //Carry in

 //Assign the sum of (A+B+Cin) to Cout and Sum
 assign {Cout, S} = A + B + Cin;
endmodule

沒有留言:

張貼留言

2024產專班 作業2

 2024產專班 作業2   1. 系統圖       ESP32+MFRC522 組成RFID Reader 可以將RFID卡片的UID 透過 MQTT協定    上傳(發行 主題 (:topic) alex9ufo/2024/RFID/RFID_UID  ,, Payload...