cancel
Showing results for
Did you mean:

## Rotate Left with Carry

Active Participant

What are Numeric Value Out 1 and Numeric Value Out 2 following execution of the VI.

a) Numeric Value Out 1 = 0x468ACF12, Numeric Value Out 2 = 0x468ACF02

b) Numeric Value Out 1 = 0x2468ACF0, Numeric Value Out 2 = 0x2468ACF1

c) Numeric Value Out 1 = 0x0ECA8643, Numeric Value Out 2 = 0x0ECA8642

d) Numeric Value Out 1 = 0x2468ACF1, Numeric Value Out 2 = 0x2468ACF0

Member

D i think

Learning LabVIEW since January 2013
Member

Member

I got the Answer D like this what is the problem here can any one tell me

Numaric value out 1 is 0x2468ACF0

Numaric value out 2 is 0x2468ACF1

Active Participant

Question modified. Any better?

Member

Knight of NI

D

Another one of my favorite functions that people don't seem to know about.

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

D.

Member

D.

Another one I used all the time when I wrote assembly, but not so much in any higher level language.

Member

D.

Active Participant
Active Participant

agreed D as well....

Member

Question- do the bits get rotated left? Like shown here

Knight of NI

Except for the fact that you get to specify what the carry input is.

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

Thank you for your answer. x12345678 is 10010001101000101011001111000. If I rotate each bit one bit to the left (from LSB to MSB), I should get 00100011010001010110011110001. The MSB was 1, it is now 0. Did I understand correctly?

Member

http://en.wikipedia.org/wiki/Logical_shift

http://zone.ni.com/reference/en-XX/help/371361L-01/glang/rotate_left_with_carry/

D

I still prefer the term shift instead of rotate, rotate is misleading.

But LabVIEW help is quite clear (see link)

Member

Please can any one explain it in detail that how these 0x2468ACF1 and 0x2468ACF0 answer came.

Knight of NI

Akhil_shah,

Look at the values in a binary format and it will become a lot more obvious (do make sure you are seeing all 32 bits).  We are just shifting all of the bits to the left by one location and then specifying what value goes in the LSb (Least Significant Bit).

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

D