Close

Schematic and PCB

A project log for Hardware Controlled 4 bit CPU

A hardware controlled 4 bit CPU based on lessons learnt from the TD4 and the CHUMP CPUs

agpcooperagp.cooper 12/22/2022 at 12:402 Comments

Schematic and PCB

Started the schematic design, the ALU is pretty well all new, so it will take time.

The layout will be important as the auto-router will struggle with this many chips.

---

The 16 byte diode PROM boards arrived today. Two boards will have nearly 400 components, so they will take a while to solder.

---

Some updates to the simulation model.

---

Some progress on the schematic, trying to group the chips:

Instruction Set Again

The minimum instruction set is:

  1. LOAD
  2. ADD
  3. NAND
  4. ?
  5. JNC
  6. STORE
  7. READ
  8. PAGE

Missing are instructions like LEA, CALL and RTN, etc, but these require structural changes. 

Subtraction is pretty easy to do, I will use reference variables here.

A = A SUB B:

Test if equal:

Test if bits are HIGH:

Test if bits are LOW:

Other logic gates can be derived from the NAND gate, but may require memory to store intermediate results. Although NAND can replace XOR in many cases, XOR is "necessary" for efficient toggling of bits.

An alternate instruction set is:

  1. LOAD
  2. ADD
  3. AND
  4. XOR
  5. JNC
  6. STORE
  7. READ
  8. PAGE

Subtraction is using XOR.

A = A SUB B:

Test if equal:

Test if bits are HIGH:

Test if bits are LOW:

OR is awkward, using memory reference here again:

Compared to AND:

Compared to XOR using NANDs:

AND versus NAND

While AND has the advantage that the logic in the general use case is slightly simpler.

If I need to free up an op code slot (i.e. the XOR slot), the NAND op code is the way to go.

Second Thoughts

Not a lot to gain from the second op code page. I think I should have spent my time looking at structural changes.

There are efficient algorithms for multiplication and division that only use ADD and NAND, so SAR and SAL and not required op codes.

Where to Next?

May be a stack to push/pop return addresses and intermediate results?

Eventually I want to look at a single cycle Von Neumann architecture.

AlanX

Discussions

agp.cooper wrote 12/23/2022 at 06:27 point

Yes absolutely, it was a missed opportunity, and I did want to try it.
I do have a box of DIP switches and diodes, but really I am not looking forward to soldering 400 components.

Regards AlanX 

  Are you sure? yes | no

Ken Yap wrote 12/23/2022 at 04:54 point

Surely the PROM board is a prime candidate for PCB assembly to save your eyesight and yourself from RSI?

Or do you have a whole box of diodes and DIP switches you want to "use up"?

  Are you sure? yes | no