Updated 21 Feb 26
It's this one, of course, by YouTuber Ben Eater. It's IC-based, with not a transistor in sight. I've had a good look at some of his excellent videos, in particular the ones about the registers, the ALU (AU really) and CPU control logic. He even gets to write his own operation codes, micro instructions and assembly language!
His computer is based on one of the machines (the SAP-1) in the book Digital Computer Electronics by Albert Paul Malvino. It has a proper computer architecture and seems very much designed from the top down, whereas I was thinking of moving in the opposite direction, from the arithmetic unit (see a previous post).
It's intended to demonstrate how computers work - the machine can be stepped through instructions one clock cycle at a time and there are LEDs to show the contents of stores. Even so, it's severely limited by having just 16 bytes of program memory! I wonder why it was designed like this? Even with 64 bytes (lines), say, you would be able to write some interesting programs, as I did with a Diehl programmable calculator of similar capacity over 50 years ago. I can only assume it would not be easy to expand it, otherwise surely it would have been done? (The next computer in the book, the SAP-2, can address up to 64k Bytes of memory).
I suppose much more capacity for storing programs would highlight how tricky it is to program with those small dip switches, so larger ones would be needed. A punched paper tape machine and reader would be very useful, if unlikely, additions, but in the absence of those, I think a modern means of programming the EEPROM is quite permissible, as indeed the builder shows with an Arduino. And a ROM with routines for multiplication and division and handling of decimal numbers would be cool, too.
The following notes are here really for my own benefit.
Some key features/highlights:
- an arithmetic unit (AU) supporting addition and subtraction
- two registers, A and B, the contents of which are automatically added into the AU
- registers and other stores can receive (load) and send (enable) contents
- communication between pairs of stores is via an 8-bit bus, one store in send mode, one store in receive mode - no need for point-to-point wiring, hence expandable
- use of tri-state (0, 1, disconnected) gates to control which stores can send (and receive?) data at a time
- 16 bytes* for program storage (in EEPROM), each byte comprising:
- a program line: 4 bits for instruction, 4 bits for associated data
- a data/variables, typically after lines of code: 4 bits
- programming via dip switches (for memory location and content)
*limited by the use of a 4 bit Memory Address Register.
Program instructions
The machine in the book provides the following operations:
- ADD
- HALT
- LDA (load A register)
- SUB
- OUT (send contents of A register to output on 3 digit decimal display)
The builder adds these:
- JC (conditional jump)
- JMP (jump)
- LDI ("load immediate")
- STA ("store accumulator")
These are each implemented by several steps of micro instructions, stored (semi-permanently) in EEPROM:
- AI (A register in)
- AO (A register out)
- BI (B register in; there seems to be no corresponding B register out)
- CE (program counter enable - increments counter)
- CO (program counter out)
- EO (AU sum/sigma out)
- HLT (halt)
- II (instruction register in)
- IO (instruction register out - lower 4 data bits only)
- J (jump)
- MI (memory address register in)
- OI ?
- RI (ram in)
- RO (ram out)
- SU (subtract signal?)
Each instruction is first fetched into the instruction register by the following micro instructions:
- CO MI (puts the program counter into the memory address register)
- RO II CE (puts the instruction into the instruction register and increments the program counter)
- IO MI (loads data portion (lower 4 bits) of the instruction (14) into the Memory Address Register)
- RO AI (sends data at this memory location to the A register, from where it is automatically added to the AU)
If memory location 14 holds the number 28, then the A register and AU both contain 28.
Then ADD 15 (add the contents of memory location 15 to the AU, after being fetched), comprises the following micro instructions:
- IO MI (loads data portion (lower 4 bits) of the instruction (15) into memory address register)
- RO BI (sends data at this memory location to the B register, from where it is automatically added to the AU)*
- EO AI (sends data from the AU to the A register).**
** The A register now contains 42 and that number will also be added to the AU, but that is ignored here
Then OUT, to display the output, after being fetched:
- AO OI
No comments:
Post a Comment