Slashdot Mirror


Building A Computer From Scratch?

wackybrit asks: "The economy has given many of us the chance to go and work on some side projects. I was reading "Interview With Bill Gates" and have been inspired to create my own computer from parts, to write my own interpreter, and to really see if I could do what Gates and Allen did back then. With the Internet as a reference guide, it should be easy. However, things are not always so easy. I might be a techie, but I have no idea how memory chips hook up, how a data bus really works, and how to tie everything up. Do you Slashdot folk have any handy tips or resources I can refer to for building my own machine from scratch?" If you had a chance to build your own computer, would you make yours similar to existing designs (ala the PC, or the Mac), or would you do it differently?

27 of 68 comments (clear)

  1. Personally by redcliffe · · Score: 2, Insightful

    I'd build a mini computer with the functionallity of an 8080, but also some features to make certain functions use less cycles than a normal microprocessor. FPGA's are cool for this.

    1. Re:Personally by Rick+the+Red · · Score: 2
      Yes, FPGA's are cool for this. But I'd make a Turing Machine, not a "computer."

      --
      If all this should have a reason, we would be the last to know.
  2. Sounds like fun by ObviousGuy · · Score: 2

    The whole idea of building your own computer is one of those things that people talk about but never end up doing.

    A basic handbook of computer architecture is probably very necessary, so let me suggest the one that everyone's probably read: Hennessy & Patterson.

    Good luck!

    --
    I have been pwned because my /. password was too easy to guess.
    1. Re:Sounds like fun by Eagle7 · · Score: 2

      Am I the only one that found this book next to impossible to read? Everyone seems to use this book, but I have yet to find a student who thinks it is a clear and consise presentation of the material. Perhaps for a Senior/Graduate course for computer engineers, but when I had to use it for a (poorly taught) mid-level computer science course on architecture, I found it more infuriating than anything else.

      I've found (and understood) good books on Computational Theory, so I figure I am capable of understanding Computer Architecture from a book as well, if it was presented well.

      --
      _sig_ is away
  3. Good book by .@. · · Score: 3, Informative

    If you can find a copy, "Bebop Bytes Back" (found here) is a wonderful book. Despite the childish title, the book will walk you through designing a computer, from scratch. An included CD-ROM provides you with all sorts of routers, simulators, and so forth, including a few IMSAI simulators.

    Even if you don't actually build a computer, you'll feel like you've done when you make it through this book. Bebop To The Boolean Boogie and Designus Maximus Unleashed are also very good tutorials.

    These books aren't going to teach you how to build with off-the-shelf components. They're going to help you understand bus-level logic and so forth.

    From there, you may want to look into the How to Write Your Own Operating System page, which will help you get something running on the ahrdware you put together.

    --
    .@.
  4. Re:The road most travelled by Mr+Z · · Score: 5, Informative

    Huh? I suspect you didn't understand the question. You're thinking about plugging together a bunch of boards you picked up at Micro Center or George's Local Computer Shop or whatever. That is NOT building from SCRATCH any more than microwaving a TV dinner is cooking food from scratch.

    The article is asking about designing a computer from the component level. That is, getting individual chips, etc. and working from there. For that, I'd recommend taking some digital logic courses, or studying the equivalent material online.

    To really know what you're doing, at least well enough to build an early 80s-level computer, you'll need to know the following:

    • Combinatorial Logic: This will teach you about logic gates, boolean arithmetic, binary numbering systems, and all sorts of digital logic that isn't changing with respect to time.
    • Sequential Logic: This will teach you how to build state machines and deal with circuits that change state versus time. This builds on the first step.
    • Microprocessor Interfacing: This teaches about common computer structures, such as data busses, address busses, clocks, and how everything hooks together. A one-semester undergrad course should be sufficient to design something along the lines of an IBM PC XT class machine, if you're good.

    That's what I'd recommend. Also, go find schematics for those old machines (Apple ][ computers used to come with schematics, for instance), and study those. Good luck.

    --Joe
  5. Go simple by Snowfox · · Score: 4, Informative
    Go simple if you're building your first one.

    Use a 65816 or even a 6502. Don't plan on making this your main machine. Just go with what's easy to build, because you're going to make a hell of a lot of mistakes.

    The advantage of a simple processor with a narrow bus and address space and with well-defined behaviors is that you're going to spend a whole lot less time debugging bad traces and similar basic mistakes, and more time getting at the real meat of the system.

    You might also grab a copy of Embedded Systems or similar and grab one of the many microcontrollers advertised therein, with a decent amount of RAM and basic I/O controllers on the chip. Getting memory working involves a lot of busywork, connecting pins over and over and over and over and over.

    Another user suggested getting the C64 programmer's reference manual and looking at the schematic in the back. This would be a good start. Look at at least a few reference designs before anything else. Most of the really old systems had complete schematics available so your average electronics repair shop could troubleshoot them.

    1. Re:Go simple by NoMoreNicksLeft · · Score: 2

      Bleh. Cheapest I've seen a 6502 is $7, and he'd need logic to do dram refresh. The z80 is $2 at jameco.com, and can do its own refresh.

      Then again, I guess that's moot nowdays... he almost certainly can find a few static 32k's for less than a buck (the cache ram off a 486 works nicely). In that case, 6502 asm is nicer than z80, I never did like the idea of io ports.

      Most modern IDE hard drives aren't easy to interface to an 8bit data bus. Go with a cheap Compact flash chip, which is ide-like and 8 bits wide. Cheap, can get them at walmart, and they have a crapload of storage for a 8bitter.

      Keyboard is tough, I wouldn't want to interface a ps2 to the thing, and yet it's a pain to build your own matrix keyboard (though the concept is simple enough). Maybe a serial port for this?

      Monitor is another problem, but probably a cheap serial lcd would work nicely. Heck, earthlcd.com has some kickass pixel lcd's, in the sub $50 range. Could actually have it do pacman like games and whatnot, if he cared to. Though serial would be simpler.

      Note: Don't listen to the morons that will try to push a Strongarm or something on you... that's an intermediate (or higher) level project.

    2. Re:Go simple by NoMoreNicksLeft · · Score: 2

      Yes, the z80 is technically stronger, even I listed several advantages of it (though by no means, all of them). I don't know why I like the 6502, but it's a nice enough chip. I wouldn't want to call it weak, by any means.

      Again, I think that a cpu built out of 74xx is an intermediate level project. I'm not sure that I'm really up to that myself. Not a project he shouldn't pursue, but would be difficult and dissappointing this far along. Definitely something you'd do before trying to implement acpu on fpga...

  6. Starting places by arb · · Score: 4, Informative

    First of all you should decide on exactly what you want to do. Do you want to design and build your own computer, or are you happy to build a computer that other people have already designed? I started building other people's designs (the first computer I built was a Z-80 kit computer) and managed to teach myself enough to tackle designing and building a simple 8-bit computer. 8-bit computers are reasonably simple to design and build and there's quite a lot of resources on the net available.

    I would suggest that you look at sites like 6502.org, www.coprolite.com, Mark-8, POD 6502 or Grant Searle's collection of sites build your own UK101, build your own ZX-80 and build your own Jupiter Ace...

    These are all quite good sites, and you can study their designs to learn how they work.

    Hope this helps!

  7. Other Interview Better by Euphonious+Coward · · Score: 2
    I think this other interview was more revealing:

    Microsoft Code Has No Bugs
  8. If it were me.. by Tom7 · · Score: 2

    If it were me, I'd write circuit-simulator software and do it in simulation on the computer. Who wants to deal with burnt-out components and other perils of the real world? Plus, this way allows for lots more interesting experimentation, and you get to code up the ICs rather than using off-the-shelf components.

    1. Re:If it were me.. by NoMoreNicksLeft · · Score: 2

      Who wants to?

      Maybe someone who'd like to build something REAL for a change?

  9. It fun by jackb_guppy · · Score: 3, Informative

    I have two of them. Both still work. Z-80 Wire Wrap Motherboards. The first one took almost 6 months to build. The second only a month.

    IT IS VERY BORING TO DO. The first machine has almost 4,000 wires. I made 6 mistakes.

    I got the plans from Kilobaud Mag. They did a three part artical.

  10. Been there, done that. by Animats · · Score: 3, Insightful
    I built a programmable computer out of several hundred telephone relays in the 1960s. The thing occupied six feet of rack space, homebrew paper tape reader and all. It took me two years of evenings during high school. In retrospect, it wasn't worth it.

    If you want to do this today, you might consider designing your own CPU and implementing it with an FPGA. Look into the Forth processors; they're about the minimum useful machine you can build.

  11. Consider some stufy material. by muonzoo · · Score: 2, Informative
    The MIT 6.270 project course has been running for a long time. When I was an undergrad, they has a very cool design for a Motorola 68HC11 based SBC that was perfect for motor interfacing and various small scale projects. These days, the same architect (Fred Martin) has a modernised version of the original 6.270 SBC available at HandyBoard.com and there are variants of the original SBC with it's documentation here.

    Other posters who suggest that you do some studying are not unwise. Digital logic is straightforward when you have a background in combinatorial logic and a few other concepts up to about 25MHz. Designs with that level of clock speed can easily be wire-wrapped. Beyond that, you are going to have to start considering high-speed design issues when you route your boards.

    One of the most rewarding things that I did as an undergrad was design my own SBC around a Motorola 68HC11 to run the mechanics for a 3-D scanning system that interfaced to an SGI workstation.

    I really think that if this interests you, you should pursue it . The current 'state of the hobby' is now so advanced that it is somewhat mind numbing what can be done with some FPGAs and some software to layout a PCB.

    The Motorola Dragonball family (or it's decendants) are an excellent 68000 core family of chips that are easy to use and you can design a modestly useful machine around them with a classic buss / memory mapped IO architecture without working up too much of a sweat.

    Good Luck!
  12. Start small (and simple) by Restil · · Score: 5, Informative

    Assuming you're doing this for the educational experience and not because you plan to end up with a powerhouse computer when you're done, your best bet will be to build something on the scale of the Apple II. The first bit of good news, the parts necessary to build it are dirt cheap now.

    The first thing you need to do is to understand all the logic gates and how they work, and then work with the various logic gate chips (the 74 series) to get various simple experiments working. This will get you familiar with HOW the circuits are passing information around, as well as give you some experience with wiring the components together in a useful fashion.

    After that, CPU's and memory are just largescale versions of your typical logic chips. Of course, its not as simple as it sounds and you definitely have your work cut out for you if you plan to do it completely from scratch. If you want to follow some old schematics your job will be simpler, but that might defeat some of the purpose.

    As for programming, you'll be starting at the raw assembly level. You'll also need some type of interface to input and view data, as well as storage. In the beginning, you can use programmable rom chips to hold enough operating system information to get you going. Yes, you will have to develop at least a simple operating system.

    Hope I didn't scare you too much. If you manage to get all that working, you'll be in a great position to move onto something more complex. Today's computers won't even seem that complex anymore, it will simply be a matter of scale.

    -Restil

    --
    Play with my webcams and lights here
    1. Re:Start small (and simple) by Confuse+Ed · · Score: 2, Informative
      re:
      The first thing you need to do is to understand all the logic gates and how they work, and then work with the various logic gate chips (the 74 series) to get various simple experiments working. This will get you familiar with HOW the circuits are passing information around, as well as give you some experience with wiring the components together in a useful fashion.

      Whilst you're reading up on this you'll probably find that most electronics text books include chapters on computers.

      My personal favourite "The Art of Electronics" by Horowitz and Hill walks you through an example of incorporating a 68008 (I think, I haven't actually got my copy of it available at the moment) into an instrument (ie. specialized rather then general purpose computer) they construct in chapter 11.

      If you want to start off really simple (think more of really simple programable calculator kind of level) then something more along the lines of a PIC 16fxx microcontroller from Microchip is a good starting point, as you can have something up and running very quickly with just a breadboard, the microcontroller and a handful of discrete components (and maybe some LED's for output) using a PC to program the device, and then slowly add to the base design with some external memory, and LCD display, a numeric keypad for input, and so on ...

  13. Re:Don't beat yourself up... by m_evanchik · · Score: 3, Interesting

    I'm all for Microsoft bashing, but this is assinine.

    BG and PA came from privileged backgrounds, but so have plenty of people who didn't manage to build multibillion empires.

    Sure, their family's wealth may have given them an extra cushion (as well as a chance to play with some swell DEC's in high school), but their achievements were on their own in ways that money didn't buy.

    In business, Bill Gates may be an asshole, but he also has a legitimate claim as a pioneer in personal computing. The Gates and Allen did write the first programming language for the first personal computer.

    And Linux Torvalds wrote linux when he had barely a pot to piss in, while living with his mother and sister.

    Money didn't buy any of these people's success.

  14. m68k cpu by StandardDeviant · · Score: 3, Insightful
    This is also a project I've been idly thinking about for a while, simply for the challenge. :-) (So, you're not alone or crazy, heh.) I've been thinking of using an m68k cpu, for a couple of reasons:
    1. It seems like everybody was using them in the mid 80s to early 90s (sun, amiga, macs, next, just off the top of my head). This means that a) they're probably easy to design around, b) they've probably got LOTS of public-domain documentation, and c) they're cheap ;-)
    2. The initial versions of SunOS as well as all the versions of NeXT ran on m68ks, so I know it's possible to run a Unix-like OS on them.
    3. I've been told that m68k assembly is comparatively easy and straight-forward to learn, and I'm going to have to hack at least SOME asm to get an OS going on my theoretical creation.
    4. Did I mention they're cheap? ;-) At maybe five bucks per good chip on ebay, I can afford to fry quite a few of them
    Of course, I'm just a software dude (actually, my formal training is in chemistry, I just sort of fell into programming), so if any hardware people are in the audience hopefully they'll correct any stupid assumptions I've made.
  15. Gates may be good at taking credit for others... by Alex+Belits · · Score: 5, Informative

    ...but it's worth to remember that "standing on the shoulders of giants" applies to anything related to the computing that actually works. One man making a big show out of making, of all things, BASIC interpreter for hardware made by others, doesn't mean that something decent can be built from scratch without serious learning and existing components.

    I have seen second or third-year MIPT (Moscow Institute of Physics and Technology, in Russia) students building 8080 or Z80-based computers in 1987-89, and tweaking a lot of hardware and software in them, but I don't know if that can be really described as "from scratch" -- at that particular place there were two or three dominant base designs, with some simple "OS" written by different people, including a bunch of BASIC interpreters, editors, assembler, etc. (those things were too small to run CP/M). Making those things required mostly knowledge of electronics plus understanding of microprocessors, knowledge of 8080 instruction set, and some programming skills, not necessarily all in one person, and when I studied there I have seen, I think, about one of those things per four-people dorm room. Of course, that was in the FRTK (mostly EE) students' dorm, and at the time the most common computer that we used at the school was a russian clone of PDP-11.

    --
    Contrary to the popular belief, there indeed is no God.
  16. A different starting point - divide and conquer by dpilot · · Score: 3, Insightful

    There are really two issues with what you want to do. First is digital logic and computer design, the second is hardware design and practice. The last word, "practice", is an especially tough nut. One other poster talked of wire-wrapping and messing up 6 connections out of 4000. I would suggest splitting this project into two phases, to be tackled in no particular order.

    One Task: Learn about hardware construction on some simpler projects. Learn by building from working schematics.

    The Other Task: Learn about computer design with simulation. Go get Icarus Verilog. (http://www.icarus.com/eda/verilog/index.html) There are microprocessor netlists available, get one. (Don't have a URL handy.) Learn to simulate it, learn Verilog, (or VHDL) then start designing your own.

    Put the Two Together: Once you know how to work with hardware, and once you have a design that will simulate correctly, start thinking about building it. Besides, this is the way it's done in the Real World. Nobody comes up with a schematic, implement it in hardware, then begin debugging, any more. You don't start to touch hardware until you have a reasonable belief that your design will work, from simulation. Even then, there will still be plenty of room for debug on hardware.

    --
    The living have better things to do than to continue hating the dead.
  17. One book to buy.... by erf · · Score: 3, Informative
    "The Art of Electronics" by Horowitz and Hill and its companion book "Student Manual for the Art of Electronics" by Hayes and Horowitz.

    This will walk you through analog and digital circuit design and construction, and culminates with the building of a 68000 based fully functioning computer with I/O, buses, the works.

    I had the pleasure of taking an electronics course taught by Mr. Hayes, and building your very own computer is fun. It is also time consuming, complicated, and frustrating. You'll also need a moderate amount of equipment such as an oscilloscope, power supply, function generator, DVM, and the like.

  18. Gates and Allen by qurob · · Score: 2, Informative

    Although they DID write BASIC and other language for a ton of machine, they didn't 'build their own computers'.

    You're thinking of Jobs and Woz

  19. Good luck... by cr0sh · · Score: 2

    You will need that, and more (lots and lots of patience, primarily) to pull it off. I am not saying it is impossible, but it will be frustrating.

    First off, read all of the comments here, they contain good advice.

    Second, realise this, which I have rarely seen talked about:

    Computers are nothing more than extremely complex player pianos.

    Honestly. Think of memory as a very long (but non infinite, though it can be considered an endless loop, because when the address register of the machine "rolls over", you start at address zero again) roll of player piano music, the holes representing instructions and data, and the rate at which the computer runs (the clock) the speed at which the roll is moving (tempo?).

    Anyhow, that is all a computer really is - sure, some instructions may say "move to this point on the roll (address)" or "play this note (add this number to this register)" - but all in all, it is the same.

    Most of what computing is today was thought out in mechanical arrangements by Charles Babbage in the 1800's - because computer ARE inherently mechanical (read the book "The Difference Engine" for more).

    Now, this doesn't explain how modern processors work. Modern processors perform some extreme "magic" - but most of what they do isn't that arcane, and you certainly aren't suggesting that you want to build an 1.5 GHz Athlon or something (and you would be insane to try to do that at home).

    One thing to keep in mind is that if you are doing this at home, don't try to go much beyond 2 MHz - otherwise you will drive yourself batty trying to figure out certain problems that only appear when you run at full speed vs single stepping the clock, etc (ie, speeds of signals in the bus not arriving at proper times, etc) - if you are thinking about building such a faster machine without a logic analyzer (I think that is right - kinda like a combo logic probe with multiple inputs and an oscope like trace screen), you will be in for some surprises (read "Soul of a New Machine" for fun in this regard).

    Good luck - and remember to document your progress, and let us know about it!

    --
    Reason is the Path to God - Anon
  20. Re:The road most travelled by lkaos · · Score: 2

    Huh? I suspect you didn't understand the question.

    I don't think you've understood the response :)

    I think was the poster was suggesting is that instead of making a Personal Computer (i.e. a board with PC buses (PCI, AGP, blah, blah) and standard memory interface), build a single-function board such as a PVR or something of that nature.

    Same basic idea of connecting a processor (I personally would recommend a StrongArm) with some memory (just some SDRAM) and then some MPEG encoder/decoder and video decoding chips. Not to mention a tuner (I have not been able to find these very easily though).

    I would have to tend to agree that this is a more sensible approach. There are many single board computer projects (LART immediately comes to mind) but I don't know of an open PVR board project (although there are many commerical PVR boards out there).

    --
    int func(int a);
    func((b += 3, b));
  21. This I understand... by cr0sh · · Score: 2

    Doing this today (or even 10-20 years ago, though 20 years ago would still be rather impressive) isn't something that "intrigues" me - I mean, I have books on building robots (and attendant CPUs) from the mid to late 1970's.

    But this guy was describing building a computer from telephone relay equipment, etc in the 60's! More or less on his own time, in high school!

    I just wonder how often this occurred - I have yet to find an old Popular Science or Popular Mechanics article from the period discussing such projects (ie, homebrew computers from the 1960's) - the closest I have found was a telephone dialer system for an alarm (with complete plans for a rotary telephone), and a later book detailing building a simple calculator based on transistor logic (from the very early 1970's). I haven't found anything on people homebrewing machines in the 1960's from scavenged telephone equipment parts.

    It isn't that I don't believe it impossible - I know full well that people could do this, and knew that at least a few people had done it - but how many? Was any of these efforts documented?

    The closest I have come to "early homebrew computer documentation" was an old stapled, photocopied "pamphlet" from 1975 (I think) detailing how to build a computer "from scratch" - even so, it detailed info on logic circuitry, etc (74xx series), and so wasn't in the era of relay logic.

    I tend to think that some of these people who possibly built such machines might have been technicians who worked on "relay ladder logic" for process control, and came home to build similar systems, but with their own curious designs - but this is just a theory, with no proof in any manner...

    --
    Reason is the Path to God - Anon