FunCPU - 7 bit homebrew CPU designed to support Functional Programming

FunCPU is a seven bit homebrew processor with unique, unconventional design to natively support functional programming in machine language.
FunCPU employs a tagged architecture, it does not have registers, of which contents are exposed to the programmer. Sure, it has some internal registers, but they are hidden completely and not part of the computational model from the programmer’s perspective. FunCPU neither has program counter in its usual sense, although source, destination and function index registers play somewhat similar role during program execution.
Nor it utilizes flags such as zero, carry, overflow etc., not even in the inside. As the computation model is fully declarative, it does not support conditional or unconditional branching based on these flags in the conventional fashion. Although there is a built-in conditional evaluation with two branches and one condition.
It does not have input output port or devices, other than the control panel (being actually part of the FunCPU computer) , which is utilized to operate the machine and interact with FunCPU. It does not have any interrupt request possibilities either.
It follows that FunCPU does not facilitate writing interactive or process control applications. However, FunCPU can be used to perform arbitrary scientific calculations. Well, sort of, limited by its hardware capabilities, namely memory size and numerical precision.
Despite its simplicity FunCPU can be considered a fully fledged computational device in a sense that it is Turing-complete.

The program to be executed must be previously entered via the control board provided (see how!). The program generally consists of an expression, which value is calculated, or reduced in the course of program execution; and in most of the cases a set of functions. These functions - defined by the user, hence they are referenced hereinafter as user-defined functions – are applied to determine the value of a sub-expression during the program execution.
The expression evaluation also called reduction or program execution may result in any of the following situations. The program may never halt. In this case we say that the expression is not defined. The program execution may stop with an error representing syntactical issue. In this case we say that the expression is not well-formed. The execution may stop due to some internal error. This is an undesired outcome, which denotes some internal hardware malfunction of the CPU, most probably some issue with the micro-sequencer EPROM. Finally, the execution may terminate in a normal state, thus producing a result. In this case the expression is well-formed and defined. The value of the expression is the constant which it has been reduced to. The processor will idle its final state and the result value is observable by looking at the data LEDs.
In case of termination the nature of the termination- , that is, whether it is a normal completion or abort of termination due to some error - is indicated by the status LEDs.

operating frequencyfrom 1.4 to 47000Hz
expression memory256bytes
function memory256bytes
numerical precision7bit
built-in functionsif-then-else, inc, dec
user-defined functions32functions
number of cores1
function arityfrom 1 to 4
number of modules
(clock, ram, alu, register, control board)
length of wires used
cca 200
registers available
for programer
number of chips

30 - CPU only
45 - CPU, control board and RAM together
address bus
7/(*8 internally)
status word/bits

Homebuilt CPUs WebRing

JavaScript by Qirien Dhaela

Join the ring?

To join the Homebuilt CPUs ring, drop Warren a line, mentioning your page's URL. He'll then add it to the list.
Note: The ring is chartered for projects that include a home-built CPU. It can emulate a commercial part, that′s OK. But actually using that commercial CPU doesn′t rate. Likewise, the project must have been at least partially built: pure paper designs don′t rate either. It can be built using any technology you like, from relays to FPGAs.
You will need to copy this code fragment into your page.

No comments:

Post a Comment