-1

I recently purchased the book 'Code' which, for those who don't know, is an insight into how computers work on the hardware level - going down to basic components and how various parts of a computer are structured in terms of logic gates and I/O signals.

It has inspired me to make a simple 8 bit computer myself. I will probably use CMOS ICs for more complex components (such as RAM), however stuff such as the clock and accumulators etc I am planning on making entirely out of transistors.

I understand that NPNs are the way to go with logic gates, however I don't really understand what type of NPN to buy and what resistor to use for the base. From articles I've read it seems to be 1K resistor however I don't not know what transistors they use.

If someone could give me an idea on what kind of transistor to use it would greatly be appreciated.

Thanks :)

Adam

EDIT: I am planning on using a 5V power supply, I don't know what amperage however, so if someone could give me guidance on that as well :) (I think it should be a 2A form what I've read)

adam
  • 109
  • 2
  • 1
    Shopping questions are off topic, so you could change this to ask what characteristics you need for those transistors. I would go with a jellybean part, whatever you can get cheap such as a 2n3904 or 2n4401. Alternatively a 2n7000 n channel mosfet might be a good fit. – Colin Jun 13 '17 at 11:04
  • @Colin__s Cheers for the quick reply - so the 2n3904 can only handle 200mA collecter current, does that mean I would require a resistor to limit the current (which I presume would be higher than 200mA coming from the power supply)? – adam Jun 13 '17 at 11:14
  • From your comment, I suspect you're diving straight in at the deep end. You would be better served learning how transistor logic works, and building some simple circuits. Starting straight on a CPU will lead to frustration and probably some smoke. To answer, yes you will need some resistors to limit current. – Colin Jun 13 '17 at 11:40
  • @Colin__s Yeah I think I am, I have an electronic kit thing that allows you to learn but it doesn't seem to help with explaining stuff - it just wants you to know what happened rather than why it happened. Thanks for your comments though :) – adam Jun 13 '17 at 11:42
  • 3
    Yeah, what Colin suggests, to which I'll add from my learner days (circa 1972): Build an astable multivibrator first for a timer. Messing around with discrete components can be great fun, plus, if nothing else, astable multivibrators make great, musically-rich tones (the square wave output has lots of harmonics). – Michael Gorsich Jun 13 '17 at 11:46
  • 3
    Reminds me of my own first learning experience. There was a while when I felt like the answer to every circuit design was some combination of two transistor astable multivibrators. Ah, the grand days of the BC108... – Ian Bland Jun 13 '17 at 12:33
  • 2
    Adam - Find a copy of the 1970 'book "Osborne 1 - An introduction to microcomputers" ... searches ... various formats here - PDF is 376 pages. Read it. This will be about as hard a book to read as you will ever meet. If you master it, when you look at the book again a few years later it will be troivial. (Ask me how I know :-) - 40 years ago!) . If it's too hard, find Volume 0. Written later because so many foun=d vol1 too hard. But, it's the best. https://archive.org/details/AnIntroductionToMicroprocessorsVolume1 – Russell McMahon Jun 13 '17 at 12:43
  • @RussellMcMahon Cheers, I'll try and find time over the summer to read it - looks like a very interesting read indeed. – adam Jun 13 '17 at 14:01
  • Add "Bebop BYTES Back: An Unconventional Guide to Computers" to your book list. There are some other good books on instruction design and decoding that I may later add. – jonk Jun 13 '17 at 14:35
  • So you want to build something like this: http://monster6502.com/ – Andrew Jun 13 '17 at 14:57
  • @Andrew That's cool, Andrew. I also like to point out this one: http://web.cecs.pdx.edu/~harry/Relay/ just to show what can be done with still older technology. – jonk Jun 13 '17 at 15:10
  • 1
    I walk through a reduced-down design process for RTL here: https://electronics.stackexchange.com/questions/281152/how-to-chain-transistor-logic-gates/281320#281320 . So you might take a look there. Then consider the idea of DTL, as well. However, even there I recommend careful design steps before settling on exact values. No matter what you do, you need to thoroughly test the basic logic gate design and make sure it is versatile and handles part variations well, too. – jonk Jun 13 '17 at 15:14
  • 1
    You say "8-bit." If you're thinking of something like a 6502, that's going to need somewhere in the neighborhood of 3500 to 4000 transistors to implement just the CPU. But, the world has known simpler computers than that. I don't know how many transistors it would take to replicate a Digital Equipment Corporation PDP-8 CPU, but the programming model of a PDP-8 was _way_ simpler than a 6502. There also were 4-bit CPUs, like Intel's 4004, and HP's Saturn... If you want to make your own SRAM, that's going to be at least four transistors _per bit_. – Solomon Slow Jun 13 '17 at 21:04

2 Answers2

1

While I applaud your interest, you should be aware that you have taken on a monumental task. Even a fairly limited 8-bit computer will take hundreds (thousands, more likely) of transistors, let alone diodes and resistors. And resistors and diodes will always outnumber transistors. See, as an example, this project which does what you are trying. Especially, check out the Octal D Latch picture.

If you are still up for it, you can rest easy about the transistors. Almost any small-signal transistor will do. I'd advise going to digikey.com or any other online component supplier, then searching on discrete transistors. Select for NPN and through-hole, then sort by price. You should be able to find something for less than 5 cents per unit, which is just as well considering the quantities you'll need. Do the same thing for diodes (but skip the NPN part). And resistors get remarkably cheap in the thousands quantities.

You'll also need to consider how you're going to mount these circuits. As the linked project does, you're probably best off modularizing your circuits using perfboard.

Frankly, you're much better off by starting small. Make a few logic circuits and get a feel for what it takes, keeping the final computer as a distant, long-term goal. If you become comfortable with modularized logic blocks, you will see the wisdom of using integrated circuits instead of building your own blocks - they are equivalent, after all. Keep in mind that in the linked project, a single octal register, which you can get as an IC for less than a buck, took 2 1/2 hours of soldering. And (trust me on this) there is no guarantee that you will make all the connections properly if you do it yourself, so there may be a whole lot of extra time and aggravation spent it trying to track down your mistakes.

And finally, at a minimum you will need to get an oscilloscope. The scope will need to be faster than your computer clock rate, and you will have to learn how to use it. But you absolutely will not be able to troubleshoot the inevitable problems with just a meter.

WhatRoughBeast
  • 59,978
  • 2
  • 37
  • 97
  • No, you specifically *don't* want to use thru-hole parts. The greater hassle, larger space requirements, and much more labor involved will really add up after a few 100 parts, let alone a few 1000. – Olin Lathrop Jun 13 '17 at 18:14
  • 3
    @OlinLathrop - While I agree with the argument in general, to expect this poster, who is entirely ignorant of electronics design, to jump immediately to SMDs seems quite unreasonable. And you noted, I hope, that I suggested the effort would be "monumental". – WhatRoughBeast Jun 13 '17 at 22:10
-1

1,000 ohms from collector to +5, with 100 pf (approximately 5 loads) Cload on collector, achieves 100nanosecond delay in your NOR or Inverter.

Using 10Kohm into base, hitting the Miller Multiplication point, makes your logic very vulnerable to noise at that Miller pivot point.

Thus I'd use DTL NAND gates, with 1Kohm collector to +5v, and 1Kohm pullups on bases.

schematic

simulate this circuit – Schematic created using CircuitLab

analogsystemsrf
  • 33,703
  • 2
  • 18
  • 46