Designing A CPU For Native BASIC

Editorial Team
3 Min Read


Through the years there have been a couple of CPUs designed to immediately run a high-level programming language, the commonest strategy being to construct a bodily manifestation of a transportable code digital machine. An instance is likely to be the experimental Java processors which carried out the JVM. Equally, in 1976 Itty Bitty Computer systems launched an implementation of Tiny BASIC which used a easy digital machine, and to have fun 50 years of Tiny BASIC, [Zoltan Pekic] designed a CPU that mirrors that VM.

The CPU was created inside a Digilent Anvyl board, and the VHDL file is freely accessible. The microcode mapping ROM was generated by a microcode compiler, additionally written by [Zoltan]. The unique design may execute all the 40 directions included within the reference implementation of Tiny BASIC; later iterations prolonged it a bit extra. To benchmark its efficiency, [Zoltan] set the clock fee on the event board equal to these of varied different retrocomputers, then in contrast the instances every took to calculate the prime numbers below 1000 utilizing the identical Tiny BASIC program. The BASIC CPU outperformed all of them apart from Digital Microsystems’ HEX29.

The following step was so as to add a variety of efficiency optimizations, together with a GOTO cache and higher use of parallel operations. [Zoltan] then wrote a “Hiya World” demo, which may be seen beneath, and prolonged the dialect of Tiny BASIC with FOR loops, INPUT statements, a number of LET statements, the modulo operator, and extra. Lastly, he additionally prolonged the CPU from 16-bit to 32-bit to have the ability to run an extra benchmark, on which it as soon as once more outperformed retrocomputers with comparable clock speeds.

We’ve beforehand seen [Zoltan]’s work with FPGAs, whether or not it’s giving one a cassette interface or utilizing one to immediately entry a CPU’s reminiscence bus. BASIC has at all times been a cross-platform pioneer, as soon as even to the extent of making a free nationwide customary.

Share This Article