Input and Output

A project log for A SUBLEQ CPU

Yet Another Minimalistic One Instruction CPU SUBLEQ means SUBtraction jump on Less than or EQual to zero.

agp.cooperagp.cooper 06/10/2017 at 12:190 Comments


Input/Output (IO) in SUBLEQ is not as straight forward as you would expect.


Output (i.e. copy A to [0xff] or (-1)):


If we just did:

then export value would be:

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:

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:



Input is similar:

And here is a switch design:

If the switches are inverted logic then

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:


In summary:

For output:

For Input: