fix offset bug
This commit is contained in:
@@ -20,7 +20,7 @@ module chanels_to_RGB #(
|
||||
localparam SEND_DATA = 1;
|
||||
|
||||
reg [1:0] state, nextState;
|
||||
reg [31:0] data_cal [2:0]; // 用于保存运算结果,防止溢出
|
||||
reg [15:0] data_cal [2:0]; // 用于保存运算结果,防止溢出
|
||||
reg fifo_en;
|
||||
reg [3 * OUT_DEPTH - 1:0] fifo_in; // 输入fifo中缓存
|
||||
wire fifo_empty, fifo_que;
|
||||
@@ -56,9 +56,9 @@ module chanels_to_RGB #(
|
||||
fifo_en <= 0;
|
||||
|
||||
if (in_en) begin
|
||||
data_cal[0] <= data_in[0] * OUT_DEPTH / IN_DEPTH;
|
||||
data_cal[1] <= data_in[1] * OUT_DEPTH / IN_DEPTH;
|
||||
data_cal[2] <= data_in[2] * OUT_DEPTH / IN_DEPTH;
|
||||
data_cal[0] <= data_in[0] >> (IN_DEPTH - OUT_DEPTH);
|
||||
data_cal[1] <= data_in[1] >> (IN_DEPTH - OUT_DEPTH);
|
||||
data_cal[2] <= data_in[2] >> (IN_DEPTH - OUT_DEPTH);
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user