Simple 8-Bit RISC CPU and computer.
Uses only 20 logic chips, 2 EEPROM, and 1 SRAM chip, and one 555 timer.
Uses Harvard architecture, with separate instruction and data memory.
Clock is generated by 555 timer with frequency from 1 Hz to 1000 Hz. Although schematic will probably allow frequency up to 1 Mhz.
Instruction format 16 Bit, with 6-bit opcode, and 10 bit address or 8 bit data.
Instructions stored in two 2KB EEPROM chips. Address space is 10 bits ( 1 KB).
SRAM and EEPROM chips have 11 bits address, i.e. 2 kbytes; but the CPU address is 10 bits (1 K bytes).
Each instruction executes in 1 clock. On positive edge of the clock, instruction executed. On negative edge of the clock, instruction address is incremented.
ALU instructions: Add and Subtract and clear Accumulator.
One output 8-Bit port, and one input or bidirectional 8-Bit port.
ALU executes instructions Add and Subtract and clear Accumulator. One Accumulator 8-Bit register A. Instructions set is very small but allows to execute short programs.
Instruction format is 16 bit.
Consists of 6 bit opcode, and 10 bits address, or 8 bits immediate operand.
Instructions:
No-op.
Clear Accumulator A. ( zero to A)
Add operand to A and store in A.
Subtract operand from A and store to A.
Store value from A to SRAM at address N.
Input operand from input port and add to A.
Output value A to output port.
Jump conditional when Flag overflow.
Jump unconditional.
Operand for Add or Subtract instructions can be: immediate value # from instruction EEPROM,
value from SRAM at address N,
value from input port.
value from accumulator A (add to itself).
Notes:
There is no load A instruction. But one can use ‘Clear’ instruction, following by ‘Add’ instruction to load value to the A accumulator.
ALU and Accumulator operate on 8 bits. But program can compute multi-byte arithmetic operation (add or subtract 16 or 32 bit numbers), in multiple steps.
There is only one conditional Jump instruction and flag carry. But one can use it to test different conditions. For example, to test if A register in not zero: Add value hex FF to A. If flag carry is set then the value in A was not zero.
Input and output 8 bit ports can by connected to devices, like 7-segmend LED display, and keypad, for example.