AnyMath 文档

Binary Vector Conversion

将整数转换为二进制逻辑向量,反之亦然。

模块类型: SubSystem

库中的路径:

/Mixed-Signal/Utilities/Binary Vector Conversion

资料描述

座 *Binary Vector Conversion 对二进制编码的向量进行编码、解码和处理。 该块允许您使用二进制代码或附加代码将标量输入信号转换为逻辑矢量信号,反之亦然。 还可以改变二进制逻辑向量的位索引的大小和顺序。

港口

输入

# IN_1 — 的输入信号
标量,标量 | 的逻辑向量

Details

指定为标量或逻辑向量的输入信号。

*编码时,输入信号为标量。

*解码时,输入信号是逻辑向量。

将位流转换为标量值时,任何输入信号都较大 1 它被认为是合乎逻辑的 1 (真的). 同样,任何输入位小于 0 它被认为是合乎逻辑的 0 (错误).
数据类型

漂浮物32, 漂浮64, Int8, Int16, Int32, UInt8, UInt16, UInt32, 布尔

复数支持

非也。

输出

# OUT_1 — 的输出信号
标量,标量 | 的逻辑向量

Details

输出信号被指定为标量或逻辑向量。

*编码时,输出信号为逻辑向量。

*解码时,输出信号为标量。

数据类型

漂浮物32, 漂浮64, Int8, Int16, Int32, UInt8, UInt16, UInt32, 布尔

复数支持

非也。

参数

主分组

# Convert — 转换类型
Scalar to binary-coded vector | Binary-coded vector to scalar | Resize binary-coded vector | Reverse binary-coded vector

Details

由下列值之一指定的转换类型:

  • Scalar to binary-coded vector -将标量输入信号编码成逻辑向量。

  • Binary-coded vector to scalar -将逻辑矢量信号解码为标量。

  • Resize binary-coded vector -更改逻辑向量的大小,同时使用附加代码方法保留符号。

  • Reverse binary-coded vector -将逻辑向量的位索引的顺序改变为相反。

将位流转换为标量值时,任何输入信号都较大 1 它被认为是合乎逻辑的 1 (真的). 同样,任何输入位小于 0 (即,任何负数)被认为是合乎逻辑的。 0 (错误).

Scalar to binary-coded vector | Binary-coded vector to scalar | Resize binary-coded vector | Reverse binary-coded vector

默认值

Scalar to binary-coded vector

程序使用名称

Convert

可调谐

可计算

# Logical vector encoding — 逻辑向量编码方法
Unipolar (magnitude) | Bipolar (2’s complement)

Details

的逻辑向量编码方法,定义为 Unipolar (magnitude)Bipolar (2’s complement).

依赖关系

若要使用此参数,请为参数设置 Convert 价值 Scalar to binary-coded vector, Binary-coded vector to scalarResize binary-coded vector.

Unipolar (magnitude) | Bipolar (2’s complement)

默认值

Unipolar (magnitude)

程序使用名称

Encoding

可调谐

可计算

# Output vector length — 输出向量中的元素数

Details

输出向量中的元素个数,设为正实标量。

依赖关系

若要使用此参数,请为参数设置 Convert 价值 Scalar to binary-coded vectorResize binary-coded vector.

默认值

8

程序使用名称

OutputLength

可调谐

可计算

# Output bit order — 输出位的顺序
LSB at index 1 | MSB at index 1

Details

默认情况下,最低有效位(LSB)是向量的第一个元素(索引1)。 但也可以将最高有效位(MSB)设置为向量的第一个元素。

依赖关系

若要使用此参数,请为参数设置 Convert 价值 Scalar to binary-coded vectorResize binary-coded vector.

LSB at index 1 | MSB at index 1

默认值

LSB at index 1

程序使用名称

OutputReverse

可调谐

可计算

# Input vector length — 输入向量中的元素数

Details

输入向量中元素的个数,设为正实标量。

依赖关系

若要使用此参数,请为参数设置 Convert 价值 Binary-coded vector to scalar, Resize binary-coded vectorReverse binary-coded vector.

默认值

8

程序使用名称

InputLength

可调谐

可计算

# Input bit order — 输入中的位的顺序
LSB at index 1 | MSB at index 1

Details

默认情况下,最低有效位(LSB)是向量的第一个元素(索引1)。 但也可以将最高有效位(MSB)设置为向量的第一个元素。

依赖关系

若要使用此参数,请为参数设置 Convert 价值 Binary-coded vector to scalarResize binary-coded vector.

LSB at index 1 | MSB at index 1

默认值

LSB at index 1

程序使用名称

InputReverse

可调谐

可计算

# Output data type — 输出标量信号的带符号数据类型
Inherit: Inherit via back propagation | float64 | float32 | int8 | int16 | int32

Details

输出标量信号的带符号数据类型。 您可以选择数据类型继承或直接设置它。

依赖关系

若要使用此参数,请为参数设置 Convert 价值 Binary-coded vector to scalar,而对于参数 Logical vector encoding 价值 Bipolar (2’s complement).

Inherit: Inherit via back propagation | float64 | float32 | int8 | int16 | int32

默认值

float64

程序使用名称

DataTypeSigned

可调谐

可计算

# Output data type — 无符号标量输出数据类型
Inherit: Inherit via back propagation | float64 | float32 | uint8 | uint16 | uint32

Details

无符号标量输出数据类型。 您可以选择数据类型继承或直接设置它。

依赖关系

若要使用此参数,请为参数设置 Convert 价值 Binary-coded vector to scalar,而对于参数 Logical vector encoding 价值 Unipolar (magnitude).

Inherit: Inherit via back propagation | float64 | float32 | uint8 | uint16 | uint32

默认值

float64

程序使用名称

DataTypeUnsigned

可调谐

可计算