Jump to content

Concat two INT16 to single int32


Interroga

Recommended Posts

I wold like how to make two interger in single variable , with pointer index ?

Example int 1 (bin) = 1010010101010101
int 2 ( bin) = 111111111111111111
start index for 2° int    16 position
result : 111111111111111_ 1010010101010101

In VisiLogic have block for this ( vector fill) . But in unilogic not found this. You can help me.

Regards ,
mauro.

Link to comment
Share on other sites

  • Interroga changed the title to HOW TO CONCAT TWO INT 16 IN SINGLE 32, KIND VECTOR POSITION
  • MVP 2023

UniStream doesn't have pre-defined arrays so the functions are necessarily different.

You're showing that you want Int 2 in the upper bytes and Int 1 in the lower bytes.

I would do this old school with combination of a bit shifter on int 2 into a long buffer register and then add int 1.

Tags:

Int_1 - INT16

Int_2 - INT 16

Result -  UINT32

image.thumb.png.675fbaacfa4bfff8ab86218721574002.png

 

Joe T.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...