A signal is defined as :
logic [width_x-1:0] x;
I want to assign x a value where the second bit from the top is '1' and all other bits are '0'. For example, if width_x is 4 then I want x to be "0100". In VHDL, it can be done as follows:
What will be the closest Verilog/SV equivalent ?