The Daily CLAD

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

Re: CLAD2017 - Fundamentals - Can you carry me?

Active Participant

Assuming Numeric Value In is set to 1.  Which of the following VIs results in Numeric Value Out = 1?

 

NOTE:  More than one answer may apply.

 

a)

Rotate 1.png

b)

Rotate 2.png

c)

Rotate 3.png

d)

Rotate 4.png

Combined.png

Comments
Knight of NI

A, C


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Member

The right answers are A and C, and here is the explanation of every case:Daily CLAD 11 Feb 2018 (2).pngDaily CLAD 11 Feb 2018.png

Member

A,C

Member

A & C

Member

A & C

 

(Rotate Left With Carry Function - http://zone.ni.com/reference/en-XX/help/371361P-01/glang/rotate_left_with_carry/)

 

(Default Value for Boolean is False http://zone.ni.com/reference/en-XX/help/371361P-01/lvconcepts/block_diagram_objects/)

 

In the given answers the shift register only can hold the 1 for the Output.

Member

A & C

B is wrong because carry input always false

D is wrong and to make it work correct you would have to reverse the array. (Number to boolean array function makes the least significant bit of the input the first (0th) element of the output.)

Member

A,C

Member

AC

Active Participant

Agreed A & C

Member

A & C

 

Member

At the 7th iteration, in the carry left case, isn't the left most entry 1  (of 1 0 0 0 0 0 0 0) supposed to turn the boolean to True, since the msb carry out is the former high-order bit of value?

So in this case, when moving to the 8th iteration the boolean should be positive, or am I wrong? And if the boolean is positive, the new low-order bit should get the value 1, so the number is now: 0 0 0 0 0 0 0 1...

Thanks for any help on that.

 


Knight of NI

Lysandros, which version of the code are you referencing?

 


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Member

Hi crossrulz,

In the comment of "Bcortes" from the 2-11-2018, in the yellow "Rotate left with carry" case. At entry value 7), so the 7th iteration, the Value is 1000000, but Carry Out is zero...



Knight of NI

Yes, the Carry Out should be 0.  What was in the MSb goes into the Carry Out.  So going into the 7th iteration, you have 0b01000000.  After the 7th iteration, you have 0b100000000 and 0 in the carry.  After the 8th iteration, you have 0b00000000 and the carry is 1.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines