Last visit was: Thu Jun 18, 2026 1:48 am
It is currently Thu Jun 18, 2026 1:48 am



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

Joined: Mon Oct 07, 2019 2:41 am
Posts: 932
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: 932
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: 932
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

Joined: Mon Oct 07, 2019 2:41 am
Posts: 932
Expression parsing is left to right, with parenthesis changing priority. No boolean logic in expressions yet If added logic is -1 or 0.
No floating point. No unary minus.
Signed byte constants, but bytes are unsigned. Int data types 16 bit signed. Word data types (long) are 32 bits signed, Floating point 3 words. 31 bit mantissa, 15 bit exponent.
Clock timing needs to be changed from divide by 8 to divide by 10 for a needed internal wait state.
First trial timing is 2.5 uS for a memory cycle. Reserved a order code for a Excess 3 Addition.
Both the NOVA and the PDP 11 came out late 1969,So Thought I could use chips from that Era how ever I need to use 74163s
but I can only find them in a 1971 TI data book thus this is the release date of the CPU.
Ballpark timing looks ok, but no margin with the register file data path.
With PROM's coming out about 1975, timing for that version is planned to be 1.8 uS memory cycle.


Fri May 08, 2026 4:58 pm

Joined: Mon Oct 07, 2019 2:41 am
Posts: 932
The basic design idea, was with fast 16x4 ram and a ALU with lookahead one could run 1 16 bit ALU twice for 32 bit math in one slow (core) memory cycle. This is harder than expected with slow TTL logic in 1969. Random logic has 1250 nS alu cycle and
~1973 a 900 nS memory cycle ( some SSI 74SXX parts ) for BALL park timing with PROMS.
Now using 0200 (half word) page size for short form addressing ( page zero or local page ).Page zero is 0x200.(half words).
Code starts a 0x200.


Thu May 14, 2026 2:32 am

Joined: Mon Oct 07, 2019 2:41 am
Posts: 932
Still too complex for register operations as I need a input multiplexer on both input registers.
Now I write the data to the io bus, and read it in.
Lea is now just loading a 17 bit address constant. Char constants unsigned.


Thu May 14, 2026 7:54 pm

Joined: Mon Oct 07, 2019 2:41 am
Posts: 932
Removed LEA. Now the instruction set is more TTL and Random logic friendly.It
requires MSI chips like the 74181 and 7489 and the 74161/74163, that did not come out until mid 1970's.
Microcode 5 256x4 Proms. 1 32x8 Prom 74181 decode.
Speed 1970 1.8 uS memory cycle (random logic 74/74H) 1973 (micro code 74/74S) 1.6 uS memory cycle 1976. (LS,2901) 1.25 uS memory cycle.
Now full 18 bit addressing, ~ 128K 32 bit words. ~85K 48 bit floats. ~512K bytes. Still no MMU.
Prototype version 1.8 uS.


Sun May 24, 2026 7:14 pm

Joined: Sun Mar 27, 2022 12:11 am
Posts: 64
oldben wrote:
The basic design idea, was with fast 16x4 ram and a ALU with lookahead one could run 1 16 bit ALU twice for 32 bit math in one slow (core) memory cycle. This is harder than expected with slow TTL logic in 1969. Random logic has 1250 nS alu cycle and
~1973 a 900 nS memory cycle ( some SSI 74SXX parts ) for BALL park timing with PROMS.
Now using 0200 (half word) page size for short form addressing ( page zero or local page ).Page zero is 0x200.(half words).
Code starts a 0x200.

The Interdata 7/32 from 1973 was a 32-bit computer that used a 16-bit ALU and datapath. If I recall correctly it had a 4-bit extension to speed up address calculation.


Thu May 28, 2026 1:11 am

