Decitak Project - Build a DEK Simulation. This is a team project. I want 2-4 people per team.

Teams (Can you think of any others?):

Sign up only once! Email me if you want your name removed from a team to put it in another team. Try to balance out the teams.

Pick team: Your name:

DRAFT SPECS!!!!!

Decitak

The Decitak is a decimal based microprocessor. The primary data unit is a trit, which is composed of three dits. Dit is short for decimal digit (0-9). The Decitak processor includes a primary memory of 1000 trits. Memory is interfaced with a 3-dit wide bus and three control signals. The bus carries either an address or data. The address lock control signal indicates that the bus holds an address value. The memory unit remembers this value. Then a read or write signal will then cause data to be transferred from or two memory. The memory bus interfaces to the processor through the MDR.

The Decitak processor has a single accumulator, 3 dits wide. Integer data is stored in 3 dit tens complement notation. Range is therefore -500 through 499

In addition, there is program counter (3 dits), a memory address register (3 dits), and a memory data register (3 dits).

The ALU can process add or subtract two trits. One of the inputs is the accumulator (AC), the other is the memory data register (MDR). The result is always stored into the accumulator. There are only two operations:
add AC = AC + MDR
sub AC = AC - MDR

The instruction format is straightforward. Instructions are all 3 dits in length. The first dit is the opcode.

0 = HALT
1 = ADD immediate/mem/(mem) AC = AC + MDR
2 = SUB immediate/mem/(mem) AC = AC - MDR
3 = BR disp/mem/(mem) PC = PC + MDR
4 = BRMI disp/mem/(mem) PC = MDR if AC < 0
5 = BRZR disp/mem/(mem) PC = MDR if AC = 0
6 = LDA immediate/mem/(mem) AC = MDR
7 = STA mem/(mem) MDR = AC, store
8 = IN AC/mem/(mem) MDR = input
9 = OUT AC/mem/(mem) output MDR

Note that the operations above indicate the basic action and are stated in terms of the AC and MDR registers. The MDR value, however, is determined differently depending on the details of the instruction.

The Decitak Evaluation Kit (DEK) comes with a Decitak processor, a numeric keypad (0-9, minus, and enter), an output panel (4 characters wide), and a batch memory tool for viewing and programming memory contents.

Operational notes:
The IN instruction accepts a trit from the keypad into the MDR. Once the trit reaches the MDR, it is transferred to the accumulator or memory.

The keypad has a three trit buffer. The interface to the processor is by a 3-dit plus 2 wire bus. The extra lines are control signals. One is asserted by the keypad to indicate that a trit is available in the keypad buffer. The IN instruction blocks until the data is available. The other line is a signal back to the keypad, indicating the data has been read. The keypad then removes the trit from the buffer and updates its data available signal appropriately. Trits are added to the buffer by pressing minus if desired, followed by up to three digit keys followed by enter. Illegal keypresses are ignored. The keypad also ignores keypresses while the buffer is full. The keypad translates keypresses to tens complement trit data before storing it in the buffer.

OUT displays either the signed interpretation of the trit in the MDR. The MDR obtains its value from either the accumulator or memory.

There are several addressing modes. Address information is always found in the second two dits of an instruction trit. These are called the adits (address dits). Adits are interpreted as follows:

immediate: Any adit from 90-99 is considered to represent immediate data, a signed dit. Ignore the first dit. 0-4 represent trits 000-004. 5-9 are sign extended to 995-999 (representing -5 through -1). Immediate mode only applies to ADD, SUB, and LDA

memory direct: Adits from 00-79 represent actual memory addresses. Only addresses 000-079 are accessible in this way.

memory indirect: Trits 80-89 name the address of a pointer located in the first 10 trits of memory. This addressing scheme allows any memory location to be accessed via indirect addressing. Drop the leading 8 to get the pointer address. The first 2 of these pointer locations (0-1) are auto-increment. The next 2 (2-3) are auto-decrement locations. The auto inc/dec locations change each time the location is read (after the read occurs). The rest of the pointer addresses (4-9) are simple pointers.

program relative: The branch instructions interpret an immediate mode adit as PC-relative. This is only useful for small branches, as the displacement is limited to -5 through 4. Direct addressing allows branches only among addresses 100-179 (100 is always added to the actual address since instructions are not generally located in the first 100 memory locations). Indirect addressing uses one of the pointers to get the destination of the branch.

The IO instructions interpret the immediate mode adit as implying the accumulator is the source or destination of the IO. There is no difference between adit values 90-99. Other adit values are used to access memory as described above.

The conditional branch instructions only branch if the condition is true.
BRMI = Branch if AC < 0
BRZR = Branch if AC = 0

The processor has a reset button that loads the address 100 into the PC. There is a RUN indicator lamp that turns on when the reset button is pressed, and turns off when a HALT instruction is processed (the processor also halts at this time).

Other console information includes a display of the PC, AC, MAR, and MDR. There is a PANIC button that causes the machine to enter the halt state regardless of what it is doing.

The DEK memory tool allows memory contents to be viewed or stored. Displaying memory does not affect the auto inc/dec locations. Memory is displayed in decdits (a decdit is 10 trits). Each decdit is displayed in a row, prefaced by the decdit number:
00: 024 987 334 981 999 443 445 213 987 123
01: ...
...
99: ...

You can paste a memory dump into the tool and store it into the Decitak memory. This allows programs to be conveniently loaded into memory to be tested. The memory tool also allows any memory location to be viewed or altered via a friendly user interface.