Log2

chisel3.util.Log2
object Log2

Returns the base-2 integer logarithm of an UInt.

Attributes

Note

The result is truncated, so e.g. Log2(13.U) === 3.U

Example
Log2(8.U)  // evaluates to 3.U
Log2(13.U)  // evaluates to 3.U (truncation)
Log2(myUIntWire)
Source
CircuitMath.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Log2.type

Members list

Value members

Concrete methods

def apply(x: Bits, width: Int): UInt

Returns the base-2 integer logarithm of the least-significant width bits of an UInt.

Returns the base-2 integer logarithm of the least-significant width bits of an UInt.

Attributes

Source
CircuitMath.scala
def apply(x: Bits): UInt

Attributes

Source
CircuitMath.scala