SUBLEQ IO
Input/Output (IO) in SUBLEQ is not as straight forward as you would expect.
Output
Output (i.e. copy A to [0xff] or (-1)):
- subleq T T ?
- subleq A T ?
- subleq T (-1) ?
where:
- A is the output value
- (-1) is the address (i.e. 0xFF) of the output register
- but the read value of address (-1) needs to be 0
If we just did:
- subleq A (-1)
then export value would be:
- B - A
where B is the value read.
if B = -1 then the exported value is -1 - A or ~B, then all that needs to be done is to invert the output.
So the following would work:
As I pull the address and data busses up with 22k resistors then the 74LS373 is redundant and can be removed (providing nothing else uses its address space). To save the output inverters we could use:
- subleq T T ?
- subleq 1 T ?
- subleq A T ?
- subleq T (-1) ?
For TTL and LEDs the following would work (note: the pull up resistors supply most of the current for the LEDs):
If we are writing to LEDs then all we really need is:
- subleq A (-1)
And:
Input
Input is similar:
- subleq T T ?
- subleq (-2) T ?
- subleq A A ?
- subleq T A?
And here is a switch design:
If the switches are inverted logic then
- subleq A A ?
- subleq 1 A ?
- subleq (-2) A ?
And here is a switch design:
Hardware Help
It would be useful to have a NAND in hardware. As the inputs to the NAND are inverted and the output is inverted than a NOR gate will result in a NAND function. Why NAND? All the other functions can be generated and the XOR can be generated as shown below but in software:
Summary
In summary:
- use bus pull up resistors
- use the simplest input and output registers
- Invert the logic before output (A=-A-1)
- negate the logic after input (A=-A)
For output:
- subleq T T ?
- subleq 1 T ?
- subleq A T ?
- subleq T (-1) ?
For Input:
- subleq T T ?
- subleq (-2) T ?
- subleq A A ?
- subleq T A ?
AlanX
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.