--- title: "Timex Logic, Part 1" type: "article" slug: "timex-logic-part-1" url: "http://localhost/article/timex-logic-part-1/" markdown_url: "http://localhost/article/timex-logic-part-1.md" published_at: "2022-10-07T12:25:41+00:00" modified_at: "2026-08-04T14:11:39+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "This series of articles is called Timex Logic rather than computer logic because not all computers treat and/or use logic as fully as the Timex computer can. Some of the logic operations described in this series cannot be used on many other computers, including one fruity one, widely pushed onto our public school systems. This…" category: - name: "LISTing Newsletter" slug: "listing-newsletter" taxonomy: "category" url: "http://localhost/category/periodicals/listing-newsletter/" post_tag: - name: "Best of Timex/Sinclair 1000 Articles and Documents" slug: "ts1000best" taxonomy: "post_tag" url: "http://localhost/tag/ts1000best/" - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "Reference" slug: "reference" taxonomy: "post_tag" url: "http://localhost/tag/reference/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Warren Fricke" slug: "warren-fricke" taxonomy: "indiv" url: "http://localhost/indiv/warren-fricke/" publication_r: id: 38992 title: "LISTing Newsletter" type: "periodical" url: "http://localhost/periodical/listing-newsletter/" authors: "Warren Fricke" authors_r: - name: "Warren Fricke" slug: "warren-fricke" taxonomy: "indiv" url: "http://localhost/indiv/warren-fricke/" issues_articles: - id: 40152 title: "LISTing Newsletter January 1991" type: "issue" url: "http://localhost/issue/listing-newsletter-january-1991/" pages: "7, 9" pubdate: "January 1991" related_articles: - id: 45842 title: "Timex Logic, Part 2" type: "article" url: "http://localhost/article/timex-logic-part-2/" - id: 45843 title: "Timex Logic, Part 3" type: "article" url: "http://localhost/article/timex-logic-part-3-2/" archive_link: false --- # Timex Logic, Part 1 This series of articles is called Timex Logic rather than computer logic because not all computers treat and/or use logic as fully as the Timex computer can. Some of the logic operations described in this series cannot be used on many other computers, including one fruity one, widely pushed onto our public school systems. This is not intended to imply that other computers cannot perform similar tasks. They can do the same thing by devious means but need more programming lines and consume more time in so doing. Appropriate logic can cut a lot of corners. Line 10, that follows, is a statement containing a single logic condition. The construction of the line is typical of most, but not all, logic statements….. IF “some logic condition” THEN….. ``` 10 IF X>5 THEN PRINT "OK" ``` `X>5` is read X “greater than” 5, is a logic condition or relation. `X`…is a variable that may have any numerical value. `>`..means “greater than” & is one of six symbol operators, `=`, `<`, `>`, `<=`, `>=`, and `<>`. Refer to page 228 of the manual for their meanings. Line 10 means that if X is greater in value than 5, print the word “OK”. Whatever follows THEN is the action to be taken, which can be almost anything. Simple as this statement seems to be, the computer must evaluate the logic condition of X>5 before it can act properly. It does this by making a comparison between X and 5, and then substituting a “logic value of 1” for the condition if the condition is TRUE, or a “logic value of 0” for the condition if it is FALSE. It follows that the condition will be TRUE or FALSE depending upon the value of the variable X at the time the computer works on this line, and the comparison is made. Although the computer itself assigns a logic value of 1 to a TRUE condition, it considers any number other than 0 to be logical TRUE, even negative numbers. Thus a logic value of 0 denotes a FALSE condition and any other logical value denotes a TRUE condition. Hence, logic is number oriented. We can test this by adding a program line.. ``` 5 LET X=6 ``` If we now RUN this two-line program, line 10 will print out the word “OK”. This is because the logic condition of X>5 is TRUE, and the computer substituted a logic value of 1 for the condition. By direct entry have the computer PRINT X>5 and the response will be 1, the logic value of a TRUE condition. If we change the value of X in line 5 to say 3 and RUN the program again, nothing prints out. This is because the computer assigned a logic value of 0 to the X>5 condition, as it is now FALSE. As before, and by direct entry, ask the computer to PRINT X>5. The response will be 0, the current logical value of X>5. Now DELETE line 5. And in line 10 in place of the condition X>5, substitute 1, the logic value for a TRUE condition. RUN the one-line program and the word “OK” will print. It will also print “OK” no matter what numerical value is substituted for X>5, even negative values. Try some. But if a 0 is substituted for X>5, indicating a FALSE condition, nothing prints out. It is important to realize that the conditions referred to as TRUE or FALSE do not involve morals nor are they indicative of desireability in any way. They are merely terms handed down from a branch of mathematics that was in existance long before the Timex computer. You can verify this by running thru the preceding exercises with the condition changed to read X<5, or X=5, etc. NOT is unique as a logic operator. It is the only one of them that is also a function; so it always has a following argument (condition) and a subsequent result, which in this case is always 0 or 1. Unlike other functions its priorty is a low 4, ranking it below the six symbol operators and just above AND and OR. NOT is used principally to inverse the logic value of another logic operation. In expressions like NOT X=Y, if X=Y is TRUE (logic value 1), NOT X=Y is FALSE (logic value 0). If X=Y is FALSE, then NOT X=Y is TRUE. In this combination, the Timex computer evaluates the operation X=Y first, as the logic symbol `=` has a priority higher than NOT. Parentheses (high priority) around the operation X=Y are not needed to do this, but may be used sometimes for clarity. The Timex computer simply ignores superfluous parentheses. NOT can be eliminated, if desired, by inversing the expression that it modifies. For example, NOT X=Y can be replaced by X<>Y. But use care in so doing. The inverse of X>Y is X<=Y, and not simply X