19

I've been reading about the fundamentals of computer architecture, but I think I could get a better grasp of the basics if I could could have an actual device to play with.

I had considered building a 2- or 4-bit device on a breadboard with "switches and blinky lights," but I think that a ready-made machine that I can interact with, code/decode, and disassemble/reassemble might be a better place for me to start.

Would a retro-computer, say from the the 70's or 80's, be good for this purpose?

FYI, I've been considering an original Apple II for many reasons, including its hobbyist-friendly design, a wealth of documentation, and a fondness for its main inventor, Steve Wozniak. But after seeing the high price of them on eBay, I'm considering other systems too.

2
  • 1
    An old IBM PC clone should be cheaper, but if you're serious about learning about computer architecture you'd be better off with something like an Arduino or maybe a Raspberry Pi. The former is a ready-made 8-bit device that you can connect switches and blinky lights to, while the later is a 32-bit one.
    – user722
    Commented May 9, 2017 at 21:06
  • 1
    @RossRidge Both an old PC and (even more so) an RPi are (IMHO) already more complicated than they need to be to understand computer architecture. I do agree with Arduino to start from, but this has a quite exotic Harvard architecture. Something simple like a ZX81 or a ZX Spectrum would be ideal IMHO.
    – tofro
    Commented May 10, 2017 at 6:40

5 Answers 5

16

The main benefit for learning computer system architecture with a retrocomputer, compared to a modern computer, is accessibility of the hardware. Retrocomputers are much simpler than modern systems in terms of both the hardware and the system software. By design and necessity, programming on a retrocomputer means often programming the bare metal, and that means understanding how the machine works in exquisite detail. At the same time, you get the aid of a big software library (often including a built-in BASIC interpreter) that shows off what's possible with the hardware, plus a fully self-contained environment to program in, plus a simple hardware architecture that can easily support hardware hacking too.

The commenter above makes a very valid point about Arduino, which also is designed for this sort of bare metal software hacking and building your own hardware add-ons. I think the thing you would miss out on is the fascinating history of the retrocomputers, and the fact that they are normally far more sophisticated than just the CPU+GPIO that you get with Arduino. Many retrocomputers have unique and powerful coprocessors for sound and graphics. At minimum, they all support basic peripherals like keyboard, mouse/joystick, and video display. You'd have to attach some primitive proxy for these I/O device to Arduino to make it a full, self-contained computer system that you can program or use stand-alone. Then again, for programming efficiency, having something tethering you to a modern device can be very helpful. And that is possible to do and equally easy with either Arduino or a retrocomputer.

