Merge Block with Unequal Input Widths Example

This example shows how to use the Merge block with inputs ports that have different widths. If you select Allow unequal port widths, the block accepts scalar and vector inputs having differing numbers of elements. You can specify an offset for each input signal relative to the beginning of the output signal. The width of the output signal is:

where are the widths of the input signals, and are the offsets.

The Merge block has the following output width.

In this example, the offset of is 0 and the offset of is 1. The Merge block maps the elements of to the first two elements of and the elements of to the last two elements of . Only the second element of is effectively merged, as show in the scope output.

If you use Simplified Initialization Mode, you must clear the Allow unequal port widths check box. The input port offsets for all signals must be zero.