PopCount
Returns the number of bits set (value is 1 or true) in the input signal.
Attributes
- Example
-
PopCount(Seq(true.B, false.B, true.B, true.B)) // evaluates to 3.U PopCount(Seq(false.B, false.B, true.B, false.B)) // evaluates to 1.U PopCount("b1011".U) // evaluates to 3.U PopCount("b0010".U) // evaluates to 1.U PopCount(myUIntWire) // dynamic count - Source
- Bitwise.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PopCount.type
Members list
Value members
Concrete methods
Implements PopCount(x)>=n with less deep circuitry in case n=0,1,2,x.width-1,x.width
Implements PopCount(x)>=n with less deep circuitry in case n=0,1,2,x.width-1,x.width
Value parameters
- n
-
Int Static value that PopCount(x) is compared against
- x
-
UInt to PopCount
Attributes
- Returns
-
true.B when x has n or more bits set
- Source
- Bitwise.scala
Implements PopCount(x)>=n with less deep circuitry in case n=0,1,2,x.width-1,x.width
Implements PopCount(x)>=n with less deep circuitry in case n=0,1,2,x.width-1,x.width
Value parameters
- n
-
Int Static value that PopCount(x) is compared against
- x
-
Seq/Vec of Bool to PopCount
Attributes
- Returns
-
true.B when x has n or more bits set
- Source
- Bitwise.scala
Implements PopCount(x)==n with less deep circuitry in case n=0,1,x.width-1,x.width
Implements PopCount(x)==n with less deep circuitry in case n=0,1,x.width-1,x.width
Value parameters
- n
-
Int Static value that PopCount(x) is compared against
- x
-
UInt to PopCount
Attributes
- Returns
-
true.B when x has exactly n bits set
- Source
- Bitwise.scala
Implements PopCount(x)==n with less deep circuitry in case n=0,1,x.width-1,x.width
Implements PopCount(x)==n with less deep circuitry in case n=0,1,x.width-1,x.width
Value parameters
- n
-
Int Static value that PopCount(x) is compared against
- x
-
Seq/Vec of Bool to PopCount
Attributes
- Returns
-
true.B when x has exactly n bits set
- Source
- Bitwise.scala
Implements PopCount(x)>n with less deep circuitry in case n=0,1,x.width-1
Implements PopCount(x)>n with less deep circuitry in case n=0,1,x.width-1
Value parameters
- n
-
Int Static value that PopCount(x) is compared against
- x
-
UInt to PopCount
Attributes
- Returns
-
true.B when x has more than n bits set
- Source
- Bitwise.scala
Implements PopCount(x)>n with less deep circuitry in case n=0,1,x.width-1
Implements PopCount(x)>n with less deep circuitry in case n=0,1,x.width-1
Value parameters
- n
-
Int Static value that PopCount(x) is compared against
- x
-
Seq/Vec of Bool to PopCount
Attributes
- Returns
-
true.B when x has more than n bits set
- Source
- Bitwise.scala
Inherited methods
Attributes
- Inherited from:
- PopCount$Intf (hidden)
- Source
- BitwiseIntf.scala
Attributes
- Inherited from:
- PopCount$Intf (hidden)
- Source
- BitwiseIntf.scala