The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Split Number and Rotate

SercoSteveB
Active Participant

What is Numeric Value Out following execution of the VI?

Split and Rotate.png

a) 0x41236785

b) 0x23416785

c) 0x23418567

d) 0x41238567

Comments
LordNobady
Member

I think C


Learning LabVIEW since January 2013
nmpundlik
Member

Answer is C.

sumapatil
Member

anyone please explain

crossrulz
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.


GCentral
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
TejaskumarPatel
Member

Can you please Explain ..

I am stuck at Rotate function...

Tejaskumar Patel | (CLD)
crossrulz
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.


GCentral
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
2verb
Member

C

Does anyone use rotate? If so, for what?

TejaskumarPatel
Member

Danke Got it

Tejaskumar Patel | (CLD)
crossrulz
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.


GCentral
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
JGmitter
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. 

MrStevenUND
Member

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

Musale
Member

Please expalin how a Rotate function works???

LordNobady
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.

say you start with

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
RAMESHB
Member

Answer is C.

Asha_Nagaraj
Member

C.

SercoSteveB
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.

mini09
Active Participant

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

skian
Member

Thanks crosseulz , I was struggling to figure out how think about this in a CLAD exam context. Shifting a hex character is the way to think about this question.