Joined: Mon Oct 07, 2019 2:41 am
Posts: 932
The Interdata 7/32, is new computer for me. It looks to have the same market and features as the IBM 370 mainframe.
A bigger IBM 1130 is the model here for my computer, with some of the PDP 11 addressing modes.In no way will it ever be C compatible as it addresses 16 bit words , and byte data is limited to Read/write a packed byte. Core style memory is standard
with setting the MAR on cycle 0 and a possible read or write on cycle 1. 18 bit addressing. Easy high level language code generation as only has 3 int data types: 8 bit byte array, 16 bit signed word , 32 bit word, and one 48 bit float data type.


Thu May 28, 2026 5:57 am

Joined: Sun Mar 27, 2022 12:11 am
Posts: 64
The 7/32 is a mini. It's similar in complexity to the PDP-11, but it's a few years younger so it could afford to use an IBM 360 style register set and faster memory(750ns or 1000ns). It does have a bigger brother 8/32 which has a 32-bit datapath.

Under the hood it's a microcoded accumulator machine with a single port register file. I'm not sure if there was a separate FPU or if it was handled with the integer ALU, but there is a floating point microcde listing in the manual that might point to the latter.

oldben wrote:
A bigger IBM 1130 is the model here for my computer, with some of the PDP 11 addressing modes.In no way will it ever be C compatible as it addresses 16 bit words , and byte data is limited to Read/write a packed byte. Core style memory is standard
with setting the MAR on cycle 0 and a possible read or write on cycle 1. 18 bit addressing. Easy high level language code generation as only has 3 int data types: 8 bit byte array, 16 bit signed word , 32 bit word, and one 48 bit float data type.

How are you dealing with packed chars? I

As a side note, I wonder if the idea for extended registers like the z80 and 6809 used were inspired by the IBM 1130.


Sat May 30, 2026 1:41 am

Joined: Mon Oct 07, 2019 2:41 am
Posts: 932
DockLazy wrote:
The 7/32 is a mini. It's similar in complexity to the PDP-11, but it's a few years younger so it could afford to use an IBM 360 style register set and faster memory(750ns or 1000ns). It does have a bigger brother 8/32 which has a 32-bit datapath.

Under the hood it's a microcoded accumulator machine with a single port register file. I'm not sure if there was a separate FPU or if it was handled with the integer ALU, but there is a floating point microcde listing in the manual that might point to the latter.

oldben wrote:
A bigger IBM 1130 is the model here for my computer, with some of the PDP 11 addressing modes.In no way will it ever be C compatible as it addresses 16 bit words , and byte data is limited to Read/write a packed byte. Core style memory is standard
with setting the MAR on cycle 0 and a possible read or write on cycle 1. 18 bit addressing. Easy high level language code generation as only has 3 int data types: 8 bit byte array, 16 bit signed word , 32 bit word, and one 48 bit float data type.
How are you dealing with packed chars? I.


I give them a suitcase, and tell them to get packing. I have odd and even memory cards so unsigned bytes are easy to do.
The carry flag selects the odd or even byte. Little-endian format.
By not having a byte variable,I can have 18 bit addressing, two upper bits in the opcode, and a 16 offset in the next word.
Quote:
As a side note, I wonder if the idea for extended registers like the z80 and 6809 used were inspired by the IBM 1130.

I want to try a *old school* design here, but have stack and Immediate data.The 10 nS CPLD's I am using give me a good design model for the early IC's . (the
14 pin critters from 1969). but still have simple rom state decoding, Clock speed is 8,10,11,12 and perhaps 15 Mhz.
10 states per cycle. I think the PDP 11 had a big impact on the 6800.


Sat May 30, 2026 8:03 am

Joined: Mon Oct 07, 2019 2:41 am
Posts: 932
Too complex for easy software emulation, and character logic.
Revised the instruction decoding, and normal character addressing. For a SMALL computer
256Kb is ample. Added two helper instructions for a stack machine.
1) 'push' a prefix op for load a,xxx
2) mov A to D, and pop A


Sun Jun 14, 2026 5:50 am
 [ 15 posts ] 

Who is online

Users browsing this forum: Amazonbot, Baidu [Spider], chrome-133-bots, claudebot 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