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 Dashboard UI Template + AngularJS 參考 AngularJS教學 --3

  Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3 AngularJS 實例 <!DOCTYPE html> <html> <head> <meta charse...