Giter VIP home page Giter VIP logo

brainfuck-processor's Introduction

A brainfuck system in Verilog
============================
Jack Carrozzo <[email protected]> 2012-08-22

* Why would you do this? 
	My friend Ken Stein designed a branfuck system
out of 7400 series logic chips, and I was impressed. I
haven't done much in Verilog so this was something to 
play with.

* What does it do?
	In simulation, the system loads an ascii 
brainfuck program from a memory list into SRAM, then
begins execution at cell 0. A perl script is provided
to convert a standard textual brainfuck program into
the memlist format. The program then runs, with input
being set by the registers in the testbench and output
coming out the dataout wire.
	If you were to synthesise and burn the code as
is, the SRAM would be included on the FPGA and could be
preloaded with your code if for some odd reason you 
wanted to do so. 
	I'd like to abstract the odd RAM behavior into
the processor code itself, such that the code could be
burned into hardware and it would interface a real SRAM
chip properly. Doing so however would require more clock
cycles for fetching and setting... not that this is at 
all a performance-driven project ;-)

* How do I run this?
	Just say 'make'. It will build, simulate, then 
open the wave viewer for you.

* TODOs:
	- Write the opcode handlers for [ and ]
	- Move the odd RAM code into the processor so
		we can interface a standard SRAM

* Requirements:
	You need iVerilog (provides both iverilog and 
vvp) and gtkwave. Packages are available for anything
you might want. 

* Why Verilog?
	I started writing this in VHDL but there are 
no working implementations out there other than the 
fat IDEs from Xilinx and Altera. They admittedly work
but I just prefer Vim and Makefiles vs clicking 30
buttons to make anything happen. If you know of a 
VHDL implementation that runs on OSX and nix, do let
me know!

- Debian/Ubuntu, as root:
apt-get install iverilog gtkwave

- OSX:
brew install iverilog
brew install gtkwave

brainfuck-processor's People

Contributors

jackcarrozzo avatar

Watchers

James Cloos avatar pg1770 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.