Logarithm Base 2
Medium · Combinational · SystemVerilog
Write a Verilog module to compute the integer logarithm base 2 of {in_0}, where {in_0} is a signed integer and {out} is a signed integer.
If {in_0} $\le$ $0$, {out} must be $0$. For positive inputs, {out} is the floor of $log_2$ of {in_0}.