module myModule (CLK, A);
input CLK;
output reg [3:0] A = 4'b0000;
reg Sin = 0;
always @(posedge CLK)
begin
//Sin <= ((~A[2]&~A[1]&~A[0])|(A[2]&A[1]));
//A[0] <= A[1];
//A[1] <= A[2];
//A[2] <= A[3];
//A[3] <= Sin;
A <= {(~A[2]&~A[1]&~A[0])|(A[2]&A[1]), A[3], A[2], A[1]};
end
endmodule
When I comment A <= {(~A[2]&~A[1]&~A[0])|(A[2]&A[1]), A[3], A[2], A[1]}; and uncomment the commented part, i.e , replacing them, I cannot get the same working anymore.
module myModule (CLK, A);
input CLK;
output reg [3:0] A = 4'b0000;
reg Sin = 0;
always @(posedge CLK)
begin
Sin <= ((~A[2]&~A[1]&~A[0])|(A[2]&A[1]));
A[0] <= A[1];
A[1] <= A[2];
A[2] <= A[3];
A[3] <= Sin;
//A <= {(~A[2]&~A[1]&~A[0])|(A[2]&A[1]), A[3], A[2], A[1]};
end
endmodule
Is there a functional difference between these two lines of code? They seem equal to me.
A <= {(~A[2]&~A[1]&~A[0])|(A[2]&A[1]), A[3], A[2], A[1]}; is working correctly, while the other one is not correct.
Thanks.