• Please review our updated Terms and Rules here

Simple FPGA emulation of the "BABY" (Small Scale Experimental Machine) from 1948

g4ugm

Veteran Member
Joined
Feb 22, 2011
Messages
3,044
Location
NorthWest England (East Pondia)
Simple FPGA emulation of the "BABY" (Small Scale Experimental Machine) from 1948

Folks,

In order to help me understand FPGAs and also how the Baby replica at MOSI

http://www.mosi.org.uk/whats-on/meet-baby.aspx

works, I have started to build a VHDL/FPGA implementation of the Baby. Its now reached the stage where it will run one of the standard "demonstration" programs, "BabySlide". This program rotates the last few lines of the Memory which is displayed on a slave monitor. Here is a short video of my FPGA implementation running this program and displaying it on a VGA display.

https://youtu.be/JA3PL3lYSFQ

note the real Baby has 32 words of 32 bits. The extra lines on the screen are for de-bugging. The least significant bit is on the LHS of the screen.

There is still lots of work to do as I only have one pre-loaded program, and only a stop/run switch...
 
What a fun way to learn to use FPGA and VHDL. How long did it take for the coding part? Did you get the rack from something else or did you build it?
-Dave
 
I guess it took about a week to write the VHDL code well perhaps two, (I am retired and sometimes loose count) but I had a diversion as I tried using a fluorescent display. I stopped as it wouldn't let me highlight the action line, i.e. the one being worked on.

There are plenty of VGA examples so that was adapted from elsewhere and as the Spartan 3 has tools to build on-chip dual port RAM that wasn't too hard and it runs entirely separately from the main machine code. The switch interface is adapted from Richard Stofers IBM1130 with an added I/O expander to allow 32 buttons instead of 16 switches. Richard allows free re-use, adaption, and distribution so long as his copyright is retained.

That just left the baby code. The baby only has 6 instructions, one of which is STOP, so its not mega complex. Each instruction takes four "big" clock cycles (beats) each of which has 36 pulses, 32 where data is handled, and 4 "black out" where on the real baby the Williams tube beams fly back. As I wanted to use the same PC loader and to get the , which is mirrors the logic in the baby.

So basically

1. read (and increment) the program counter so we have an instruction address,
2. then read the instruction into the "present instruction" register
3. decode the instruction so we have a function code and a memory address
4. execute the instruction. Mostly this involves reading a memory location and loading it into or adding or subtracting it from either the accumulator or the program counter. The one exception is a store where data goes from the accumulator to memory.

You will note steps 1 and 3 don't involve memory access. During these pulses the real baby refreshes the Williams Tubes. I also uses these beats to store data from the panel switches. Note that the machine "runs" concurrently, the real one has to to keep the store refreshed, it just doesn't actually fetch or execute any instructions. Mine does the same.

I had the programmers guide and the logic diagrams of the replica to look at, so it didn't take too long to write, and much to my surprise the thing ran programs the first time I tried.

Oh and the "rack" is built from bits of aluminium bought from the local DIY. I used my 3D printer to drill the holes in the panels for the switches which was also great fun and a diversion into CNC milling, GCODE and a little bit of Gerber. I used BamCam beta (its free) to generate the drill maps, but the 3-D printer doesn't understand the GCODE "drill hole" instructions so I wrote a VB program to convert "drill hole" into specific "moves" so more fun.

There were some dead ends such as trying to mill the triangular end plates from a sheet of aluminium, but the 3-D printer table just isn't rigid enough so I used a normal Jig saw for that, and the fluorescent display I mentioned above.


All in all the best fun I have had in ages.
 
Back
Top