Last visit was: Sun May 03, 2026 7:42 pm
It is currently Sun May 03, 2026 7:42 pm



 [ 6 posts ] 
 Design of a simple 32 bit computer 
Author Message

Joined: Mon Oct 07, 2019 2:41 am
Posts: 925
MY hardware for a 9/18/36 bit computer keeps crashing. I need to build whole new system with proper buffering.
Design of a smaller 16/32 bit computer is planned first in emulation then later as hardware.7 registers plus pc,
Code:
8 bit unsigned  characters (load,store only)
16 bit unsigned short ( 16 bit addresses) 1 word
 32 bit signed long, 2 words
float                        3  words
Addressing modes r,(r),(r+),#,(-r),(r+#) for memory ref (char,short,word).
shift r,#
jump to subroutine (r+),#
jump on condition  (r+),#
add effective address
scale by 3 
.
this is 18 instruction types. No irq at the moment.


Thu Apr 23, 2026 6:50 pm

Joined: Sun Oct 14, 2018 5:05 pm
Posts: 66
RISC-V 32E should be "easy". 16 x 32-bit registers. Probably do it in about 38 instructions.

Look at the Univac project... Or write an emulator for your existing N-bit system...

-Gordon


Fri Apr 24, 2026 7:33 pm

Joined: Mon Oct 07, 2019 2:41 am
Posts: 925
I refuse to go with RISC architecture, for hardware.
A micro RISC controller chip,how ever might make a good platform for custom CPU chip design in a
84 pin PLCC package? So would a small FPGA.
For now a simple emulator will suffice, but I have to revise the BIOS I have for the new hardware.
The BBC micro with a ARM CPU is close to what I want, as vintage hardware design,
(can it run in CANADA).
The instruction set, makes for simple code generation from a simple high level language, so this I will not change.
PS: tweeked the instruction set to have a short addressing mode off the frame pointer.


Sat Apr 25, 2026 12:32 am

Joined: Sun Oct 14, 2018 5:05 pm
Posts: 66
oldben wrote:
I refuse to go with RISC architecture, for hardware.


OK.

Quote:
A micro RISC controller chip,how ever might make a good platform for custom CPU chip design in a
84 pin PLCC package? So would a small FPGA.


I'm sure there are several. So you'd write the code to emulate your retro CPU on the microcontroller, or implement it in the FPGA?
I presume you need many pins to give you a "classic" address and data bus...


Quote:
For now a simple emulator will suffice, but I have to revise the BIOS I have for the new hardware.
The BBC micro with a ARM CPU is close to what I want, as vintage hardware design,
(can it run in CANADA).


Maybe you're not familiar with the PiTubeDirect project?

But you know about the BBC Micro - it was intended to be the IO processor for a 2nd CPU connected via the Tube. This is a high speed (for the day; 2Mhz) bus to exchange data to/from the 2nd processor - e.g. a faster 6502, Z80, 80186, INS32016...

PiTubeDirect Takes a Raspberry Pi and interfaces it to the BBC Micros Tube interface then has emulation software for every 2nd processor ever made, and many more. e.g. PDP11. Also, there is a framework that lets you write your own CPU, so you could use this to write your own CPU code (in C or ARM assembler) to test and run your own CPU, using the Beebs base unit to give you a handy keyboard/screen and filing system...

Then you can put your cpu into TTL/FPGA/whatever.

BBC Micros run perfectly well in Canada. Some have PSUs where you can switch the voltage - video output may be trickier. I have several here, but I'm in the UK.

Quote:
The instruction set, makes for simple code generation from a simple high level language, so this I will not change.
PS: tweeked the instruction set to have a short addressing mode off the frame pointer.


But you need then then write that compiler - or work out how to adapt an existing one... The former is where I stalled on my
projects, but the latter was easy.

-Gordon


Sat Apr 25, 2026 3:38 pm

Joined: Mon Oct 07, 2019 2:41 am
Posts: 925
Quote:


But you need then then write that compiler - or work out how to adapt an existing one... The former is where I stalled on my
projects, but the latter was easy.

-Gordon


I am stalled on a self hosting FILE SYSTEM. The old chicken and egg problem.With the emulation I can fake a file system.
until I get one written.

I keep making changes. in the hardware for easy but dumb code generation.
Reverse polish is nice idea, but too complex for me. I have a short form word addressing mode off the stack pointer
that will let me access a local stack frame.

Since I was planning to use 3 words ( 16 bits) for floating I have 32 and 48 parameters,
a bit messy. I revised the micro code to use 8,16,48 bit data. The CPLD's for the design seem to build OK
so I will move onto getting the emulator working. I dropped the frame pointer as It needed negative offsets.


You do not have the required permissions to view the files attached to this post.


Mon Apr 27, 2026 8:38 pm

Joined: Sun Oct 14, 2018 5:05 pm
Posts: 66
oldben wrote:
Quote:


But you need then then write that compiler - or work out how to adapt an existing one... The former is where I stalled on my
projects, but the latter was easy.

-Gordon


I am stalled on a self hosting FILE SYSTEM. The old chicken and egg problem.With the emulation I can fake a file system.
until I get one written.


A retro filing system is not hard - but it depends on the features you want to implement.

Lookup "first fit" (and maybe "best fit") memory allocators and use that on a disk. It's not robust but it's very usable (also relatively fast) as it's just a big linked list of pointers to the next file. You need to guard against writing past the end of a file and you need to pre-create a file with a maximum size. After that, just read and write... You can use the first disk sector as the catalog - filename, offset of start of data and maximum size allowed will keep it simple to strt with and you can write the "compact"/"defrag" command later.

Quote:
I keep making changes. in the hardware for easy but dumb code generation.
Reverse polish is nice idea, but too complex for me. I have a short form word addressing mode off the stack pointer
that will let me access a local stack frame.


Evaluating RPN is easy - it's a stream of tokens, push a number, etc. do an operation. Repeat until out of tokens. lookup the Shunting Yard algorithm for an easy to use method of turning 1+2 into 1 2 + (It's how I do it in my Basic interpreter)

-Gordon


Mon Apr 27, 2026 8:51 pm
 [ 6 posts ] 

Who is online

Users browsing this forum: chrome-135-bot, claudebot, zen-net and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software