unsignedBitLength

chisel3.util.unsignedBitLength

Attributes

Source
Math.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(in: BigInt): Int

Return the number of bits required to encode a specific value, assuming no sign bit is required.

Return the number of bits required to encode a specific value, assuming no sign bit is required.

Basically, n.bitLength. NOTE: This will return 0 for a value of 0. This reflects the Chisel assumption that a zero width wire has a value of 0.

Value parameters

in
  • the number to be encoded.

Attributes

Returns
  • an Int representing the number of bits to encode.
Source
Math.scala