Community of electronics hobbyists established in 2002

Atom Feed | View unanswered posts | View active topics It is currently 17 Aug 2017 17:18

Reply to topic  [ 3 posts ] 
[Ternary] New ternary emulator in C++ 
Author Message

Joined: 11 Feb 2016 13:28
Posts: 2
Location: United States
Reply with quote
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.

12 Feb 2016 12:50
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15434
Location: New York
Reply with quote
Great! Thanks for sharing this info with us!
May I move it to separate topic? For example "ternary emulator in C++"?


12 Feb 2016 16:59
Profile WWW

Joined: 11 Feb 2016 13:28
Posts: 2
Location: United States
Reply with quote
No I don't mind at all if you think it warrants its own topic. I hope to finalize most of the op-code encoding this coming week and get the emulator supporting more op-codes.

14 Feb 2016 20:16
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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

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