M-3, DJS-1, DJS-3
NOTE: This is not guaranteed to be 100% accurate. Documentations are extremely hard to come by with the situation where I'm in currently.
General description
- Electronic vacuum tube computer (said to have 774 tubes)
- Word size: 31 bits.
- Magnetic drum memory, 1024/2048/4096 words of 31 bits.
- 30 operations per second.
- DJS-1 is very probably a M-3 built in China for learning. I don't know the reason why it didn't retain the original name (as did the one in Hungary), albeit one could imagine it was probably because one of those things. Later the magnetic drum was replaced with magnetic core, and the input/output devices are replaced as well; this became the DJS-3, which runs at ~1500 operations per second.
- Consists of:
- Arithmetic unit
- The arithmetic unit has an accumulator (31 bits; notated as R below) into which the result of the last operation performed is entered. The contents of this accumulator can be used in the next operation.
- Address register (12 bits)
- Instruction counter (12 bits)
- Code control (6 bits + logical circuits)
- Other stuff
- Arithmetic unit
- Two kinds of fixed point numbers are used.
- None of both uses two's complement.
- Binary: bit 0 as the sign bit, the remaining 30 bits contains the absolute value of the number. People used to simply use it as the fraction part, i.e. the integer part is always 0.
- Decimal: this is basically BCD code. Same as binary numbers bit 0 is the sign bit, bit 1~28 are divided into 7 4-bit segments (BCD). Bit 29~30 are not used.
- Positive is probably represented with bit 0 = 0.
- NOTE: currently I had absolutely no idea how these two systems are used in M-3. My guess is that decimal is output-only and really isn't used by the machine itself but by the programs that manipulate BCD code.
Input/Output devices
Input
A 5-hole (with a formation of 2-3 to prevent people to use it the wrong way around) punch tape reader.
NOTE: This is taken from a description of M-2, which is a different machine with a different instruction set (and built before M-3 of course). If M-3 needed a punched tape input, I don't think there was enough reason for them not to reuse this part; but then again they totally could've designed a whole new scheme for M-3, so this is purely speculation.
I | II | π | III | IV | V | Corresponding value |
---|---|---|---|---|---|---|
β | β | π | β | β | β | 0xf (hexadecimal digit) |
β | π | β | β | β | 0xe (hexadecimal digit) | |
β | β | π | β | β | 0xd (hexadecimal digit) | |
β | π | β | β | 0xc (hexadecimal digit) | ||
β | β | π | β | β | 0xb (hexadecimal digit) | |
β | π | β | β | 0xa (hexadecimal digit) | ||
β | β | π | β | 0x9 (hexadecimal digit) | ||
β | π | β | 0x8 (hexadecimal digit) | |||
β | β | π | β | β | 0x7 (hexadecimal digit) | |
β | π | β | β | 0x6 (hexadecimal digit) | ||
β | β | π | β | 0x5 (hexadecimal digit) | ||
β | π | β | 0x4 (hexadecimal digit) | |||
β | β | π | β | 0x3 (hexadecimal digit) | ||
β | π | β | 0x2 (hexadecimal digit) | |||
β | β | π | 0x1 (hexadecimal digit) | |||
β | π | 0x0 (hexadecimal digit) | ||||
β | π | β | β | β | 0q3 (quaternary digit) | |
β | π | β | β | 0q2 (quaternary digit) | ||
β | π | β | β | 0q1 (quaternary digit) | ||
β | π | β | 0q0 (quaternary digit) | |||
π | β | β | β | 0b1 (binary digit) | ||
π | β | β | 0b0 (binary digit) | |||
π | β | (end of address part) | ||||
π | β | β | (end of number part) | |||
π | β | (space blank) (probably just space) | ||||
π | β | (carriage return) | ||||
β | π | (roll transfer) |
Output
A teletypewriter is used to print the result on tapes. There's also a hole punch that punches holes (of course) onto the tape so that the tape can be used directly as input.
Mainland China has its own 5-bit telegraph code system for the "55εη΅δΌ ζεζΊ" ("Type-55 Teletypewriter"). While ITA2 was probably also used, this system was designed to somehow have some kind of error detecting mechanism built-in: numbers are the characters that got displayed the most, so they all have encodings with 3 ones and 2 zeroes; if something was supposed to be a number but did not have 3 ones and 2 zeroes, one can know there was an error. The code system can be found here
Instructions
- Each instruction is 30 bits divided into three parts of 6-12-12 bits.
- The first 6 bits: opcode
- 12 bits: address X
- 12 bits: address Y
- Instructions are normally written in octal numbers, as is the norm of that era.
- Opcodes consist of two 3-bit part (2 octal digit). The first octal digit determines how to deal with the operands and the result, the second octal digit determines the kind of calculation.
- For the second octal digit:
- 0 - addition
- 1 - subtraction
- 2 - division
- 3 - multiplication
- 6 - logical and (TODO: probably bit and?)
- For the first octal digit:
- 0 - MEM[Y], R = MEM[X] op MEM[Y]
- 1 - R = MEM[X] op MEM[Y]
- 2 - MEM[Y], R = R op MEM[X]
- 3 - R = R op MEM[X]
- 4 - MEM[Y], R = MEM[X] op MEM[Y] (same as 0 but the result is printed)
- 5 - R = ABS(MEM[X]) op AMBS(MEM[Y]) (same as 1 but the absolute values are taken.)
- 6 - MEM[Y], R = R op MEM[X] (same as 2 but the result is printed)
- 7 - R = ABS(R) op ABS(MEM[Y]) (same as 3 but the absolute values are taken.)
- Other instructions are listed as follows:
- 07, 27 - MEM[Y] = A number read from punched tape. (this number is not saved on R)
- 05, 15 - MEM[Y], R = MEM[X]
- 45, 55 - MEM[Y] = MEM[X] (the value is printed)
- 24 - MEM[Y] = R; Jump to X
- 64 - MEM[Y] = R; Jump to X (R is also printed)
- 74 - R = ABS(R); Jump to Y
- 34 - If R is positive, jump to X; else, jump to Y.
- 04, 14, 44, 54, 17, 37, 57, 77 - Halt.
- For the second octal digit:
Floating point
Here's a paper I found on cnki.net that describes the program for floating point arithmetics. I haven't tested it but if they say it worked then it will work I guess.