CHUMP: ICS4U 4-bit TTL Processor Project

 

Given that ACES is an acronym for Advanced Computer Engineering School it seems appropriate to introduce students to just that: building their own computer processor from scratch. As Ken Shirriff reminds us, "Before the microprocessor era, minicomputers built their processors from boards of individual chips." It is highly instructive for ACES to physically manipulate and explore this precise architecture prior to their undergrad years that will demand far less of you.

Ben Eater has an exceptional blog that takes the viewer through the stages of building an 8-bit processor on a breadboard. Furthermore, his website offers the entire parts kit should one choose to take the plunge. As terrific as this is there are two glaring problems with this design for ACES. First, any 8-bit design imposes a time and cost premium of roughly double that of a 4-bit design. Even more problematic is that, Eater's resources are simply too good! As much as he decries the use of kits and PCBs that one simply follows instructions and solders parts to, leaving little struggle and growth for the prospective engineer, Eater's presentation borders on much the same. ACES need to engage a struggle while in high school if they are to grow, personally.

A decade ago I came across a pdf that provided the ideal foundation for our ACES needs and it addresses the two major shortcomings of Eater's 'paint-by-numbers' offering: A Simple and Affordable TTL Processor for the Classroom. D. Feinberg. The beauty of Feinberg's paper lies not within what he tells you, but rather, what he doesn't. You see, it is the gaps in his explanation that provide space for you to actively participate in the development and thereby earning ownership. By engaging these challenges, you gain insight, confidence, and earn a sense of deep satisfaction that you'll remember for a lifetime. So, here we go...

Reference: CHUMP Workbook

Chip # Description Who? Usage
555 Timer ALL Clk: clock source
74LS00 (Digikey) Quad 2-Input NAND ALL NAND: jump bit logic
74LS157 (Digikey) Quad 2/1 Data Selector JG SEL/MUX: select constant/memory
74LS161 (Digikey) 4-Bit Counter (4017ish) HM PC: Program Counter
74LS174 (Digikey) Hex D Flip-Flop JD Addr: next R/W address
74LS181 (ABRA) Arithmetic Logic Unit (ALU) DL ALU: Logic/Arithmetic test if zero
74LS377 (Digikey) Octal (8) D-Type F/F LC Accum: accumulator register
74LS289 (ABRA)
74LS189 (ABRA)
64-bit RAM JC RAM: data storage
AT28C16 (ABRA)
AT28C17
2k x 8 Parallel EEPROM XC Program Code and Control logic

 

CHUMP Task Sequence

You are about to embark on a hardware project that holds the promise of being one of the most important achievements of your young scholastic career, that is, to build a 4-bit computer from scratch. Reaching the summit will test your passion, dedication, and commitment to an engineering undergraduate program. D. Raymond and J. Corley accomplished the feat in their 2018/2019 ICS4U year:

