Close
0%
0%

BrainfuckPC Relay Computer

Von-Neumann 16-bit relay computer with Brainfuck++ instruction set

Similar projects worth following
I'm assembling relay computer on soviet reed relays - I need about 800 of them.
All compute logic mounted on 192 modules (60x44mm, with 4 relays on each) placed on 6 base places (150x200mm), 32 modules on each.

rev.1 would be with RAM on IC, 64KWords x 16bits.
16 commands, 8-bit default mode, 16-bit extended mode.

8 basic Brainfuck commands plus some extended what I can implement on current main blocks.

Soviet relays - RES64 - 1A, RES55 - 1C and RES-43 - 2A

Outline

Tens of thousands of people creates they own programs on brainfuck programming language. 

Thousands - creates they own brainfuck compilers or emulators to run their creation.

But the only one man tries to create Brainfuck Relay Computer.

BrainfuckPC (BFPC) - is a computer on reed relays, which can execute brainfuck commands natively, without any compilation into other assembly. All main instructions are corresponds to eight bf commands.

BrainfuckPC 3D model in Fusion 360(Clickable). Dimensions 1000x650mm

Central computer  element a 16-bit full adder. Four registers for storing temp values and context values. Static RAM 128Kbytes(64K words). And some latches and controlling logic to support. 

Roadmap

[DRAFT] Assembler instruction set

All instructions are 16-bit wide.

  • Bits 15, 14, 13, 12 - define instruction class
  • Bit 12 - Signed bit for Adder commands. Value of this bit extended to 13-15 bits when sending to adder input B;
  • Bits 11-0 - contain least 12-bit of signed integer. Master 4 bits generates automatically: 0 for positive and 1 for negative values.

InstructionOpcodeOperationBrainfuck EquivalentDescription
add m120X XX*AP ← *AP + m12'+' (Repeat m12 times)Add base to current data value
sub m121X XX*AP ← *AP - m12'-' (Repeat m12 times)Substract base from current data value
ada m122X XXAP ← AP + m12'>' (Repeat m12 times)Increase memory address
ads m123X XXAP ← AP - m12'<' (Repeat m12 times)Decrease memory address
jz m124X XX(*AP == 0)? IP ← IP + m12 : IP ← IP'['Jump to IP + m12 if current data value is zero
jz m125X XX(*AP == 0)? IP ← IP - m12 : IP ← IPNoneJump to IP - m12 if current data value is zero
jnz m126X XX(*AP != 0)? IP ← IP + m12 : IP ← IPNoneJump to IP + m12 if current data value is not zero
jnz m127X XX(*AP != 0)? IP ← IP - m12 : IP ← IP']'Jump to IP - m12 if current data value is not zero
xor m12
aX
XX
*AP←*AP XOR m12 NoneLogical XOR of current data value with positive constant
xor m12bX XX*AP ← *AP XOR m12NoneLogical XOR of current data value with negative constant
inc0 00*AP ← CIN','Read one m8 symbol from console. If Cin buffer is empty, wait it
outc0 01COUT ← *AP'.'Write m8 symbol to console
clr.apd0 01AP ← 0NoneClear AP register. Can be combined with other clr commands
clr.ipd0 02IP ← 0NoneClear IP register. Can be combined with other clr commands
clr.dpd0 04*AP ← 0'[+]' or '[-]'Clear current data cell. Can be combined with other clr commands
set.apd0 10AP ← *APNoneWrite current data value to AP register
set.ipd0 20IP ← *APNoneWrite current data value to IP register
get.apd1 00*AP ← APNoneRead current data value from AP register
get.ipd2 00*AP ← IPNoneRead current data value from IP register
mode.b8e1 00None8-bit mode activated(1) - default state
mode.b16e2 00None16-bit mode activated
haltf0 00Nonehalt machine
  • AP - Address pointer Register
  • IP - Instruction pointer register
  • *AP - Current Data cell
  • CIN - Console input
  • COUT - console output
  1. When 8-bit mode activated all arithmetic operations continue to perform in 16-bit mode. But JZ and JNZ branches start depends on only least data byte - (DP & 0x00FF == 0)? and (DP & 0x00FF != 0)? Console Input and Output are always read and write only least byte of 16-bit Word.

  • 768 × LED RED 5mm LED
  • 640 × RES55 USSR Reed relay with 1C contact group
  • 128 × RES64 USSR reed relay with 1A contact group
  • 192 × PCB module 60x44mm different PCB modules
  • 6 × Base PCB plate 200x150mm PCB each for 32 modules

View all 7 components

View all 38 project logs

Enjoy this project?

Share

Discussions

Dr. Cockroach wrote 04/16/2018 at 21:46 point

Yes, yours will be the first relay BF computer and I hope to have perhaps the first DTL BF computer :-)  has a nice sound to it :-) Your build is looking fantastic Artem :-)

  Are you sure? yes | no

Dr. Cockroach wrote 04/06/2018 at 22:11 point

I agree, well done :-)

  Are you sure? yes | no

Artem Kashkanov wrote 04/07/2018 at 18:44 point

Thanks!  One more stimulus to complete this project

  Are you sure? yes | no

Artem Kashkanov wrote 04/07/2018 at 18:42 point

I miss this :) Thanks for the link)

Very interesting ethics discussion, but I do not rename this project :) 

Perhaps I should not tell them that the DekatronPC would have BF instruction set too :)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/15/2018 at 22:56 point

You have progressed well ! It's cool to see :-)

  Are you sure? yes | no

Artem Kashkanov wrote 01/16/2018 at 08:41 point

Yep! After I got pcb's I began to work actively on the project. I had to order them before instead of making them manually, but... :)

I want to have minimum working set (Adder+Latches+Registers+Memory) with MCU controlling for generating sequences for nearest April's fools day - there should be really cool article to reddit and geektimes resources.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/16/2018 at 08:43 point

YAY !

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/06/2017 at 00:24 point

Hello :-)

Are there any updates lately ?

  Are you sure? yes | no

Artem Kashkanov wrote 11/12/2017 at 14:57 point

Yes) Today

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/12/2017 at 15:26 point

Awesome !

  Are you sure? yes | no

Yann Guidon / YGDES wrote 03/31/2017 at 18:47 point

Do you have estimates of the power supply requirements ?

  Are you sure? yes | no

Artem Kashkanov wrote 03/31/2017 at 19:52 point

Each base block would consume up to 5Volt and 2Amps. And Up to 2 Amp for memory board and vacuum indicator panel (approx 30pcs of soviet IV-6 tubes, which schematic is still in draft).

So 14Amps is not so much for this. Thanks to reed relays :-) I will use 25Amp 5Volt power supply.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 03/31/2017 at 20:54 point

so it's in the range of 120W...

  Are you sure? yes | no

Dr. Cockroach wrote 03/31/2017 at 00:05 point

That is really awesome, I will be watching this :-)

  Are you sure? yes | no

Adam Vadala-Roth wrote 03/27/2017 at 14:23 point

this is so hardcore, much respect!!!

  Are you sure? yes | no

Yann Guidon / YGDES wrote 03/27/2017 at 10:17 point

A nice addition to #Relay-based projects :-)

  Are you sure? yes | no

Artem Kashkanov wrote 03/27/2017 at 11:50 point

Yes, very good idea.  :-)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

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