Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼

Al Williams

Dr. Dobb's Bloggers

Educational CPUs

July 01, 2011

I'm always a bit frustrated that there isn't more FPGA CPU design going on in the classroom. Don't get me wrong. There is certainly some, but given how inexpensive FPGA hardware is now, I think learning about CPUs in this context is a great thing. First, it gives you great confidence in your ability to work with FPGAs. But even if you don't do much with FPGAs ever again, it also gives you a deep insight into how CPUs work and I think there is great value in that.

There are two major problems. First, you have to have a CPU (or at least a part of one) that can be reasonably done in the classroom setting. It has to be simple enough to fit the time allotted. The other problem is building something with a reasonable toolset. Again, this is a matter of having the time to do it.

It would be easy to imagine a sequence of courses where you build a CPU, then you build an assembler, then you port GCC over to your new architecture. I haven't seen anything that comprehensive and there are always logistic problems with that kind of class anyway. So you can build a toy CPU with no real tools, or copy an existing (and probably copyrighted) CPU and use tools meant for it. If you browse http://opencores.org you'll see both approaches.

My Blue CPU,for example, has its own little assembler, but nothing special. The MCPU is very tiny and will fit on a CPLD but also lacks real tools and isn't very representative as an example. But many other CPUs appear to be PICs, AVRs, 8051, or x86s. Tools for these CPUs are abundant, including C compilers.

Legal issues aside, though, both of these choices present another problem. Very few commercial CPUs document their instruction set architecture from the CPU designer's point of view. They usually have a programmer in mind.

I've never seen anyone actually try this, but it has always been an idea in the back of my mind that the MIL-STD-1750A CPU would be ideal for teaching a class like this. You are probably either thinking "The what?" or "Dummy. That thing's out of date."

Let me address the first question first. Some time back, the U.S. Air Force decided that it could reduce the cost of developing embedded systems if it specified a common CPU. The military in general thought it was a good idea and MIL-STD-1750A was born. In addition to military use, the CPU found a home in NASA projects, European Space Agency projects, and other places.

As for the second question, well it is out of date. In 1996 the military declared the standard inactive, although Wikipedia says it is still in use in India and China. Yes, it is 16-bit but that means it fits easier in a smaller FPGA. Current GCC builds do not support 1750A, but version 3.1 and earlier do.

You can find a lot of info at http://is.gd/kPuujU, including a simulator, a C compiler, and the original specification. If I were making this a class project, I'd probably skip the floating point and the memory manager, but that should be harmless. I do know that Mississippi State University (a school I attended for awhile) did a VHDL 1750A CPU, but I couldn't find the files anywhere on the Internet.

Granted, the 1750A is an older style of architecture and isn't terribly practical. Depending on the goals you have for a class, there might be better choices. What CPUs have you seen used in an educational context? How did it work out? Leave a comment and let me know.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.