Learning BSV‎ > ‎Data Types‎ > ‎

Bit Types

Bits defines the class of types that can be converted to bit vectors and back.  Only types in the Bits class are synthesizable and can be stored in a state element, such as a Register or a FIFO.

At the lowest level, synthesizable objects can be considered as a wire or wires having some fixed width and interpretation.  These correspond to Verilog wire and reg, and additionally have tighter semantics surrounding their use. 

The Bit types are:
  • Bool :     True or False values
  • Bit#(n):   n Bits
  • UInt#(n): Unsigned fixed width (n) representation of an integer value
  • Int#(n) :  Signed fixed width (n) representation of an integer value

These Bit types can be combined into other types through the use of user defined structures  or by using the  many pre-defined  types in the Bluespec FoundationIP Library.

Bluespec provides Data Type Conversion Functions for converting between types, or you can write your own functions.