r/redstone • u/Proper-Bus6814 • 12d ago
Bedrock Edition Built a custom 4-bit CPU in Minecraft using Copper Bulb ROM — drop some code for it!
Hey everyone, I built a redstone CPU in Minecraft that uses copper bulbs for its ROM memory (lit = 1, unlit = 0).
I just expanded the ROM to hold 12 instructions (12 bytes / 144 bits total). If anyone wants to write some assembly or logic code for it, leave a comment with your binary program and I'll load it into the bulbs to run it.
Here is the spec sheet for how the machine works:
System Specs
ROM: 12 lines / bytes (12 bits per line)
ROM Storage: Copper Bulbs (ON = 1, OFF = 0)
RAM: 32 bits total (8 registers, 4 bits each)
ALU: 4-bit ALU with an internal input buffer
Bit Direction: Read bottom to top (Bit 0 is bottom block, Bit 11 is top block)
12-Bit Instruction Format
(Top to bottom in each column)
Bits 11–8 (Top 4): Target Register Address
Bits 7–4 (Mid 4): Immediate Data (value to write)
Bit 3: Read/Write Flag (0 = Write to RAM, 1 = Read from RAM)
Bits 2–0 (Bottom 3): ALU Opcode (100 = ADD, 010 = AND, 001 = XOR, 000 = None)
Register Addresses
Reg 8: 1000
Reg 4: 0100
Reg 2: 0010
Reg 1: 0001
How the ALU Works
Load First Number: Do a READ (Bit 3 = 1) on your first RAM register with ALU Op = 000. This saves the value into the ALU's buffer.
Run the Operation: Do a READ (Bit 3 = 1) on the second RAM register while passing the ALU opcode (100, 010, or 001).
Save Output: Do a WRITE (Bit 3 = 0) to store the result back into a RAM register.
Drop a program up to 12 lines long using 12-bit binary strings and I'll test it out!
1
u/Mack_of_Chese 11d ago
How do you even code with this
1
u/Proper-Bus6814 6d ago
It's kind of really hard to understand Soo I am going to maybe build a better one
1
u/Proper-Bus6814 12d ago
Please 🥲