Joined: 11 Feb 2016 13:28
Location: United States
I need to see if I can dig up my old code. I actually made logic blocks in C++ using a basic trit (-1,0,1) as the base type. I then created a method of linking blocks together. I eventually made an ripple-carry adder using basic blocks by connecting multiple blocks of different types together. This worked, but was very slow. I am currently re-writing my emulator to do what you're doing by using built-in datatypes to help with speed. I will check my old drives to see if I can find the original, but addition/subtraction wasn't very difficult (although the way I was simulating individual signals was very slow!). By linking inputs to the blocks, and then feeding those outputs to other blocks (or, and, xor, etc) and eventually reading the final outputs I could create circuits that I could test (if said blocks actually existed in real life). I am more interested in working out some of the higher level issues which is why I re-geared to design a more robust emulator. I am still working out all the different encodings, but it currently supports a 27-trit address space as well as a memory management unit for virtual memory mapping (a basic 2 level page map) and some very basic op-codes. I am working out the encodings while working on an assembler which should help with writing and testing applications. I also have a plugin method for pages (i have a page as a base/inhertiable class) where you can insert any page at any location. This allows me to have memory mapped i/o modules (for example, the GPU will be a memory mapped i/o module as well as the keyboard and mouse, etc). Hopefully once I get some basic devices (keyboard, mouse, graphics, hard drive, interrupts, timers) I can start writing a small operating sytem to test out all of the features (including kernel and user space programs running in tandem). I also plan on supporting multi-threading so you will be able to create a number of simulated ternary cores and run them concurrently to help prove parallel programming (I still need to figure out some atomic operations that I want/need).
And of course, if this isn't enough work, my plans for the assembler are to support includes, constants, macro's and structure's. First version will only support compiling a single project to a flat file, but eventually I hope to come up with a nice object file format for linking and for library loading within the emulator. I have everytihng done for the includes, constants, and macro expansion and I'm done with the structure building code, but not the code to actually use the offsets and such properly for determining address locations. It's a work in progress, hopefully I can have it useable in the near future.