module demo_sound4( input clock, output [7:0]key_code, input k_tr ); reg [15:0]tmp; wire [15:0]tmpa; reg tr; reg [15:0]step; wire [15:0]step_r; reg [7:0]TT; reg[5:0]st; reg go_end; always @(negedge k_tr or posedge clock) begin if (!k_tr) begin step=0; st=0; tr=0; end else if (steptmpa)go_end=1; else tmp=tmp+1; end always @(step) begin case (step) 0:TT=8'h11; 1:TT=8'h91; 2:TT=8'hf1; 3:TT=8'h31; 4:TT=8'h84; 5:TT=8'h15; 6:TT=8'h15; 7:TT=8'h31; 8:TT=8'h83; 9:TT=8'h34; 10:TT=8'h84; 11:TT=8'h35; 12:TT=8'h85; 13:TT=8'h31; 14:TT=8'h81; 15:TT=8'h11; 16:TT=8'h11; 17:TT=8'h31; 18:TT=8'h81; 19:TT=8'h11; 20:TT=8'h11; 21:TT=8'h11; 22:TT=8'h31; 23:TT=8'h1f; 24:TT=8'h1f; 25:TT=8'h81; 26:TT=8'h81; 27:TT=8'h81; 28:TT=8'h81; 29:TT=8'h81; 30:TT=8'h35; 31:TT=8'h85; 32:TT=8'h85; 33:TT=8'h85; 34:TT=8'h85; 35:TT=8'h85; 36:TT=8'h31; 37:TT=8'h81; 38:TT=8'h31; 39:TT=8'h84; 40:TT=8'h15; 41:TT=8'h15; 42:TT=8'h21; 43:TT=8'h1f; endcase end assign step_r=43; endmodule