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 - Friday Mind Bender - Multiply those BITs

SercoSteveB
Active Participant

What is the value of Numeric Value Out following execution of the VI?

 

Friday Fun Time #1.png

 

a) 0

b) 6

c) 9

d) 12

Comments
crossrulz
Knight of NI

B


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

B

 

The Number to Boolean Array function outputs an array of 8, 16, 32, or 64 True or False elements (depending on the numeric representation of the input integer). For simplicity let’s assume a U8 data type. 14 in binary is [00001110], so we get a Boolean array of: [FFFFTTTF]. The 0th element is the least significant bit, which in this case is the false element on the far right.

 

As this array is auto indexed into the for loop, only values of the iteration count, i, with a corresponding ‘true’ are auto indexed into the output array. As a result the output array has [1,2,3]. 

 

The multiply array elements simply multiplies all the elements in an array and as a result, the value of the numeric value out is simply 1*2*3 = 6. 

nik35324
Member

B

Matt-A.
Member

B  6.

 

 

qubirt
Member

B

CataM
NI Employee (retired)

b)

Ellie90
Member

B

Technoliv
Member

B

SercoSteveB
Active Participant

Answer: B.  Nice one all.  Yep, as GladysToMeetYou states

alexderjuengere
Active Participant

b

multiplythosebits.png

rak84
Member

B

istan0227
Member

B