The language includes the integer and fixed-point register class templates of Algorithmic C [algc], which may be instantiated as follows:

`ac_int<`and*n, false*>`ac_int<`: unsigned and signed integer types of width , where may be any positive integer;*n, true*>`ac_fixed<`and*n, m, false*>`ac_fixed<`: unsigned and signed fixed-point register types of width with integer bits, where may be any positive integer and is any integer.*n, m, true*>

typedef ac_int<96,false> ui96; typedef ac_int<48,true> si48; typedef ac_fixed<64,4,false> uf64i4; typedef ac_fixed<32,16,false> uf32i16;

A register is associated with two values, a *raw value*, which is a bit vector of the same width as the register,
and an integer or rational *interpreted value*. The interpreted value is derived from the raw value according to the
register's type as follows:

`ui`(unsigned integer): The interpreted value is the same as the raw value, an integer in the interval .`si`(signed integer): A signed version of`ui`, with the leading bit interpreted as the sign. Thus, the represented range is the interval of integers .`uf``i`(unsigned fixed-point): Interpreted with an implicit binary point following the most signficant bits. The represented values are rational numbers of the form , where is an integer and .`sf``i`(signed fixed-point): A signed version of`uf``i`, representing rational numbers of the form , where .

*(a)
;*

*(b)
;*

*(c)
;*

*(d)
.*

The Algorithmic C register types include a "bit select" operator and "bit slice" methods. Bit selection is independent of
the register type (signed vs. unsigned, integer vsfixed-point) and uses the familiar syntax. Thus, a bit of a
register may be extracted or assigned in the natural way. The syntax of bit slices is less straightforward. The slice
extraction method `slc` requires a constant template parameter indicating the width of the slice and a variable argument
that represents the base index. Thus,

x.slc<4>(n)determines the slice of

x[n+3,n].The value of this method is an integer register (independent of whether the register is integer or fixed-point) with ther same width parameter as the method and the same sign parameter as the operand. Thus, the numerical value of a slice is a signed or unsigned integer according to the type of the register from which it is extracted.

A bit slice is modified by a method of two arguments, the base index and an integer register containing the value to be written. The width of the slice is not specified explicitly, but rather is inferred from the type of the second argument. For example, the assignment

x.set_slc(n, ui4(6))replaces the slice of

x[n+3:n] = 6.

David Russinoff 2017-08-01