0
\$\begingroup\$

I'm thinking of ideas for a school project and one of the better ones was to build a calculator from scratch using only wire and basic electrical components. I've seen very many marble, Lego, domino, etc calculators that involve AND, OR, NOT, etc logic gates, but I wanted to make one purely electrically. I've seen some say that this is a very difficult project, but I have a couple months and I'm intermediately experienced in electrical engineering and have 6 or 7 EE projects under my belt. My problem is that I can't find diagrams anywhere for basic logic gates, only transistors, which feels like cheating. Any and all help is appreciated. Thank you!

\$\endgroup\$
  • 2
    \$\begingroup\$ What do you mean by "diagrams for basic logic gates, only transistors"? Do you mean you can find schematic diagrams of logic gates using transistors, or that you're looking for such diagrams and not finding them? Certainly, building a calculator using gates built up from discrete transistor circuits will be a challenge and a half -- you'll end up with something big and clunky, but hopefully educational. \$\endgroup\$ – TimWescott Dec 30 '18 at 20:37
  • 1
    \$\begingroup\$ There are a bunch of ways, from relays and switches through to diodes and transistors. A good text on logic design should cover this. \$\endgroup\$ – danmcb Dec 30 '18 at 20:44
  • 1
    \$\begingroup\$ What would you define as "basic electrical components"? Do transistors count? Relays? Basic logic ICs? \$\endgroup\$ – duskwuff Dec 30 '18 at 20:45
  • 1
    \$\begingroup\$ You'll need to use the edit button to more clearly restate your goal or this is likely to fairly soon end up closed. Doing actual computation with hand built gates will be hard and is not something you should attempt without an understanding of clocked design, and a plan that you have validated by one means of simulation or another. \$\endgroup\$ – Chris Stratton Dec 30 '18 at 20:46
  • 1
    \$\begingroup\$ As a rough estimate a 4-banger calculator might take 100 MSI chips (gates, latches and such like). It might take a few thousand transistors and diodes. Or one $2 Arduino Nano clone. \$\endgroup\$ – Spehro Pefhany Dec 30 '18 at 20:52
1
\$\begingroup\$

Build a serial-adder. That can become a multiplier. Or a subtractor. Given a subtractor, you can build a divider.

Here is a discrete resistor-transistor logic NOR, such as used in the Lunar Lander Radar; that used ONLY this circuit, even for latches.

schematic

simulate this circuit – Schematic created using CircuitLab

Note this will be rather slow, about 5MHz clock rate, maybe. For each 1-bit serial-add. For 32-bit add, you need about 6 microSeconds (160,000 per second). For 32-bit multiply (that will produce 64-bit lossless result) you need 64 * 6 = over 3,000 microSeconds, or about 300 multiplies per second.

But who is in a hurry?

If you want to build this, at 3mA per logic NOR, assuming each latch is at least 4 NOR, and 500 bit storage, you need 4 * 500 = 2,000 NOR gates at 3mA each. Thus at least 6 amperes of 3.3 volt power. Just for the latches.

\$\endgroup\$
  • \$\begingroup\$ Are you saying the Lunar Lander Radar is made entirely 3 input NOR gates, and that each one required a transistor and 4 resistors? \$\endgroup\$ – K H Dec 30 '18 at 22:51
  • \$\begingroup\$ I'm not trying to be rude, just want to be clear because whooooa! Crazy little factoid! \$\endgroup\$ – K H Dec 30 '18 at 22:55
  • \$\begingroup\$ Indeed. Twas the Fairchild uL 923 integrated circuit. These were some of the early Integrated Circuits (I've a couple, somewhere), with 6 or 8 gold plated leads that stick down from an epoxy package. \$\endgroup\$ – analogsystemsrf Dec 30 '18 at 23:02
  • \$\begingroup\$ Ah. OK. That would still really add up, but I saw the "2n3904" in your drawing and started thinking of big old FR boards with hundreds of resistors and 3904s on them =). \$\endgroup\$ – K H Dec 30 '18 at 23:10
  • \$\begingroup\$ See here for a history of the lunar lander radar: hq.nasa.gov/alsj/ApolloLMRadarTND6849.pdf \$\endgroup\$ – David Dec 30 '18 at 23:11
0
\$\begingroup\$

Internally, logic gates are made of transistors, diodes, and resistors. This is true for all logic families, both bipolar and CMOS. Of course, the components vary among the families; that is why they have different operating characteristics. Most basic gate (AND, OR, etc.) datasheets have an internal schematic of one gate so you can see how it works. Growing gates from discrete components following these schematics isn't cheating; in some courses it is required lab work.

Be warned, it takes a LOT of gates to make a simple 4-function calculator, and that's just for the calculation part. Growing the display system from scratch is even more work.

\$\endgroup\$
  • \$\begingroup\$ There are no diodes or resistors that are designed components in CMOS gates. There may be parasitic devices, but your statement is misleading. Furthermore, AND and OR are not the "basic gates" in CMOS...NAND and NOR are the simplest primitive gates. \$\endgroup\$ – Elliot Alderson Dec 30 '18 at 21:40
  • 2
    \$\begingroup\$ As I said, the components vary among the logic families. Spelling out which components are used in each of the dozen major logic families seemed like a waste of effort at this level of the discussion. For the same reason, I did not list all six of the basic gate types. \$\endgroup\$ – AnalogKid Dec 30 '18 at 22:27
  • 2
    \$\begingroup\$ Also, there are (non-parasitic) resistors and diodes in most CMOS logic families. Granted, these are for input protection rather than the logic function, but they are in there. Again, this is a level of detail that I thought would be more confusing than enlightening given the experience level of the OP. \$\endgroup\$ – AnalogKid Dec 30 '18 at 22:30
  • \$\begingroup\$ Having done lots of CMOS designs, I can state the DIODES and the Resistors are indeed "designed", even using special implants to improve the diodes (especially for ESD purposes) and allowing the resistors (the gate poly) to be placed atop thick oxide for minimal capacitance and thus best bandwidth and also minimal substrate-trash injection. Lots of subtle ADC errors go away, when using the right resistors. \$\endgroup\$ – analogsystemsrf Dec 30 '18 at 23:11
  • \$\begingroup\$ @analogsystemsrf Yes, resistors and diodes are designed as part of ESD protection and for analog circuits...but they are not designed components for CMOS gates and this question is about gates. \$\endgroup\$ – Elliot Alderson Dec 30 '18 at 23:21
0
\$\begingroup\$

The idea of using a 3-input NOR gate as the basis for your logic is a good one. However, I personally have a nearly-full reel of NMOS transistors, so instead of using @analogsystemsrf's RTL gate, I would go with an NMOS gate:

schematic

simulate this circuit – Schematic created using CircuitLab

As far as physical construction goes, I've been toying with the idea of having a small PCB made that incorporates two such gates in a 10-pin SIP package. (See these UNI-SIP breadboards for an example of this.)

Note that it takes six 3-input gates to build a full master-slave D flip-flop, which would be three such modules.

These SIPs would plug into a wire-wrap breadboard, which would then hold the application-specific wiring. A large panel (of the type shown below) could hold a couple hundred such modules, which would be enough for a general-purpose CPU (e.g., PDP-8 or 8008).

Augat board, top Augat board, bottom

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.