mirror of
https://github.com/UzixLS/TSConf_MiST.git
synced 2025-07-19 07:11:22 +03:00
Update turbosound.
This commit is contained in:
@ -20,18 +20,28 @@
|
||||
|
||||
`timescale 1ns / 1ps
|
||||
|
||||
/* The input is {op[1:0], ch[2:0]}
|
||||
it adds 1 to the channel and overflow to the operator correctly */
|
||||
|
||||
module jt12_sumch
|
||||
(
|
||||
input [4:0] chin,
|
||||
output reg [4:0] chout
|
||||
);
|
||||
|
||||
parameter num_ch=6;
|
||||
|
||||
reg [2:0] aux;
|
||||
|
||||
always @(*) begin
|
||||
aux <= chin[2:0] + 3'd1;
|
||||
chout[2:0] <= aux[1:0]==2'b11 ? aux+3'd1 : aux;
|
||||
chout[4:3] <= chin[2:0]==3'd6 ? chin[4:3]+2'd1 : chin[4:3];
|
||||
aux = chin[2:0] + 3'd1;
|
||||
if( num_ch==6 ) begin
|
||||
chout[2:0] = aux[1:0]==2'b11 ? aux+3'd1 : aux;
|
||||
chout[4:3] = chin[2:0]==3'd6 ? chin[4:3]+2'd1 : chin[4:3]; // next operator
|
||||
end else begin // 3 channels
|
||||
chout[2:0] = aux[1:0]==2'b11 ? 3'd0 : aux;
|
||||
chout[4:3] = chin[2:0]==3'd2 ? chin[4:3]+2'd1 : chin[4:3]; // next operator
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
Reference in New Issue
Block a user