Start of trail Compare navigation bar

Table of Contents

Bitwise Concatenate

Concatenates binary bits of logical or integral types into larger integral types.

Library

QUARC Targets/Logic Operations

Description

Bitwise Concatenate

The Bitwise Concatenate block concatenates the bits of integral types into larger integral types. For example, it can concatenate two bytes to form a word, where one byte is the LSB and the other byte is the MSB of the word. The block can concatenate the elements of a single vector into a scalar, or it can concatenate multiple inputs into a single output. Logical (boolean) inputs are treated as bits so that individual bits can be concatenated into an integral type.

For example, suppose there is a single uint8 vector input with two elements. The output will be a uint16 scalar that is the combination of the two bytes. If the Most-significant first option is not checked, then the first element of the vector input will become the least-significant byte (LSB) of the output and the second element of the vector input will become the most-significant byte (MSB) of the output. If the Most-significant first option is checked, then the first element of the vector input will become the MSB of the output and the second element of the vector input will become the LSB of the output.

Consider another example. Suppose there are two uint8 scalar inputs. The output will be a uint16 scalar that is the combination of the two inputs. If the Most-significant first option is not checked, then the first input will become the least-significant byte (LSB) of the output and the second input will become the most-significant byte (MSB) of the output. If the Most-significant first option is checked, then the first input will become the MSB of the output and the second input will become the LSB of the output.

If the inputs are vectors instead, then the output will also be a vector, in which each element of the output is the concatenation of the corresponding element of each input.

When the input(s) are logical, or boolean, the Bitwise Concatenate block treats the input(s) as individual bits and concatenates the bits into an unsigned integral type large enough to hold the given number of bits. This feature can be very useful for creating bitmasks, particularly when used in conjunction with the Mux block.

When concatenating signed integral types, the output will be sign-extended. For example, concatenating three signed 8-bit integers produces a 24-bit integer result which is signed-extended and output from the block as a 32-bit signed integer. To avoid sign extension, pass the three bytes as unsigned 8-bit integers instead, or add a fourth input which is a constant zero.

Input Ports

The number of inputs is determined by the Number of inputs parameter. When there is a single input it concatenates the elements of the input vector into a scalar output. When there are multiple inputs, it concatenates across each input to produce the output. In this case, if the inputs are vectors then the output will be a vector of the same size.

All inputs must have the same data type and dimensions.

Output Ports

The output is the concatenation of the inputs. The output data type is determines by the input data types and dimensions.

Data Type Support

The Bitwise Concatenate block supports all the built-in integral types as well as boolean inputs. It can produce integer data types at the output up to 64 bits in size. Boolean inputs are treated as individual bits. Hence, the Bitwise Concatenate block can concatenate bits into an integer.

Parameters and Dialog Box

Bitwise Concatenate

Number of inputs

The number of inputs to the block. If there is only one input, then it concatenates the elements of the input to produce a scalar output. If there is more than one input, then it concatenates across inputs to produce the output. In that case, if the inputs are vectors then the output is a vector of the same dimensions.

Most-significant first (tunable offline)

If this option is checked then the first element or input is used as the most-significant portion of the concatenated output. Otherwise, it is the least-significant portion.

For example, if there are two uint8 inputs then the output will be a uint16. If Most-significant first is not checked, then the first input will become the least-significant byte (LSB) of the uint16 output, and the second input will become the most-significant byte (MSB). If the Most-significant first option is checked, then the first input becomes the MSB and the second input becomes the LSB.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

Yes

Yes

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

* Compatible means that the block can be compiled for the target.

 

navigation bar