The original Apple ][ is an expensive retrocomputer because it is rather rare and collectible. But you can acquire an Apple //e, //c, or IIgs for a much more reasonable price. Of all of these, the IIgs is the most sophisticated and probably offers the most long-term hacking potential. But you could get very far "down the rabbit hole" with any of them. And, I also think you'd be happy with other popular 1980s 8-bit machine like Commodore, Atari, IBM 5150, or Tandy (showing my North American persuasion). Regardless, be sure to get a machine that comes with or can be adapted to a video display that you have available, and also investigate the supported hobbyists projects that will help you move files and disk images between the modern world and your retrocomputer of choice.

3
  • 1
    A workable disk-based file system is absolutely essential, unless the OP wants this to turn into an exercise in frustration. The base level would be a working floppy drive - but only if you have disks for it! A hard disk (as in the early PCs) is much better, even if its capacity is only a few Mb, not Gb. If the only file storage is on cassette tape, don't even think about trying to do this - it's far too slow and error-prone.
    – alephzero
    Commented May 10, 2017 at 3:40
  • 1
    Most retrocomputers are easily tethered to a "remote file system" on a modern PC using some form of serial communication, or you can use modern flash devices to move between modern machines and a "floppy emulator". Floppy systems can be used, of course, but are neither essential nor the easiest way.
    – Brian H
    Commented May 10, 2017 at 13:22
  • I must say that the power of retro home computers of 70ies and 80ies is now comparable to the power of contemporary 8bit microcontrollers like, for example, AVR family. Saying 'power', I mean approximately the things like amount of ROM and RAM, CPU functioning principles, CPU speed. So I'd say that both retro machines and contemporary 8bit MCUs fit for the purpose of computer architecture fundamentals. Of course I'd prefer playing with MCUs down from assembly language level and not arduinish 'black box' style.
    – lvd
    Commented May 10, 2017 at 19:55
6

I would say the answer to the question is no.There are two reasons for this.

Firstly, a retro computer is still a box with a circuit board in it and some chips soldered to it. Actually looking at its insides isn't going to leave you any more the wiser than looking at the insides of a modern desktop PC.

Secondly retro computers - well, 1970s and 80s era microcomputers won't teach you very much about computer architecture generally because they tend to be extremely crude machines. You could understand a Commodore PET's internal workings in a great deal of detail (and I do, having written an emulator) but it won't tell you anything about virtual memory, caching, multithreading, pipelines and any one of the many concepts that were omitted from it thanks to the extreme cost of adding them to a micro computer of the time.

The best way to understand a particular computer's architecture is to write (or build, if you are competent at electronics) an emulator for that computer. If you just want to understand how computers work generally, may I recommend a book: The Elements of Computing Systems: Building a Modern Computer from First Principles by Noam Nisan. It walks you through building a software emulation of a 16 bit computer from the basic TTL gates upwards. It does suffer a little from my second criticism in that it stops before you get to a discussion on things like virtual memory and it also incorrectly describes the architecture you build as a Von Neuman machine rather than what it is which is Harvard architecture.

Another useful exercise is to try to write answers for questions on here about computer architecture (you don't have to actually submit them if you are not confident). For example, researching this question or this one, will tell you a lot about how virtual memory management works in a lot of machines.

8
  • Er, virtual memory, caching, multithreading and pipelines were all available in the BBC Micro. As they are mostly software techniques they didn't cost a great deal to add.
    – Chenmunka
    Commented May 10, 2017 at 14:41
  • 4
    No they were not available on the BBC micro. It had a 6502 in it which had no virtual memory capabilities and the 6502 also didn't really have a pipeline beyond maybe fetching the next instruction while cleaning up after the last one.
    – JeremyP
    Commented May 10, 2017 at 15:07
  • VM was not available in the processor hardware, but could be added in software and often was. It is true that instruction pipelines, which the 6502 of course doesn't have, could not be replicated in software.
    – Chenmunka
    Commented May 10, 2017 at 15:17
  • No. You need hardware support for virtual memory because you need some sort of address translation mechanism and also a means to detect and recover from address bus errors.
    – JeremyP
    Commented May 10, 2017 at 15:25
  • 4
    Well, there must be steps. First you learn how simple CPUs and computers work, then go further to the OS level with all multitasking and VM stuff.
    – lvd
    Commented May 10, 2017 at 19:51
5

Yes and No.

Yes, retro computers can be useful to learn how a computer works (what components you need for a system to be useful, and how those components are connected together), but "Computer Architecture" as a topic requires you to understand many ways that systems may be put together and the pros and cons of each, and learning how any one retro computer works isn't an efficient way to reach that goal.

If you want to pursue this anyway, look for a system that supports processor and memory upgrades, as well as upgrading from slower disk systems to faster disk systems. Start with the minimum configuration and upgrade parts as you hit performance/resource limits so that you can see how upgrades don't really fix performance issues as much as they move system bottlenecks to a different part of the system. Unfortunately the best systems for this kind of thing aren't so easy to find nowadays (and parts you can use for upgrades even less so).

4
  • Ken: Which systems would fall under your classification as the "best?" Maybe I could get lucky and find one. :-)
    – EJ Mak
    Commented May 10, 2017 at 14:28
  • 2
    a PDP-8 or PDP-11 minicomputer was my first thought as "best" because they have simple designs and were meant to be easy to interface to. But those machines are far too rare nowadays to play with in that way. an original IBM PC, or a 486 clone, may be the best options now. these are significantly more complex designs, but at heart you can still learn something about I/O versus memory bottlenecks by doing CPU/memory upgrades or upgrading to a faster disk controller.
    – Ken Gober
    Commented May 10, 2017 at 17:59
  • 2
    @EJ Mak thinking about this further, an S-100 based system might also be an excellent choice, if you can get ahold of one (and that's a big if). It's common in S-100 systems to have the CPU on one card, memory on another (or several) and a separate controller card for each peripheral.
    – Ken Gober
    Commented May 11, 2017 at 12:56
  • @KenGober - there are a number of hobbyists who periodically produce new S-100 cards in small batches, so you can generally get enough components to build a new S-100 system if you want. See, for example, the list at retrobrewcomputers.org/doku.php?id=boardinventory
    – Jules
    Commented Jan 6, 2018 at 6:52
3

Yes, and countering the "still a black box" argument.

Hardware on the level of the original IBM-PC or AT is accessible as an electronic system to someone with "some" electronics skills and affordable tools: Connection points are big enough that they can be accessed with logic or oscilloscope probes. Most signalling is slow enough that probing it with test equipment will not create an RF mismatch so severe that the machine will crash. Most chip-to-chip I/O protocols follow the /CS, /WE, Address, Data scheme, and signals are "literal" - a presence of voltage on a data line means a data bit of 1. Faster, more modern hardware interfaces like SDRAM and DDR, USB, PCI-express, Ethernet tend to use complex encodings that also often do not allow you to interpret a logic state of a line "in isolation", data is mixed with status, synchronization, error correcting, housekeeping protocols on one wire (RS-232 serial had some of that, but in a MUCH simpler fashion, and still making it very evident what was data and what was metadata).

Measuring anything in the data paths of modern computers would mean using equipment that even as used surplus will cost hundreds to tens of thousands AND will be difficult to connect and use.

Also, most signalling used one common specification how voltages and currents were to be interpreted, often 5V TTL levels. There will be a couple of different physical layer protocols on a modern PC mainboard.

If you print a few lines of the letter "A" to a text-mode printer connected to a centronics printer and connected LEDs (in practice, use a buffer to do so!) to the 8 data wires on the parallel cable, you would see data lines 0 and 6 flash up a lot, any others staying nearly dark: 01000001 is the binary representation of ASCII "A".

The parallel port could thusly also be used to connect simple, customized real world hardware (eg to control machinery) that could be made from perfectly generic parts (literally from discrete transistors) - Doing that with USB without using some USB-specific parts would be very difficult.

From a software side, a programmer could literally take the datasheet (with programming documentation) of some I/O chip and go for it, without interacting with an abstracted device driver.

2
  • +1. Anything up to and including systems based on 16-bit ISA are likely to be accessible to an interested hobbyist. Playing with older PCs at a hardware level can be very enlightening. Or just about anything that was built to enable third party expansions, so stuff like the Sinclair Spectrum, or older systems like the TRS-80, can be a good starting point too.
    – Jules
    Commented Jan 6, 2018 at 7:10
  • 1
    Logic analyzers have become very cheap over the last few years. While the cheap units I've seen wouldn't have enough pins to capture a full address or data bus, they'd have no trouble keeping up with the speed of an 8088 or first generation 80286 computer.
    – supercat
    Commented Oct 8, 2018 at 16:17
1

YES.

Well, I've grown up with the 8-bit Z80 machines, built a few hardware projects back then. The basic ideas what a CPU does are still valid even after 40 years, and many contemporary programmers lack that understanding.

So you're very welcome to learn the machine level of computing.

The old processors are good for learning the basics because they show you explicitly at their external pins what they are doing right now. A Z80 has 8 data bit pins and 16 address bit pins, and for every single read or write access that your assembly-language program does, you see the activity on these pins (plus the supporting control pins).

One manual was enough for the complete specification of a CPU, e.g. found at http://hartetechnologies.com/manuals/Zilog/Zilog_Z80_Technical_Manual.PDF

A typical step when booting up a new Z80 board design for the first time was to insert a ROM with the bytes C3, 00, 00 (meaning Jump to address 0000) at the addresses 0000 to 0002. This was expected to send the machine into an endless loop, repeatedly reading this Jump instruction. And you could easily see the expected memory read cycles using an oscilloscope. The Z80 manual told you exactly what this loop was expected to do:

  • read the first byte (opcode C3) from address 0000 using a 4-clock M1 cycle

  • read the lower half of the target address (00) from address 0001 using a 3-clock M2 cycle

  • read the upper half of the target address (00) from address 0002 using a 3-clock M2 cycle

So the loop was to complete within exactly 10 clock cycles (if memory was fast enough, which was always true as far as I remember).

Modern CPUs have multiple cores, internal caches, out-of-order execution, opcode translation and many more features that make them as lightning-fast as they are, compared to a Z80. But they lack the possibility to see the processor working: our Jump-to-Zero loop would be read from memory once and then executed from the internal cache, totally invisible at the outside pins.

So if you're ready to spend some time, then building your own computer from the chips can be both fun and give you a deep insight into processing at the machine level.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .