DTA Emulator
I’m making an emulator for a processor! 
It’s supposed to be a very simple minimal instruction set computer, with only 3 instructions.
I mostly worked on the ISA in these hours and also did a bit of backend work for the emulator.
The instruction set for the processor has only 3 instructions:
- Copy
- Set
- Pulse
The entire processor can be controlled just by changing the values in registers and pulsing stuff.
Copy copies the value of one register to another 
Set directly sets the value of a register to something 
Pulse pulses a pin 
(This is also why it’s called DTA - Data Transfer Architecture)
With these simple instructions, you can manipulate registers and therefore control various parts of the processor! 
Designing the processor ISA was very hard because there are a bunch of problems that arise from having only three instructions.
For example, this is how you would write a program to add two numbers from the memory and save it back to the memory.:
SET READADDR 1
COPY READOUT, ALU_A
SET READADDR 2
COPY READOUT, ALU_B
SET ALU_OP, ADD
SET WRITEADDR 3
COPY ALU_OUT, WRITEVAL
PULSE WRITE
This code first sets the read address to 1, causing the register bank’s read output to provide the value stored at address 1.
That value is then copied into ALU_A.
The read address is then set to 2, and the value at that address is copied into ALU_B.
ALU_OP is set to ADD.
Finally, the write address is set to 3. The ALU output is copied into WRITEVAL, and the write operation is pulsed, storing the result at address 3 in the register bank.
So basically, at a high level, it reads 2 values from the memory, copies them to the ALU input values, sets the ALU operation to addition, then saves the output back into the memory.
The memory reading and ALU output is combinational, ie it works continuously, and does not need a pulse for it to work. Meanwhile writing stuff to the memory can’t just be on forever, that would create problems. So we need to pulse it when it’s ready to write. You can think of pulses like triggering something
Hopefully you’re understanding 
The parts of the CPU are:
- Working memory
- ALU (Arithmetic and Logic Unit)
- RAM interface
- Program Counter
- Device Controller
- Control Unit
(this took way too long 🤦 )
That’s about it for the ISA. I also started working on the backend of the actual emulator by implementing all of these components individually in Java
(java peak
)
A picture of all the registers and pins:
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.