Operator CastType

Operator Library: Base

運算子 CastType 會變更邏輯鏈結 Property Arithmetic。 輸入和輸出值的位元是相同的。硬體中不會對值進行任何變更。 因此,該運算子不需要任何 FPGA 資源。

Bit Width Input Value Input Arithmetic Output Arithmetic 輸出值 Comment
Decimal Binary Decimal Binary
4 5 0101 unsigned signed 5 0101
4 10 1010 unsigned signed -6 1010 值的解讀方式已變更
4 5 0101 signed unsigned 5 0101
4 -1 1111 signed unsigned 15 1111 值的解讀方式已變更

表 33. 範例


I/O Properties

Property Value
Operator Type O
Input Link I, data input
Output Link O, data output

支援的 Link 格式

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]。

參數

無

使用範例

以下範例顯示了運算子 CastType 的使用方式: