Logic algebra minimalization

I believe MrAl is talking about writing your own interpreter. e.g. Bolean Algebra to RPN. nce you have RPN it's easy to evaluate.

The ' can be handled just like UNARY MINUS -A.

I had to to the algebraic to RPN stuff for a class.

For a work program written in BASIC, I did something really cool. We had to enter cross sectional area/length with units in Angstroms, mm, cm and um. So, I wrote a parser that could do stuff like: (2.1 cm * 8000 A) / 1 mm; units of cm were assumed. +-*/^ and PI were implemented.

So, Mr AL is "saving space" by using the lower case bit as a sign bit, so it's like instead of the normal two complement notation, your using magnitude+sign notation. It just makes programming simpler.

~(A+B) could very well compile into:
Push a
NOT
Push b
NOT
+
NOT
 

WBahn

Joined Mar 31, 2012
30,060
I believe MrAl is talking about writing your own interpreter. e.g. Bolean Algebra to RPN. nce you have RPN it's easy to evaluate.

The ' can be handled just like UNARY MINUS -A.

I had to to the algebraic to RPN stuff for a class.

For a work program written in BASIC, I did something really cool. We had to enter cross sectional area/length with units in Angstroms, mm, cm and um. So, I wrote a parser that could do stuff like: (2.1 cm * 8000 A) / 1 mm; units of cm were assumed. +-*/^ and PI were implemented.

So, Mr AL is "saving space" by using the lower case bit as a sign bit, so it's like instead of the normal two complement notation, your using magnitude+sign notation. It just makes programming simpler.

~(A+B) could very well compile into:
Push a
NOT
Push b
NOT
+
NOT
But why wouldn't it simply be

Push A
Push B
+
NOT

But I think I see what you are saying. The interpreter would (or at least could) work with a single case (which would be mapped to a particular register or memory location) and would interpret all references in the other case as a sequence of calls that push the value of the proper case followed by an inversion.
 
But why wouldn't it simply be

Push A
Push B
+
NOT

But I think I see what you are saying. The interpreter would (or at least could) work with a single case (which would be mapped to a particular register or memory location) and would interpret all references in the other case as a sequence of calls that push the value of the proper case followed by an inversion.
Your conception is fine but the devil is in the details. The final implementation might be 16 bit 2's complement integers and actual operators in the programming language such as AND, OR etc. It might use True and False if the compiler allows.
 

MrAl

Joined Jun 17, 2014
11,486
@MrAl - How would you code the following:
'(A+B)​
?

Hello there,

The first thing to note here is that (A+B)' is an expression, not a single variable like a,b,c, etc. This means it gets a functional operator, even the same as just simply A+B without any negation, and that A+B would be written:
Or(A,B).

The negation of that would be written:

Not(Or(A,B))

The key point is when we have a variable that is negated, such as A', where we might have:
A'+B

where this would be written:
Or(a+B)

I suppose you could add more symbolic meaning, for example to negate (A+B) we might write:
[A+B]

but i dont go that far as i just use function calls anyway for any logical interaction between variables, so might as well just use NOT(), Not(), or not(), whatever you prefer.

Another main point is the basic entropy view where we have, for one character, a range of 0 to 255 in one byte yet for letters A through Z we only use, wait, 26 possible values! So we dont utilize the byte storage very well either. In fact, the byte utilization is around 0.1 which is very very low (perfect would be 1.0). This means we have plenty of range to use left over, like 90 percent! Moving to using both A to Z and a to z helps get that factor up a little, although not as much as i would like to see (0.2 still leaving 80 percent leftover). Back in the earlier days of computing this was more important too where a 10 megabyte hard drive cost 400 dollars (USD) (and yes that is 10 megabytes not 10 gigabytes).

I see some other interesting ideas coming up too in this thread.
 
Last edited:

WBahn

