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,11 +20,13 @@
|
||||
|
||||
`timescale 1ns / 1ps
|
||||
|
||||
// stages must be greater than 2
|
||||
module jt12_sh #(parameter width=5, stages=24 )
|
||||
(
|
||||
input clk,
|
||||
input [width-1:0] din,
|
||||
output [width-1:0] drop
|
||||
input clk,
|
||||
input clk_en,
|
||||
input [width-1:0] din,
|
||||
output [width-1:0] drop
|
||||
);
|
||||
|
||||
reg [stages-1:0] bits[width-1:0];
|
||||
@ -32,11 +34,8 @@ reg [stages-1:0] bits[width-1:0];
|
||||
genvar i;
|
||||
generate
|
||||
for (i=0; i < width; i=i+1) begin: bit_shifter
|
||||
always @(posedge clk) begin
|
||||
if( stages> 1 )
|
||||
bits[i] <= {bits[i][stages-2:0], din[i]};
|
||||
else
|
||||
bits[i] <= din[i];
|
||||
always @(posedge clk) if(clk_en) begin
|
||||
bits[i] <= {bits[i][stages-2:0], din[i]};
|
||||
end
|
||||
assign drop[i] = bits[i][stages-1];
|
||||
end
|
||||
|
Reference in New Issue
Block a user