Reputation: 561
Below is the code:
always @ (C[n-1])
begin
C[2*n-1:n]=C[n-1];
end
Is that possible? If not, how can I do it? Basically it's performing a sign extension.
Upvotes: 3
Views: 5185
Reputation: 93720
The syntax for replicating a bit in Verilog is {COUNT{bits}}
. In your case something like {n{C[n-1]}}
Upvotes: 5