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
*/

沒有留言:

張貼留言

Node-Red --> MQTT --> Fuxa

Node-Red --> MQTT --> Fuxa      FUXA(一個開源的 Web HMI / SCADA 自動化監控軟體)的專案設定檔 。 這份設定檔完整定義了 HMI 監控畫面的 後端通訊(MQTT 連線、點位標籤) 與 前端網頁圖形介面(SVG 畫布...