cancel
Showing results for
Did you mean:

## Re: Split Number and Rotate

Active Participant

What is Numeric Value Out following execution of the VI?

a) 0x41236785

b) 0x23416785

c) 0x23418567

d) 0x41238567

Member

I think C

Learning LabVIEW since January 2013
Member

Member

Knight of NI

C

sumapatil, what are you stuck?  Try probing around and looking at the context help for these functions to figure them out.  If you are still stuck, tell us where you are stuck and then we can better help.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Member

I am stuck at Rotate function...

Knight of NI
 TejaskumarPatel wrote:I am stuck at Rotate function...

The Rotate function is a BIT shift.  The shift is to the left (to MSb).  So if the number of bits to shift is negative, it is really a shift to the right (to LSb).  Since we are using the Rotate (and not the plain old shift), the bits that fall off get put back at the end.

Now since we are rotating by 4 bits (ie 1 hexidecimal character), a single hex character is just moved to the other end of the number.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Member

C

Does anyone use rotate? If so, for what?

Member

Danke Got it

Knight of NI
 2verb wrote:Does anyone use rotate? If so, for what?

Can't say I've actually used rotate.  I use shift all the time though with various protocols I have had to use.  I'm sure there's algorithms out there that use rotate.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Member

C.  Interesting question.  I learned something again!  I'm not sure if I can think of a use case for this but I'm sure there is.

Member

C.  I have had to use rotate, but I don't recall why at the moment.

Member

Please expalin how a Rotate function works???

Member
 Musale wrote:                        Please expalin how a Rotate function works???

A rotate function rotates the bits the specified number of times to the left.

In this case the bits that fall of at the left end up at the right.

1011(2) and you rotate it 2 times

after the first time ( iteration ) you end up with 0111 and after the secont with 1110.

PS. I don't think you can do a bit rotate with 4 bits in labview. if you can please tel me how.

Learning LabVIEW since January 2013
Member

Member

C.

Active Participant

Answer: C.  Nice one LordNobady, nmpundlik, crossrulz, 2verb, J-MACK, MrStevenUND, RAMESHB & Asha_Nagaraj

Nice explanantions crossrulz & LordNobady thanks.

We do alot of bit manipulation (spliting, joining, rotating, shifting, etc. etc.) in the FPGA world, I think the only time we do similar at Windows or RT level is when processing the data coming back from FPGA.

Active Participant

Agreed C.... Steve that is an nice application area we can use as i never used it so far.

Member