Operator CastType

Operator Library: Base

運算子 CastType 會變更邏輯連結屬性Arithmetic 。 輸入值與輸出值的位元完全相同。硬體端不會對該值進行任何變更。 因此,此運算子無需佔用任何 FPGA 資源。

Bit Width 輸入值 Input Arithmetic Output Arithmetic 輸出值 備註
十進位 二進位 十進位 二進位
4 5 0101 無號數 有號 5 0101
4 10 1010 無號數 有號 -6 1010 價值的詮釋已有所改變
4 5 0101 有號 無號數 5 0101
4 -1 1111 有號 無號數 15 1111 價值的詮釋已有所改變

表 33. 範例


I/O Properties

Property Value
Operator Type O
Input Link I,資料輸入
Output Link O,資料輸出

Supported Link Format

Link Parameter Input Link I Output Link O
Bit Width [1, 64]1 as I
Arithmetic {unsigned, signed} {unsigned, signed}
Parallelism any as I
Kernel Columns any as I
Kernel Rows any as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} as I
Color Format any as I
Color Flavor any as I
Max. Img Width any as I
Max. Img Height any as I

1

輸入 Bit Width 的範圍為 [1, 64]。 對於有號輸入,範圍為 [2, 64]。 對於無號彩色輸入,範圍為 [3, 63],而對於有號彩色,範圍則為 [6, 63]。

Parameters

無

Examples of Use

以下範例展示了 CastType 運算子的用法: