2012年10月11日 星期四

P5-14 Check Even Partity and Zeros For DE2-70 Experiment Board

P5-14 Check 8bits Even Partity and Zeros 

For DE2-70 Experiment Board





module Evenparity (SW, LEDR, LEDG);
input [17:0] SW; // toggle switches
output [17:0] LEDR; // red  LEDS   
  output [7:0] LEDG; // green LEDs
  
//set original program input , output 
wire [7:0]din;
wire ev_par,all_zeros;

   
    //mapping to hardware 
    assign LEDR = SW;
    assign din = SW[7:0];

assign ev_par=~^din;  //xnor
assign all_zeros=~|din ; //nor

assign LEDG[0]=ev_par;
assign LEDG[1]=all_zeros;

endmodule

/* P5-14 original program
module even_parity(din,ev_par,all_zeros);
input [7:0]din;
output ev_par,all_zeros;
assign ev_par=~^din;  //xnor
assign all_zeros=~|din ; //nor
endmodule
*/

沒有留言:

張貼留言

  清除項目編譯快取 執行 flutter clean 重新取得套件依賴 執行 flutter pub get 完整重新編譯並執行 flutter run 1. 新增專案套件 (pubspec.yaml) 在 Flutter 專案根目錄下的 pubspec.yaml 中,新增 ...