Running C at full speed ​

A project log for Kobold K2 - RISC TTL Computer

A 16 bit RISC computer with video display, from just a few TTL and memory chips. Online C compiler and simulator available.

roelhroelh 06/02/2020 at 13:262 Comments

It's been a while since the last log. I could not spend much time on the project lately.

Progress was made on the C compiler. It now handles initializers, strings and chars, all needed for the "Hello World" program. On the hardware side, U41 was placed, that is needed for reading chars from the upper half of a word.

Finally I was now able to get a real C program running on the hardware ! 

On the hardware I mounted the 25 MHz oscillator, and selected it by mounting R2 and removing R5 (that connected to the 460 kHz RC oscillator). The timing loops for the synchronous character transfers were now 750 instead of 15, to account for the 50 times higher clock frequency.

The combined Hello-World and prime number program were also running at the intended speed, 25/4 = 6.25 MHz cpu clock, that is 3.125 million instructions per second (one instruction is a fetch cycle and an execute cycle).

The simulator runs quite slow, and would be practically useless with two 750 cycle loops after writing a character. The simulator already checks for a write to 0xF000. After writing a character, the simulator has extra code that will directly return from the putchar function, bypassing the loops. Now a single program will run on the simulator as well as on the real hardware.

So what is next ?

- start designing the video display unit

- arrange a keyboard for the Kobold

- have a small operating system, that itself is programmed in C (suggestion anyone ?)


threeme3 wrote 06/09/2020 at 12:49 point

Hi roel, great to see the update and the next plans. Guido

  Are you sure? yes | no

roelh wrote 06/09/2020 at 12:54 point

Thanks Guido. Next plan is the video display card, see my new project

  Are you sure? yes | no