Joined Mar 31, 2012
30,060
Back in the earlier days of computing this was more important too where a 10 megabyte hard drive cost 400 dollars (USD) (and yes that is 10 megabytes not 10 gigabytes).
My first computer (a TI Pro -- good machine), which was purchased in 1984 for a bit over $5000 (including a bunch of software) had the option of getting a 10 MB hard drive. But since it would have cost an additional $1500 I opted to live with just two 360 kB floppy drives.
 

WBahn

Joined Mar 31, 2012
30,060
10 MB hard drives were the size of a large suitcase and 65 MB drives were the size of a washing machine. Both had removable disks/packs.
This 10 MB drive was a 5.25" full height drive. It was very state-of-the-art (and hence the princely price tag).

The hard drive that my high school had in the computer lab was the size of a dishwasher. It had a 10 MB fixed disk and a 10 MB removable cartridge. The cartridge was something like 18" in diameter and about four inches thick. I don't know when it was manufactured.
 

djsfantasi

Joined Apr 11, 2010
9,163
This 10 MB drive was a 5.25" full height drive. It was very state-of-the-art (and hence the princely price tag).

The hard drive that my high school had in the computer lab was the size of a dishwasher. It had a 10 MB fixed disk and a 10 MB removable cartridge. The cartridge was something like 18" in diameter and about four inches thick. I don't know when it was manufactured.

You were lucky to have had a HS computer lab! I went into Boston, where I had contacts at universities. I got computer time then.
 

WBahn

Joined Mar 31, 2012
30,060
You were lucky to have had a HS computer lab! I went into Boston, where I had contacts at universities. I got computer time then.
I agree, I was lucky. Though it wasn't much of a lab. Some company had donated an Alpha Micro mini computer to the school along with eight terminals (including two Model 33 and one Model 40 teletype machines). Plus we had about four computers of the TRS-80 class. There was only one course that was offered, Computer Math it was called, and it was specifically geared toward those students that needed one more math class just to graduate (I took the course along with the guy that graduated 433rd in a class of 433). The end of semester project was to write any kind of high-low game (something that is just one problem on a typical homework assignment about three weeks into a real CS-1 course). But, fortunately, the instructor was great and knew how to challenge me to learn way beyond what the course included.
 
Not sure what's better? Getting thrown out of the class to become a ghost which happened in two classes.

or getting told "Your not supposed to know that yet", when I challenged the teachers answers and won.
 

MrAl

Joined Jun 17, 2014
11,486
My first computer (a TI Pro -- good machine), which was purchased in 1984 for a bit over $5000 (including a bunch of software) had the option of getting a 10 MB hard drive. But since it would have cost an additional $1500 I opted to live with just two 360 kB floppy drives.

Hi,

Oh wow that's even more. Somehow i found one for 400 but that was too much too so i stuck with the two 360k floppies too (ha ha) [TRS80 machine]. I was actually happy about the floppies because before that they were only 180k each!
Amazing how things have changed since the 1980's.

My very first computer was built from several boards where when i got to that company we added an extra board for computing, and it was nothing more than a recent calculator chip that we interfaced with the rest of the boards (har har). It was kinda slow though, and because it was for automated processing it was really too slow and should have been faster to meet the clients original specs (those calc chips were slow back then).
My first personal computer i built myself out of a 8080 chip, and my first commercial unit was a Sinclair (ha ha) and i was happy to have 16k of memory (really big laugh there), but my first good computer was the TRS80 which i still have and still works. I dont use the "Trash 80" anymore but in the past have spent many many long hours hunched over the keyboard writing routines for just about everything, but mostly circuit analysis :)
The screen was dark with green (only) alphanumerics, and i did not splurge for the graphics card addition so all i had was text graphics (using maybe asterisks for each data point). Cant believe i got by with that for several years.
The one computer programming course i took used terminals connected to a mainframe.
 
MrAl: I actually built a 'processor" from SSI TTL with my lab partners about the time of the 4004/8008. Each one took a section: Memory, Program counter, data structure. I did the program counter. What a pain.
We designed a 16 W x 16 deep microcode and could sort numbers in ascending and descending order depending on the microcode.

I should still have my lab notes.
 
Top