LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simplest method in finding a Numeric Palindrome

Solved!
Go to solution

So it is always possible to minimize any logic?  Really?

 How do you minimize this one?

 Capture

0 Kudos
Message 11 of 44
(1,804 Views)

Hi RavensFan,

 

you were asking for this:

check.png

Two options :D:D:D

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 44
(1,793 Views)

PriyadarsiniS wrote:

 

Every single logic can be further minimized with LabVIEW, in that perspective.. it is always possible.

 


In my youth, I used a PDP-8 computer, with 4K of 12-bit memory organized in "pages" of 128 12-bit "words".  There was a premium in keeping code on the same "page" (faster, smaller) -- a colleague and I formulated the Claim "You Can Always Save One Core Location" (but we knew we couldn't apply this repeatedly ...).  This wasn't true then, and is likely not true now (just iterate the claim ...).

 

Bob Schor

0 Kudos
Message 13 of 44
(1,782 Views)

@GerdW wrote:

Hi RavensFan,

 

you were asking for this:

check.png

Two options :D:D:D


Still too complicated.  Just have the terminal with the indicator's default set to 2.


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
Message 14 of 44
(1,780 Views)

@crossrulz wrote:

@GerdW wrote:

Hi RavensFan,

 

you were asking for this:

check.png

Two options :D:D:D


Still too complicated.  Just have the terminal with the indicator's default set to 2.


Why is it DBL? That's 8 times too many bits! U8 is sufficient!

(I would just write a diagram comment containing the character "2")

 

 

Message 15 of 44
(1,768 Views)

@altenbach wrote:

(I would just write a diagram comment containing the character "2")


Constant folding eliminates the code all together.  So I would just have a blank VI.  But if we are going that far, no VI!


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
0 Kudos
Message 16 of 44
(1,763 Views)

@PriyadarsiniS wrote:

 

Is this signify equal, number to string conversion and reverse strings shouldn't be said functions. Am I clear ?!

 


No, not clear at all. What is "this" and what does the rest of the sentence even mean?

 


@PriyadarsiniS wrote:

 

My work is to reduce the functions used and to check Palindrome, whatever be the numeric range. 


This is a very open ended statement. How about integers that don't fit into a numeric datatype, such as a number with tens of thousands of digits?

 


@PriyadarsiniS wrote:

LUT.PNG

 


Can you explain your reasoning for using a WHILE loop here? The fact that you are using a while loop tells me that you are not an experienced programmer and don't know about datatypes. First of all, if you don't stop the loop relatively quickly, you'll run out of memory. After 2^31 iterations you have reached the end of the range of the I32 datatype of the iteration terminal and all further iterations are meaningless. An array cannot have more elements, because the index is also I32. You could use 8x less memory by using every bit (i,e LV4.x type flattened boolean array) but then the lookup code would need more primitives.) Another option would be to only store palindromes and do a binary search of the array to see if an input exists. You probably could even do something with variant attributes.

 

0 Kudos
Message 17 of 44
(1,758 Views)

@altenbach wrote:

@crossrulz wrote:

@GerdW wrote:

Hi RavensFan,

 

you were asking for this:

check.png

Two options :D:D:D


Still too complicated.  Just have the terminal with the indicator's default set to 2.


Why is it DBL? That's 8 times too many bits! U8 is sufficient!

(I would just write a diagram comment containing the character "2")

 

 


A U8? Do you think bits grow on trees? Use FXP<+,1,2>

 

Or maybe a 0-byte file with the name "2"

Matt J | National Instruments | CLA
0 Kudos
Message 18 of 44
(1,754 Views)

@Jacobson-ni wrote:

Or maybe a 0-byte file with the name "2"


I am holding up two fingers. Good enough?

Message 19 of 44
(1,739 Views)

While not my area of expertise...

 

Can it be done using a regular expression?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 20 of 44
(1,726 Views)