From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

The Daily CLAD

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

Re: CLAD2017 - Answer the requirement: Find those ones

SercoSteveB
Active Participant

You are tasked with writing a VI that searches an input array of U8 numeric values (Data Array In) and identifies which elements within that array contain values that have one or more of the same BITs set to B'1' as those in a match U8 numeric (Match Value) .  Elements in the input array that have one or more of the same BITs set to B'1' as those in the match numeric should be added to a U8 array returned by the VI (Matched Elements Array Out).  Which of the following VIs does NOT satisfy those requirements?

 

Example: If the Match Value = 5 (B'00000101) only elements from Data Array In with BIT2 and/or BIT0 set to B'1' should be included in Matched Elements Array Out.

 

Have a go at coding a VI yourself or expand the Spoiler tag to see the answer options:

 

Spoiler

a)

Match Ones #1.png

 

 

 

b)

Match Ones #2.png

 

 

c)

Match Ones #3.png

 

d)

Match Ones #4.png

 

 

Comments
crossrulz
Knight of NI

C


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

I like A for this one (unless I'm not understanding the problem well). It's exactly how I made it before looking at the options.

SercoSteveB
Active Participant

Hi ARL00000000000000 (hope I spelt that correctly).  Have another read of the question, it is a variation on the normal theme.

ARL00000000000000
Member

LOL... I totally missed the (very clearly highlighted) "NOT satisfy", I was thinking how on earth is "C" possibly correct?

 

So yes, "C" is most certainly not going to satisfy the requirement.

GladysToMeetYou
Member

C

 

Took a while to figure out, but I finally understand it!

nik35324
Member

C

CataM
NI Employee (retired)

c)

Matt-A.
Member

C.  I needed some time, more than my morning check of the blog, to digest this one.  Is this similar to a "new" CLAD question? 

SercoSteveB
Active Participant

I haven't seen a find the one that doesn't satisfy the requirements type question, but why not. What I am more interested in is, is it your final answer?

Ellie90
Member

c

qubirt
Member

C

SercoSteveB
Active Participant

Answer: C.  Nice one all.

Priya16
Member

Can anyone please explain the Difference between C & D in detail? Exactly where the difference will occur to get matched element in D not C?

Shane-C
Member

C is comparing every element of the U8 to a single bit from the Match value.  D is comparing every element of the U8 to every element of the match value.  See where the auto indexing terminal are?