How To Programming in Houdini

2 min read Original article ↗

Testing the limits of bullet engine I thought of creating a very complex mechanism, so the design of a mechanical CPU was born.

First designs incorporated 8-bit memory width, 4 register, general purpose external BUS and even a mechanical display... But very soon i realized that would require enormous ammount of simulated objects, so design was cut... and cut again... and cut again, till i was left with what you saw in the video.

The biggest design to fit into my laptop's ram and simulate in ammount of time i'm willing to wait for it. so yeah....

It was hard to make the video representative for general public, hope it turned out at least entertaining and gave you at least general concept of how it works...

So what do we have in the end:

A simple 4-bit mechanical CPU with 2-phased clock, simulated purely with Bullet Physics Engine in Houdini

- dedicated 10-bit wide constant instruction memory

- 1 ACC register ALU with adder

- 4-bit RAM (16 memory lines in total)

- trivial (almost) control block

1 clock fixed length instruction set allows:

- memory-to-register and register-to-memory copy

- mem to reg addition

- arbitrary memory addressing

- next command argument substitution op (allows addressing memory from ACC for writing) (not used in video, but nessesery for Turing Completeness)

- JMP (goto)

- JNE (goto if last operation result is not zero) (allows loops)

Turing Complete, not counting memory limitation

ASM compiler is done with a simple python regex script, but you can write binary code directly as well)

project final hips as well as gear logic framework hdas are available here: https://github.com/pedohorse/gearlogic

you can also support me personally here:

https://www.patreon.com/xapkohheh

https://ko-fi.com/xapkohheh

though i absolutely do not rely on it and cannot promise to produce content regulary

attributions:

Music:

"Getting it Done" Kevin MacLeod (incompetech.com)

Licensed under Creative Commons: By Attribution 3.0 License

http://creativecommons.org/licenses/by/3.0/

Additional sounds:

computer-noise_dell_d505_oldhdd_2004.wav by matucha

https://freesound.org/people/matucha/sounds/160591/

Mechanical-Keyboard: Typing by M4taiori

https://freesound.org/people/M4taiori/sounds/331428/