Building a decorative transistor computer - step 1

    Recently, there was an article on the design of a personal computer on a hub , where the author first wanted to build a computer from transistors, but then decided to continue on the 7400-series chips due to the fact that on transistors it seemed to him too complicated and expensive to do.

    I was interested in a similar task for the past 3 years - but I have not given up the initial idea of ​​building on transistors, and now I can tell you my thoughts and show the current developments, and also I want to ask your opinion about what _serial_ transistor decorative should be like computer. But you should immediately notice that the work ahead is still a couple of years :-)

    The main question is - why all this is needed if there is FPGA and all sorts of Raspberry Pi?

    The answer is simple:
    1) I am interested in doing this in my free time, and
    2) A decorative computer (decorative is a matter of attitude to the computer, not its appearance) - it is like decorative pets: a pug will not bite his leg off to a robber, and a Persian cat will not defeat a metro rat. But it’s interesting to play with them and show the guests - even if in the area of ​​computing, guarding and hunting, they are much inferior to “combat” counterparts.

    Task Substitution and Architecture

    What are our requirements for a decorative computer?

    • Development for automated assembly . Hands soldering 5000 parts to a computer - you can turn gray.
    • Performance is not significant, the main thing is that there are 100 thousand operations per second (at the level of Radio-86RK). Even 100 thousand op / s will solve many problems.
    • Practice shows that 64 KiB of memory is a realistic minimum amount of memory. In 1-4 KiB, much will not fit, therefore, it is not worth reducing the address bus to less than 16 bits.
    • Programming is in C. You can not force people to spend their free time on assembler (but if there is a desire, then all the cards are in hand).
    • In the basic model - only the processor itself is made of transistors. Memory and strapping - can be from microcircuits. A fully transistor version is possible in the future, but this will be further development (with its limitations - it will be difficult to have more than 1-2 KiB of memory)
    • In the processor - disabled LEDs show the status of internal registers (IP, battery, write / read from memory ...)
    • Not too high price. The cost of one transistor with strapping and automatic installation is about 2 rubles, respectively, it is not advisable to use more than 1000 transistors for a serial product. This means that the circuit should be simpler than i8080 (4500 transistors), i4004 (2300 transistors), and MT15 (~ 3000 transistors), despite the requirement of a 16-bit address bus.
    • uCLinux? Even without virtual memory, it would be very desirable to have 24-32 bits. Of course, this would significantly increase interest, but would require at least doubling the number of transistors (= doubling the price). Also, with increasing bit depth, the speed of the serial computer also decreases proportionally.
    • Hardware support for interrupts - not required, because it pulls a lot for itself (microcode, hardware stack, etc.), and you can do without it.


    User interaction: The classic implementation is a keyboard + output to a TV or VGA monitor. Making a convenient “own” keyboard is too difficult - you need to use standard PS / 2 or USB. PS / 2 keyboards are already rare - and supporting USB in a transistor computer will be difficult without using dirty hacks (like a microcontroller).

    Probably the optimal and simplest solution may be the terminal interface - when a computer communicates with the outside world through a serial port (RS232), programs can be downloaded in the same way. Those. in the simplest case, the transistor computer is connected to the desktop computer (or to a specialized terminal) via the USB <> COM adapter, and you can work with it in any terminal program (for example Putty).

    Also, you need the ability to connect external devices via GPIO pins.

    Serial or parallel ALU? 8 or 16 bits ?: Since the number of transistors is very limited (<1000), you will have to sacrifice performance, and all operations should be carried out sequentially. This greatly reduces the required number of transistors - in fact, 1-bit logic and 16-bit shift registers are needed. But at a clock frequency of 1 MHz - we will have only 62 thousand. operations per second, it is desirable, of course, to have a higher frequency.

    Because In any case, we need to have a 16-bit address bus, support 8-bit operands - this means significantly complicating the instruction system and increasing the number of required registers. Therefore, everything will probably be simple - a 16-bit address bus, and a 16-bit machine word. There will be no possibility of working with 8-bit data, if anyone needs only 8 bits, they will have to work with shifts.

    Processor architecture:Of course, a full-fledged computer needs to be able to write code into its memory. Therefore, if it is possible to shift this to an external processor strapping, then the Harvard architecture (with separate code and data memory) will be easier to implement and faster to work. But if the processor strapping is transistor, then you will have to use shared code and data memory. So here the choice depends on the vote at the end of the article :-)

    The processor itself - will be hard-wired (the logic for working with microcode, and the microcode itself - could take a lot of transistors), will inevitably have a very simple set of instructions (binary logic + add, shifts of 8 and 1 bit), and the minimum number registers (1-2) with the ability to use RAM as pseudo-registers (as in 6502). Perhaps, in the simplest case, all the commands will be executed according to a single rigid scheme ax = mem [imm] = mem [imm] op ax + conditional transition bit - this will reduce processor logic to a minimum and put the maximum amount of work on relatively fast RAM.

    There will be no hardware stack and hardware interrupt handling - this can also be implemented in software: we have more memory than transistors.

    Supply voltage: 3.3 and 5V?Most older computers use 5V, and modern electronics have long been focused on 3.3V for external connections. This computer will also use 3.3V - but because the low-impedance pull-up resistors will consume 2.5 times less energy - and accordingly, their resistance can be further reduced and speed increased.

    Transistor processor building blocks

    Of course, to make a processor out of less than 1000 transistors, using standard approaches to constructing logic circuits (even taking into account the serial ALU) will not work - and various circuitry compromises and tricks must be applied to reduce the number of transistors.

    The speed issue is also important - both in the previous article on the Habré and in MT15 - the clock frequency at which logical blocks could work turned out to be very low. For a serial computer, this issue is becoming a hot issue.

    Simple Logic Speed

    As it turned out, there are some simple tricks that greatly accelerate the logic on bipolar transistors: this is adding a Schottky diode to prevent the transistor from entering deep saturation (the output from which is very slow, up to 200-500ns), and optionally adding a capacitor of 25-50 pF parallel to the base resistor in order to quickly recharge stray capacitances of the circuit. And of course, as with any high-speed digital circuits, you need to isolate the power supply with ceramic capacitors near the consumers, and in some cases long digital tracks will require termination.

    After applying these tricks, we get the following (here both optimizations are on the very right side of the circuit):



    And it works very briskly, on the waveform - 100ns / division, edges / delays of the order of 10ns:


    Also, choosing the resistance of the resistor from the base to the ground, you can control the transfer characteristic of the logic so that the threshold voltage is approximately like that of the CMOS, about 3.3 / 2 = 1.65V. Such a change, in addition to noise immunity, will give another important advantage: gently sloping fronts at the input will become sharper after going through the logic. Also, if we do not need to save electricity, we can throw out the “upper” transistor, and replace it with a resistor. The scheme is as follows:


    A transfer characteristic:

    3 colored lines - this is a simulation at different temperatures (20, 40 and 60 degrees), the parameters of bipolar transistors are noticeably floating with temperature, and this must be taken into account in more complex schemes.

    More complex logic


    T-trigger - T-trigger on a clock signal changes its state to the opposite. It can be used to build a parallel instruction counter, but probably will not be used since everything will work sequentially. The principle of operation is a bistable multivibrator, by a short negative clock pulse - it switches to the opposite state due to capacitors parallel to resistors R8 and R9.



    The circuit was implemented “in hardware”, together with inverters. Inverters showed the expected speed (i.e. ~ 10-20ns fronts). Do not be alarmed by the quality of soldering - the board has gone through many experiments and options for transistors / parameters:



    A full adder is one of the most important and complex digital units. The canonical implementation of CMOS full adder - requires 28 transistors:


    Modern implementations using a transmission gate and various tricks require 8-11 transistors with more stringent requirements for the choice of transistors, but these circuits cannot be implemented directly from discrete transistors - 4-pin transistors are needed (and they are rare), and due to degradation Logical level 1 requires a high supply voltage (since the threshold voltage of available discrete field-effect transistors is 1.5-2 volts versus 0.5V for integrated transistors).

    The very minimum that I had to see was out of 6 transistors, using capacitors (but reliability raises questions). Known implementations on bipolar transistors also require 22 transistors .

    But is it possible to do with just 4 transistors? I got a little brain, and it turned out the following:


    Schedules:


    Scheme for simulation in LTspice IV can be downloaded here .

    The principle of operation is as follows: the order of the terms does not matter, we simply mix them analogously, and by accurately selecting the threshold voltage of the dual inverter, we immediately get the transfer. Then subtracting the transfer on the transistor Q3 from the analog sum, we get the sum. Of course, all this requires an accurate selection of response levels, and simulation based on temperature. Schottky diodes - to prevent transistors from entering deep saturation, which dramatically reduces the speed of work.

    The use of field effect transistors is possible, and provides better temperature stability, the main thing is that they have a sufficiently low threshold voltage.

    Shift register- The most critical part of this transistor computer. Classic implementation on synchronous D-flip-flops - requires a monstrous amount of transistors per bit.

    I managed to fit in 2 transistors per bit, with the following features:
    1) Registers are based on capacitors, and if they are not “moved”, then the data will disappear over time. But with a field effect transistor, the storage time is quite long.
    2) Data transfer to the next stage - by a bipolar transistor. In half the cases, it works in the opposite, non-standard mode - the breakdown voltage is much less (but 3.3V should hold), and the gain is much lower than direct connection (but I hope it will be enough).
    3) Each next step - inverts the signal, this is not a problem when only sequential access is needed (for example, in the case of processor registers). If you need a non-inverted parallel output, you will need to add 8 inverters (i.e. a 16-bit shift register will require 40 transistors, not 32).
    4) There remains a problem with the saturation of the bipolar transistor.



    Schedule:


    With these compact implementations of digital circuits - keeping within 1000 transistors, I think it will be quite realistic.
    That's all for

    now - monstrously a lot of work awaits me ahead. And now - a few questions for readers: Which options seem acceptable to you?

    Only registered users can participate in the survey. Please come in.

    Interface Options:

    How much can a decorative transistor computer cost so that you don’t mind buying it?

    What architecture options do you like?


    Also popular now: