πŸ“œ ⬆️ ⬇️

Designing your own computer. Part 1

Introductory part. "Napoleonic plans"


Almost a year ago, I had the idea to understand how a computer works, how it works. And of course, there was a great desire to create your own on elementary logic elements (to be more precise, on transistors).
Then I had only a small idea of ​​his work: I knew that all digital electronics was built on logical elements (for me it was like a postulate), but I couldn’t figure out how the program was being performed, the numbers are summed up, why interrupts ... This list questions can go on and on, but now is not about that.
Define the characteristics of the developed computer:

Software


For the design of logic circuits, there are many programs. But for large-scale design and debugging, my requirements satisfied only two programs (probably my requirements are too harsh):
  1. Logic circuit
  2. Logisim

Actually requirements:
  1. Intuitive interface
  2. Creating large size schemes
  3. The ability to create modular schemes (scheme in the scheme)
  4. A variety of basic logic elements with the ability to edit their parameters
  5. The presence of the element "RAM" and \ or "ROM"
  6. Ability to load a binary file into RAM \ ROM and save a dump of RAM into a binary file
  7. Existence of extensive element base for input / output of information and debugging of circuits (buttons, constants, probes, clock generator ...)

In this and all subsequent posts when publishing logic circuits, I will use Logisim due to the fact that I recently switched to Ubuntu, although the entire project is done on Logic Circuit.

Action plan



Since practice without theory does not exist, a theoretical basis is needed to create something. Therefore, today in the program we will consider the following theoretical aspects:


The key element of all digital electronics is the transistor


The base element for the integrated circuit is the transistor.
For the definition of Wikipedia,
A transistor is a radio-electronic component made from a semiconductor material, which allows an input signal to control the current in an electrical circuit.
Logic elements consist of transistors. Triggers, adders, logical blocks, and counters are created from logical elements. By combining all this in the right way, you can create your own computer (or ).
')

Logical elements, their types


Logic elements - devices designed to process information in digital form.

A logical function of any complexity can be defined using the following logical elements:

Logic elements in Logisim:


Technologies for building electronic circuits or building logic elements on transistors


The original idea was to build a computer not on the 7400 series chips, but on transistors. And I began to search for the construction of electronic circuits. There are the following:
  1. Resistor-transistor logic (RTL);
  2. Diode-transistor logic (DTL);
  3. Emitter-related logic (ECL);
  4. Integral-injection logic (IIL, I2L, I3L, I2L);
  5. CMOS (K-MOS; complementary metal oxide semiconductor).

Then I read for each advantage \ disadvantages, and among them I chose resistor-transistor logic . The choice was obvious due to the fact that this logic has a constructive simplicity and low cost. And also to this logic there is a huge choice of bipolar SMD transistors and SMD resistors. I took the transistors BC847C npn and BC857C pnp.
Having closed my eyes to all the flaws, I plunged for a whole month into recounts of logic elements on transistors. I made several test circuits on a breadboard, using BC547C transistors. I was pleased with the results of the theoretical and practical parts.
Layout:


The last stage is left - designing a synchronous T-flip-flop circuit on 847 transistors, checking its efficiency and analyzing frequency characteristics. The performance test is quite simple - a logical β€œ1” is fed to the β€œT” input, and a clock from the generator to the β€œC” input. At the output, I must receive clock pulses, the frequency of which is half the input. If everything works at a reasonable frequency, then the whole computer will work.
Designed the scheme, which consists of 4 T-flip-flops. Made a printed circuit board photoresistive method, uncomplicated soldered and eventually got just such beauty (the width of the tracks is 0.15mm):




I connected a 5 volt power supply to the circuit, I connected a generator to the input and an oscilloscope to the output. I started testing at 1 MHz, but the circuit did not work. Then he lowered it to 20 kHz - voila, the scheme worked in the right way. By manipulating the supply voltage, I was able to increase the working frequency to 40 kHz ...
Alas, but my expectations did not meet my expectations. In addition, only one T-trigger earned correctly at a frequency of up to 40 kHz, and all the others could not go from a high state to a low state, although the internal RS-triggers worked correctly.
I conducted some more experiments on the construction of logical elements, only already on field-effect transistors. The results were satisfactory, but some problems appeared:

  1. The high cost of the project (about $ 1000 only for transistors);
  2. The problem is to get field SMD transistors in Ukraine;
  3. The problem is to solder 15-20 thousand transistors on a CMOS logic, instead of 7-10 thousand on a RTL.

For myself, I made a good conclusion : it is better to buy 7400 series microchips with logic elements than to make logic elements on transistors. And to clear your conscience when the whole circuit on the chips is ready, you can replace several key chips with transistor circuits and connect in turn both to show that all the chips can be replaced with transistors :)

Laws de Morgan or how to reduce the number of valves


The de Morgan laws are the rules that connect logical operators (disjunction and conjunction) by means of logical negation. In formal logic, they can be written as:
image
image

Consider an example of using these rules in action. Suppose we have such a scheme:

Using the laws of de Morgan scheme can be altered on such:

As you can see from the truth tables, the logic of these schemes is identical.
Now a small postulate : for logic elements (except logical NOT) on CMOS logic with inverse output (for example, logical 2-NOT) it is necessary for two transistors less than for logical elements with non-inverse output (for example, logical 2).
Then, for the first circuit will need 18 transistors, and for the second - 12 transistors. Moreover, the second circuit will work faster due to the fact that fewer gates are used and the signal will go an order of magnitude faster.

Future plans


In the next post I will talk about triggers and we will begin to design the ALU.

Source: https://habr.com/ru/post/178071/


All Articles