diff options
author | zedarider <ymherklotz@gmail.com> | 2016-05-06 21:47:55 +0200 |
---|---|---|
committer | zedarider <ymherklotz@gmail.com> | 2016-05-06 21:47:55 +0200 |
commit | 67a670f7cc2548cd2c06243f4fecbc77c088ea2b (patch) | |
tree | 083a2ecaf5647de4cc631211def3e86399b9549e | |
parent | 1abc91b5950ac22d4b1f09b8696f09cd22ceb1ed (diff) | |
download | verilog-67a670f7cc2548cd2c06243f4fecbc77c088ea2b.tar.gz verilog-67a670f7cc2548cd2c06243f4fecbc77c088ea2b.zip |
adding all files
-rw-r--r-- | pitch_volume_out.v | 29 | ||||
-rw-r--r-- | ten_dff.v | 11 |
2 files changed, 40 insertions, 0 deletions
diff --git a/pitch_volume_out.v b/pitch_volume_out.v new file mode 100644 index 0000000..04efd0f --- /dev/null +++ b/pitch_volume_out.v @@ -0,0 +1,29 @@ +module pitch_volume_out(clock_in, blue_x, blue_y, tempo, volume); + input [9:0] blue_x; + input [9:0] blue_y; + input clock_in; + + + output reg [2:0] tempo; + output reg [2:0] volume; + + always @ (posedge clock_in) + begin + if(blue_x < 10'd224) tempo = 3'd0; + else if(blue_x < 10'd304) tempo = 3'd1; + else if(blue_x < 10'd384) tempo = 3'd2; + else if(blue_x < 10'd464) tempo = 3'd3; + else if(blue_x < 10'd544) tempo = 3'd4; + else if(blue_x < 10'd624) tempo = 3'd5; + else if(blue_x < 10'd704) tempo = 3'd6; + else if(blue_x < 10'd784) tempo = 3'd7; + if(blue_y < 10'd94) volume = 3'd0; + else if(blue_y < 10'd152) volume = 3'd1; + else if(blue_y < 10'd210) volume = 3'd2; + else if(blue_y < 10'd268) volume = 3'd3; + else if(blue_y < 10'd326) volume = 3'd4; + else if(blue_y < 10'd384) volume = 3'd5; + else if(blue_y < 10'd442) volume = 3'd6; + else if(blue_y < 10'd503) volume = 3'd7; + end +endmodule // pitch_volume_out diff --git a/ten_dff.v b/ten_dff.v new file mode 100644 index 0000000..c8c73c7 --- /dev/null +++ b/ten_dff.v @@ -0,0 +1,11 @@ +module ten_dff(is_blue, x_pos_in, x_pos_out); + input is_blue; + input [9:0] x_pos_in; + + output reg [9:0] x_pos_out; + + always @ (posedge is_blue) + begin + x_pos_out = x_pos_in; + end +endmodule // ten_dff |