1 //===============================================================================
2 // FPGA MOONCRESTA SOUND I/F
6 // Copyright(c) 2004 Katsumi Degawa , All rights reserved
10 // This program is freeware for non-commercial use.
11 // An author does no guarantee about this program.
12 // You can use this under your own risk.
14 //================================================================================
49 always@(posedge I_CLK_12M)
52 W_89K_LDn <= ~(&W_89K_Q[7:0]);
56 always@(posedge W_PITCHn) W_89K_LDATA <= I_BD;
58 always@(posedge I_H_CNT1)
61 W_89K_Q <= W_89K_LDATA;
63 W_89K_Q <= W_89K_Q + 1;
66 always@(negedge W_89K_LDn) W_6T_Q <= W_6T_Q + 1;
72 always@(posedge I_CLK_6M)
74 W_SDAT0 <= W_6T_Q[0]==1'b0 ? 8'd0 : 8'd42 ;
75 W_SDAT2 <= W_6T_Q[2]==1'b0 ? 8'd0 : I_VOL1 ? 8'd105 : 8'd57 ;
76 W_SDAT3 <= W_6T_Q[3]==1'b0 ? 8'd0 : I_VOL2 ? 8'd72 : 8'd0 ;
79 assign O_SDAT = W_SDAT0 + W_SDAT2 + W_SDAT3 + 8'd20 ;