Brainfuck 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

[DRAFT] Assembler instruction set

All instructions are 16-bit wide.

  • Bits 15, 14, 13 - define instruction class
  • Bit 12 - Signed bit
  • Bits 11-0 - contain least 12bit 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
and m128X XX*AP ← *AP AND m12NoneLogical AND of current data value with positive constant
and m129X XX*AP ← *AP AND m12NoneLogical AND of current data value with negative constant
or m12aX XX*AP ← *AP OR m12NoneLogical OR of current data value with positive constant
or m12bX XX*AP ← *AP OR m12NoneLogical OR 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)
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

  • WW47.1 Update: Reed Relay Speed Test 1700Hz!

    Artem Kashkanov3 days ago 0 comments

    Did speed testing for relays.   Results:

    RES55 - 1700Hz on 50% duty cycle - 300us/600us ON/OFF delay

    RES64 - 1600Hz on 50% duty cycle - 200us/400us ON/OFF delay - Why this is slower? ;-)

    On 1200Hz both types of relay works very stable with clean charts, on max speed contact bounce become visible. Signal decreases to zero so slowly because of Open circuit.

    Schema is very simple:

    Set square signal to transistor, and get signal from one relay output:

  • WW46 Update

    Artem Kashkanov11/16/2017 at 08:19 1 comment

    How about using this for input/output operations with my computer?

    It's a electronic daisy-wheel typewriter Robotron S6130 with Terminal support - it can be connected via RS-232 to computer and print received data. It have Russian daisy-wheel and keyboard layout, but wheel can be changed to another one.

    Unfortunately it doesn't work, but I have schematic and want to repair it - internals looks not bad.

    Here is my review, But sorry, Currently Russian language only and no subs.

  • WW45 Update

    Artem Kashkanov11/12/2017 at 14:49 0 comments

    • Ordered pcbs from easyeda and got it.
    • Soldered all 2AND/2XOR modules for carry-chain adder. Start soldering base plate for it.
    • Done with modules tester - didn't check any relay but will check all modules.

  • WW23 Update

    Artem Kashkanov06/05/2017 at 06:53 0 comments

    Oh man.. Third attempt was successful and I painted six boards with solder mask. Currently I need to repeat this procedure for other 24 boards. But I already can start drill and mill boards and start assembling.

    Current pallet I use for painting is not very good and I need another one to get more smooth surface.

  • WW16 Update

    Artem Kashkanov04/25/2017 at 07:43 0 comments

    Developed 2AND/2XOR module for carry-chain version of Adder. Just need to etch pcb's for it.

    Failed first attempt of protection solder mask applying. I expected this.

    I did this procedure long time ago last time.

    Unfortunately my oven handles temperature with very big difference between the top and the bottom of oven. As a result - when two thirds of plate were successfully opened from mask top one third wasn't. Need to add little metal fan into oven for active convection.

    Move out mask from all plates which I tried to do.

    If second attempt would be failed too I will just milled boards and solder them without the mask.

  • WW14 Update

    Artem Kashkanov04/05/2017 at 18:26 5 comments

    Received memory board.. Oh man.. It look so cool. Need to start parts soldering. There are 16x16 led panels for this board. dimensions 300x200 mm.

    Published an article about this board on Russian geek site on the first of April. That was very good idea - My article was very popular this day.

    And as a result - someone in comments gave me advice how to optimize adder schematic and reduce relays for it from 256 to just 112! It's the whole block! Carry chain - is very good idea for this project.

    Here is schematic:

    There is an error near K4 - contacts are reversely connected. So instead of 32 modules with 3 different types (ADD+C, 2AND/2OR, 5AND) I just need 32 modules with one type! 2AND/2XOR

    Will create schematic and routing for this module in nearest future.

  • WW12 Update

    Artem Kashkanov03/23/2017 at 20:38 0 comments

    Done with etching 30 pcb plates! 8 different types. Now working on photomask.

    I'm done with Memory Board and send it to manufacture. It comes back to me at the beginning of April and I will start assemble it

    Here is 3D view with all parts (yes, it's 16x16 led panels on the top):

  • WW09 Update

    Artem Kashkanov03/05/2017 at 21:07 0 comments

    • Put image to another 6 plates - 3pcs of 5AND, 1pcs of 2AND/2OR, and 2pcs of D-trigger. Need to etch them but first want to image other boards for batch eching :)
    • Finished with Memory Board routing. 3D Looks very good. Yeas, Most IC's are in DIP - this is because I have a Lot of Soviet IC and use them. Need to check all connections and will send routing to pcb maker - I can't do so big pcbs (300x200 mm ) at home.
    • Routed 2ANDx4 pcb - I got single-side pcb again. Will use this type of module as a key module (four modules per bus) and in sequenser module where after 10-stage sequenser and diode matrix I will need to send signals to blocks. 3D looks good. Will do this modules at home.
    • Prepare plywood table for photomask - it's ready for use and I want to start when finished with all known boards.

  • WW08 Update

    Artem Kashkanov02/26/2017 at 19:44 0 comments

    I routed almost all modules:

    ADD+Carry module, D-trigger module, 5AND, 2AND/2OR module, base board and working on memory module

    Currently I'm working on making pcb's - I'm doing all pcb by myself using photoresist technology.

    I already etched 17 of 26 panels 20x15 cm - each panel contain 9 modules and 4 relays on each module. When I finished etching I will start with solder mask.

    6 pcb's - D-trigger,

    2 pcb's - ADD+C

    3 pcb's 2AND/2OR

    5 pcb's - base panel each for 32 modules. I need one more of this type

    1 pcb's 5AND - I need 4 of them for paralle carry.

    I created roadmap webpage in github repository where I update all steps

View all 9 project logs

Enjoy this project?



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