When I build a 512B RAM, the lag was bad.
If you want at least few hundred bytes of RAM and not run the simulation at 5 FPS, then I would recomend you use the software implementation.
1: Yes, I could have done the RAM like that, but i don't thing it matters which way you make it.
2: I modded it and made the chips smaller, but then wires look large. So now I use this modded version: https://itch.io/post/8412027
Sorry for taking so long. Here you go: https://www.mediafire.com/file/b9qah9skw0kb9ng/BEPMOC.zip/file
This is my 8bit computer i've been making now and then for few week.
Its name is BEPMOC - 8bit easily programmable multi-output computer.
Here it's in an infinite loop counting up:
The four decimal outputs display data in RAM using the display instruction.
The first and second HEX displays show whatever is on the CPU bus and the third is current RAM address(which addres is the computer currently accessing).
They also show you what you're coding.
BEPMOC starts executing instruction on address 0x00 when the BOOT UP pin is pressed. This , inside the CPU, activates the clock.
This is the CPU:
It has three registers(A,B,C). ALU output is stored into R_C
The ALU can: add, subtract, AND, OR, NOT, XOR, <<, >>.
It has a register for input B and a output register, which is copied in R_C.
The FLAGS chip gets ZERO, NEG, SUB flags(also Carry which is not used anywhere).
Inside the chip is a comparator chip which uses the flags to get new flags(ZERO, EQUALS, LARGER, SMALLER), which are then passed to the Control Unit.
This is the CU:
The CU uses 4bit decoders to select operations.
Operation chips use 4bit counter to step through subinstrctions(ENBL R_A, STR R_C, etc.), when they finish they send DONE signal to the Instruction counter and the NEXT INS chip, which retrieves next instruction from RAM.
Instructions are devided into two type: RAM accessing and not.
Instructions which don't use RAM(0x00-0x0F) use only the second nibble.
Instructions which use RAM(0x0X-0xFX(X=address)) use the first nibble for OP Code, and second for RAM address
The RAM is only 16Bytes
(it was pain to make)
Instruction set (X=RAM address)
0x00 | ADD R_A R_B | 0x1X | JUMP |
0x01 | SUB R_A R_B | 0x2X | JUMP IF 0 |
0x02 | AND R_A R_B | 0x3X | JUMP IF == |
0x03 | OR R_A R_B | 0x4X | JUMP IF > |
0x04 | XOR R_A R_B | 0x5X | JUMP IF < |
0x05 | NOT R_A | 0x6X | MOV R_A RAM |
0x06 | << R_A | 0x7X | MOV R_B RAM |
0x07 | >> R_A | 0x8X | MOV R_C RAM |
0x08 | COMPARE R_A R_B | 0x9X | MOV RAM R_A |
0x09 | MOV R_A R_B | 0xAX | MOV RAM R_B |
0x0A | MOV R_A R_C | 0xBX | MOV RAM R_C |
0x0B | MOV R_B R_A | 0xCX | DISPLAY ONTO DISPLAY 0 |
0x0C | MOV R_B R_C | 0xDX | DISPLAY ONTO DISPLAY 1 |
0x0D | MOV R_C R_A | 0xEX | DISPLAY ONTO DISPLAY 2 |
0x0E | MOV R_C R_B | 0xFX | DISPLAY ONTO DISPLAY 3 |
0x0F | HALT |
The limitation of this computer is its small RAM.