R
Robert Willy
Guest
Hi,
When I write the following code, I incorrectly forget to add [7:0] before yY.
When the code is simulated,
prod1='01010100';
prod2='11110100';
prod3='11111110';
yY ='00000000';
I cannot figure out what logic behind it making yY ='00000000';
Could you tell me?
.................
reg [7:0] X1, X2;
reg yY;
reg [7:0] prod1, prod2, prod3;
always @ (posedge clk) begin
if(validsample) begin
X1 <= X;
X2 <= X1;
prod1 <= A * X;
prod2 <= B * X1;
prod3 <= C * X2;
end
yY <= prod1 + prod2 + prod3;
end
When I write the following code, I incorrectly forget to add [7:0] before yY.
When the code is simulated,
prod1='01010100';
prod2='11110100';
prod3='11111110';
yY ='00000000';
I cannot figure out what logic behind it making yY ='00000000';
Could you tell me?
.................
reg [7:0] X1, X2;
reg yY;
reg [7:0] prod1, prod2, prod3;
always @ (posedge clk) begin
if(validsample) begin
X1 <= X;
X2 <= X1;
prod1 <= A * X;
prod2 <= B * X1;
prod3 <= C * X2;
end
yY <= prod1 + prod2 + prod3;
end