Vivado-HLS supports C/C++ native data types. In this lecture, 1
we are going to look at the behaviour of these data types in HLS. 2
Each variable that holds data should have an associated data type defined by a type specifier. The three 3
basic native data types in C++ are: bool, char, int. These data types can be used to represent any integer number, 4
character and boolean values. 5
These data types can be modified by the following modifiers: signed, unsigned, short, and long. 6
These modifiers specifically define the bit size of the associated variables and the range of values 7
that they can hold. 8
For example, the char data type requires 8 bits. A variable of the signed char type holds a number between 9
-128 to 127. 10
A value of type unsigned char is between 0 to 255. As an example, variables 11
of this data type can represent the R, G, and B colour code in an image pixel. 12
Unsigned long int requires 32 bits 13
and long long int requires 64 bits. 14
Xilinx Vivado HLS also supports floating-point data types which are float and double. 15
The float data type, which is also called single-precision float, requires 32 bits. And double, which 16
is also called double-precision float, requires 64 bits. 17
Vivado HLS supports float and double types for synthesis. Both data types are synthesized with 18
IEEE-754 standard compliance. 19
A float data type format consists of three fields: Sign bit, exponent and fraction. The single-precision 20
float has one sign bit, a 24-bit fraction and an 8-bit exponent. 21
The double-precision float has one sign bit, 22
a 53-bit fraction and an 11-bit exponent. More details about these types and their related operator will 23
be explained in a separate section along this course. 24
What is the hardware implementation corresponding to variables in an HLS code? The next lecture 25
will focus on answering this question. 26
These are the takeaway messages 27
Vivado HLS supports C/C++ native data types including bool, char, int and float. The bit-size of 28
variables of each C/C++ native data type is known during the synthesis process. 29
Now the quiz question. Write the corresponding bit-width in this table