https://www.youtube.com/embed/vZ13xud0qBc

 

 

  1. Code. With reference to the CHUMP Instruction Set, develop and submit a unique and (somewhat) interesting CHUMP program (presented in the manner below) as your first DER entry in your CHUMP Report. Your goal will be to demonstrate that the program you write this week, will run on the processor you build six weeks from now.

  2. Clock. Following Ben Eater's terrific 4-part video series on the 555-based Clock module, build, test and report on your own module. This will be the heartbeat of your CHUMP. For this project you MUST use the following parts I supply you with: Quad breadboard, 500 kΩ trim pot, rectangular LEDs (red, green, yellow), 3×555 timers, strip of 0.1μF caps, TTL AND, OR, NOT logic ICs, slide switch, and bags of 0.3" and 0.4" preformed jumper wires. Please take great care with these parts; they are not replaceable. Power can come from a 5V AC/DC adapter or your Arduino for the time being. Finally, for both your text and video presentations, strive to be as clear, concise, and detailed as Eater has been in his presentation, even going one better than him with a video that is under 3 minutes:)

  3. Program Counter. In this Stage, you are expected to complete your wiring to your clock, the SN74LS161 counter and the NAND logic to provide eventual support for the counter's LOAD feature. Four rectangular LEDs on the output pins of the Program Counter will confirm your counter is advancing on the RISING edge of the clock signal. So,
  4. Program EEPROM. In this Stage you confirm, through rectangular LEDs, that stored machine language versions of Feinberg's sample CHUMPanese code (Feinberg.BIN) and the code you wrote in Stage 1 have been successfully flashed onto your AT28C16/AT28C17 Program EEPROM IC. Additionally, as a replacement for the complex combinational logic circuitry that would provide dynamic control for our processor's various modules and to provide storage for the machine language version of our program, we'll (eventually) need to flash a set of (as yet undiscussed) control codes on the second Control EEPROM. We have up to three strategies for flashing our EEPROMs,
    1. The use of your (Windows-based) TL866 II EEPROM Programmer that you have been provided with, or,
    2. After viewing Eater's two (incredible) videos, wire your MCU of choice into an EEPROM on a breadboard (see below), create the programmer sketch, and flash your code from Stage 1 into the AT28C17 EEPROM. Here's my version (echoes to a shift register/bargraph), or,
    3. Exploit the use of the, as yet untested, RSGC ACES EEPROM Burner Shield.

    Now, once your Program EEPROM has been successfully flashed,

    ACES' EEPROM Enhancement. A further interesting application of the EEPROM ICs is the support it can provide for a dual 7-segment display of the hexadecimal machine codes for your CHUMPanese program. Similar to the 4511 BCD decoder IC you used in the Grade 10 counting circuit, the EEPROMs replace the required combinational logic. In the image below (click for video) two AT28C16 EEPROMs (OP code and OPerand) were flashed with the same 16 single-digit maps of the digits from 0 to F. A ROHM LB-602MK2 dual display accepted the output from each of the EEPROMs. The video reflects the machine code from Feinberg's sample above: 82 10 21 62 A0...repeat

  5. Arithmetic and Logic Unit (ALU). Assemble, test, and report on the SN74LS181 ALU Module. This is one STRANGE IC as can be seen in these seemingly contradictory references. This stage represents the final independent exploratory module before we attempt to build our entire processor. Using the components you have been provided with (additional breadboard, 3" coloured jumper wires, SN74LS181, bargraph and 270 Ω bussed resistor network) and employing ACTIVE HIGH logic, wire up an ALU circuit that can be used to explore the 32 functions (16 logic and 16 arithmetic) the IC is capable of performing. For this submission only, arrange your circuit so that it closely matches the diagram below. (SN74LS181N.fzz) Note. If you're using Fritzing for your processor the generic IC component is probably your best bet. The inspector allow you to edit some characteristics. Finally, make a sincere effort to lay our your board with care and consideration so that your ALU video is clear, informative, and compelling to view.

     

  6. After stripping everything from your CHUMP platform with the exception of your FULL Eater-style clock circuit, add the ICs you were supplied with in class in a layout similar to the graphic to the right. There is no need to wire them ALL this week, In this segment, you are expected to limit your wiring to your clock, the SN74LS161 counter and your AT28C16 Program EEPROM that you flashed last weekend. Eight rectangular LEDs on the output pins of the Program EEPROM will confirm your program is loaded and ready for execution in the next phase. So, IN THIS ORDER,
    Focus of the Program Counter Stage Feinberg's Sample Code
  7. IC (Optional). This stage requires that you introduce your peers to the specific CHUMP IC that you have been assigned (above) in the form of a clear and detailed 5-minute in class presentation. After which, over the course of the next few weeks, as questions arise from your classmates about your IC you will be required to provide answers and possible solutions. A fourth entry in your DER's CHUMP Report will summarize your presentation.
  8. Control EEPROM. Your second AT28C16 EEPROM is to have the Control codes indicated in the table (below, right) flashed onto it. Here is the link to the Shield Burner Code: EEPROM Shield Burner Code. Insert the IC into your platform. After our group review of the bits in each code, strategically reposition the IC, if necessary.
  9. Processor. Ok, here we go...After serious planning and layout considerations, using the TTL chipset described above, lengths of colour-coordinated hookup wire and rectangular LEDs available to you to, position all your processor's ICs and wire up the rest of your CHUMP.
    D. Raymond's CHUMP Build CHUMP Control EEPROM Table

  10. Code (Revisited). As is fitting, your CHUMP marathon concludes by revisting its starting point. Weeks ago you were asked to write software for a hardware device you had not constructed. In this final stage you asked to flash the code you commited to at the beginning of this project onto your Program EEPROM and demonstrate its execution on your processor. Include the code again in your DER, noting any minor modifications required to account for details you may have overlooked or had been unaware of. Be sure to include coverage of this executing software in your summary video.
  11. Congratulations on achieving this memorable outcome.

Related

References

 

Jackson Russett's EEPROM Programmer Shield (Rollover):

 

Links