Close
0%
0%

8-bit RISC CPU from TTL logic

yet another attempt making 8-bit RISC CPU from TTL logic.

Similar projects worth following
8 bit RISC CPU, revisited. A simple RISC CPU made from TTL chips. Why? Just for the fun, to return to basics of digital circuit design. While much more powerful RISC cpu can be made on FPGA, but it just not have the look and nostalgic feel of a device made from discrete parts. In prior completed project, I built simple 4-Bit RISC CPU and computer. It was functional "computer", but very limited without RAM and only 4 bit address and data and with only Add instruction. https://hackaday.io/project/191290-the-simplest-4-bit-risc-cpu This project is the expansion of same architecture to 8-Bit RISC which is more functional computer. Data is 8 bit, and address expanded to 10 bits, (1 KB address space), which is sufficient to execute some program like calculator or controller. Add and Subtract instructions, and I/O ports, and 1 KB RAM. Simple 8-Bit RISC CPU. Harvard architecture with separate program memory and RAM.

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.

PCB_PCB_P12345-2025-Jul4-8bit-10b_2_2025-07-05.pdf

PCB design, PDF, Easyeda

Adobe Portable Document Format - 356.43 kB - 07/06/2025 at 03:24

Preview

Schematic_P12345-2025-Jul4-8bit-10b_2025-07-05.pdf

Schematic, PDF , Easyeda

Adobe Portable Document Format - 324.32 kB - 07/06/2025 at 03:24

Preview

View project log

  • 1
    CPU instruction set

    CPU instruction is 16 bits wide                     
    10 bits data, 6 bits opcode.
    Address is up to 10 bit (1kb),
    Immediate Data is 8 bit. 

    Instructions:                    
    adddres/data    CPU opcode            
    10 bits         6 bits Hex
               0      00  h - Noop            
               0       01  h - clear Accumulator A (A=0)            
    ...address    02  h - jump conditional if overflow            
    ...address    03  h - jump unconditional            
    ...#data..       0C  h - add immediate data to A            
                0      0D  h - add value of A to A (A=A*2)            
    ....address    0E  h - add value from SRAM to A            
    .... port..        0F  h - add value from input port to A            
    ....#data..      14  h - subtract immediate data from A            
                  0    15  h -  subtract value of A from A            
    ....address    16  h - subtract value from SRAM to A            
    .....port..        17  h - subtract value from input port from
    ....address    1D  h - store value A to SRAM by address    
    .....port..        25  h  - write value A to output port    

    Notes:
    There is no Load instruction. But one can use Clear accumulator, followed by add instruction to load value.
    There is only one flag Carry (overflow). But it can be used to check different conditions, i.e. not zero, lesser than, and so on.
    ALU is 8 bits wide. But multi-byte numbers can be added or subtracted in several steps, using carry flag.

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates