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.
The right answers are A and C, and here is the explanation of every case:
A & C
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.
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.)
Agreed A & C
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.
Lysandros, which version of the code are you referencing?
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...
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.