Classes/Building an 8-Bit CPU from Scratch

From Pumping Station: One Wiki
Jump to: navigation, search


8-Bit CPU Using Logic Gates
Creator Andrew Vaughan
Date May 27, 2017
Estimated Time 16 Weeks
Estimated Cost $75



In this class, taught by Andrew Vaughan, you will learn how to build a functional (albeit, simple) 8-Bit CPU from scratch using breadboards and TTL Integrated Circuits. No prior electronics experience is required in the class, as the basics are covered in the first lesson. At the end of the course, you will have built a fully-functional, modular CPU, as well as your own personalized Assembly language, that you can extend indefinitely to create more extensive functionality.

Office hours are held before and after each class. The office hours prior to the class (timing of which will be announced with each class) are intended for members who have missed classes and need to catch up on modules for the upcoming lesson. Office hours after each class will provide a list of advanced topics from the lesson plan, which will only be covered if interest is shown. This time is also available to assist with debugging problems in circuits.

Time and Location

Instructor: Andrew Vaughan (Contact information available on user page)
Where: Pumping Station: One Electronics Lab (2nd Floor)
When: TBD
Office Hours: TBD
Minimum Class Size: 2
Maximum Class Size: 8

Prerequisites

There are minimal prerequisites to attend this class. No prior experience in electronics is needed, nor any experience with soldering or computers. It is important that novices attend the first classes, and make use of office hours, to ask questions before continuing on to more advanced topics.

Materials

Components will be group-purchased before each class to ensure proper components are bought, and to keep prices down. As such, the cost of materials can vary, depending on how many people are in class. While some materials are available in the electronics space, such assumptions should be taken with caution. You don't want to miss a class because the component you need isn't available!

Notice
This section is still under development. Please check back later for more information.

Components

The following components are required to build the CPU project. No components are "consumed" by this project, as long as it is built on a breadboard; so, if you so choose, you may reuse these components in future projects. A bulk-purchase option is given to students at the beginning of each class, which serves to reduce costs. The average cost, per-student, when bulk-purchasing all-new components is generally about $TBD. Prices last updated May 31, 2017.

Category Cost
(Individual)
Cost
(Class Rate)
Quantity Component Type Modules Used
Base -- -- 1 22AWG Solid Wire Kit, Various Colors (see below) All
$38.76 $38.76 14 Full-Sized (830-Point) Breadboards All
Resistors $0.80 $0.18 8 470Ω Resistor ¼W, ±5% Tolerance Clock, RAM, Display
$0.90 $0.20 9 1kΩ Resistor ¼W, ±5% Tolerance Bus
$0.80 $0.18 8 10kΩ Resistor ¼W, ±5% Tolerance Clock, Display
$0.20 $0.08 2 100kΩ Resistor ¼W, ±5% Tolerance Bus
$0.10 $0.04 1 1MΩ Resistor ¼W, ±5% Tolerance Clock
$2.48 $2.18 1 1MΩ Potentiometer ½W Clock
Capacitors $0.90 $0.65 6 0.01µF Capacitor Ceramic, ±10% 50V Clock, RAM, Display
$0.36 $0.27 2 0.1µF Capacitor Ceramic, ±10% 50V Clock
$0.75 $0.55 1 1µF Capacitor Conformal Coated, ±10% 35V Clock
Integrated Circuits $1.64 $1.33 4 LM555CN Timer Clock, Display
$1.14 $1.02 1 74LS00 Quad NAND Gate RAM
$3.45 $3.06 5 74LS04 Hex Inverter Clock, RAM, Controller
$1.26 $1.11 2 74LS08 Quad AND Gate Clock, Display
$0.59 $0.59 1 74LS32 Quad OR Gate Clock
$ $ 1 74LS76 Dual JK Flip-Flop Display
$ $ 1 74LS86 Quad XOR Gate ALU
$ $ 1 74LS138 3-to-8 Line Decoder Controller
$ $ 1 74LS139 Dual 2-Line to 4-Line Decoder Display
$ $ 4 74LS157 Quad 2-to-1 Line Data Selector RAM
$ $ 4 74LS161 4-bit Synchronous Binary Counter Program Counter, Controller
$ $ 7 74LS173 4-bit D-Type Register Register, RAM
$ $ 2 74LS189 64-bit Random Access Memory RAM
$ $ 6 74LS245 Octal Bus Transceiver Register, ALU, Ram, Program Counter
$ $ 1 74LS273 Octal D Flip-Flop Display
$ $ 2 74LS283 4-bit Binary Full Adder ALU
$ $ 4 28C16 EEPROM Display, Controller
Switches $ $ 2 Double-Throw Toggle Switch 8mm, DPDT, Latching Clock, RAM
$ $ 2 Momentary Tactile Switch 6mm, Normally-Open Clock, RAM
$ $ 1 8-Position DIP Switch RAM
$ $ 1 4-Position DIP Switch RAM
LEDs $ $ 41 Red LED 3mm, 1.8-2.3V, 20mA Bus, Register, ALU, RAM
$ $ 20 Yellow LED 3mm, 1.8-2.3V, 20mA Register, RAM, Controller
$ $ 11 Green LED 3mm, 2.8-3.6v, 20mA Ram, Program Counter, Controller
$ $ 22 Blue LED 3mm, 2.8-3.6v, 20mA Clock, Register, Controller
$ $ 4 7-Segment Display Common-Cathode, 10-Pin, 2mm Pin Pitch Display

For advanced participants familiar with soldering, StripBoard can be used instead to save space and money (about $30 in savings). Do note, however, that soldering and organization of these boards will not be covered in the class, and if chosen by the student, will need to be managed themselves. Using such boards can also make debugging and modification significantly more time-consuming and difficult. If using StripBoard, ensure that the board's pin pitch is the standard breadboard size of 0.1" (2.54mm).

Wire Color Guide

Wire colors are used for the following, so please ensure any kit you buy contains enough of each. Wire may be available in the Electronics Lab, but gauge and color cannot be guaranteed:

Red Power, Positive
Black Power, Ground
White Signal, Clock
Yellow Signal, Control Logic
Blue Signal, Module-to-Bus
Green Signal, Other (IC-to-IC, Module-to-Module, etc)

Recommended Tools

Most of these tools are available in the space. However, we will need to share them within the group, as well as with others who may be working in the space at the time. Especially in the case of hand tools and multimeters, you may wish to provide your own. Given the simplicity of this project, neither high-end nor high-precision tools are required for this project.

Unless specifically marked, it is recommend that you get your own tools for this project to keep pace with the rest of the class:

Tool Details
Flush Diagonal Cutters Used to cut wire and trim pins flush to a surface. Very useful for any electronics project.
Self-Adjusting Wire Strippers Used to trim the ends of wire sheathing (which we do a lot). Simpler strippers exist, if you wish to save money.
Multimeter
with Standard and Alligator-Clip Probes
Used to measure voltages, amperage, continuity, and generally debug problem circuits. Given the basic nature of this project, a high-precision multimeter is not necessary
Oscilloscope Used to debug and optimize circuits. We will use the Oscilloscopes in the Electronics Lab.

Authorizations

Please read the rules and responsibilities in the Electronics Area prior to attending. Along with these rules, the following authorizations must be completed to be eligible for this course:

Notice
This section is still under development. Please check back later for more information.

Syllabus

Classes are held weekly, and build on top of each other. It is important that all classes are attended, or completing the CPU will be very difficult. Office hours are made available prior to every class to allow persons who miss classes to catch up prior to starting a new lesson.

Prep Session: Electronics Fundamentals

Prior to getting into the course syllabus, an hour-long session will be hosted for anyone who is new to electronics. Nothing needs to be purchased for this class, and there is no maximum for the number of people who may attend. It is not required for someone interested in this prep class to be registered for the following 8-Bit CPU course - it is open to all members every time it is offered.

This course is not required for members already experienced with electronics in order to be successful with the remaining courses in the class.

Topics

By way of introduction into digital electronics, the prep class will dive into certain fundamental knowledge that is necessary for work on any circuit. The following topics will be covered:

  • Basic overview of common components and parts, where they are used, and how they work
  • Basic overview of how circuits work (the Hydraulic Analogy)
  • Alternating-Current (AC) vs. Direct-Current (DC)
  • Different methods of powering circuits on a breadboard
  • Building our first circuit - let there be light!
  • Kerckhoffs's Principle - AKA, how not to light your breadboard on fire
  • Introduction to resistors
  • Introduction to switches
  • The multimeter, measurement, and calculations
    • [P] Power; Watt (KW, W, mW)
    • [I] Amperage; Ampere or Amp (KA, A, mA, μA))
    • [V] Voltage; Volt (KV, V, mV, μV)
    • [R] Resistance; Ohm (MΩ, KΩ, Ω)
  • The Mystery Signal™ - learning how to debug a circuit
  • Introduction to diodes and transistors
  • Introduction to integrated circuits

After the lesson, students will receive an Electronics Cheat Sheet for their reference throughout the rest of the course.

After the Class

Office hours are held for up to an hour after the class concludes. This is an open-forum time period in which questions can be asked and answered. Optionally, students can also choose between these more-advanced topics, if they wish to learn more about the topics from the class' discussion:

  • Ideal components vs. reality
  • The physics behind how Diodes and Transistors work
  • The wide, wide world of components, and choosing the right one for your circuit
  • Different types of switches
  • Different types of resistors

Week 01 - Implementing Logic with Transistors

Notice
This section is still under development. Please check back later for more information.

Week 02 - The CPU Clock Module

Notice
This section is still under development. Please check back later for more information.

Week 03 - The 8-Bit Register Modules

Notice
This section is still under development. Please check back later for more information.

Week 04 - Designing an ALU

Notice
This section is still under development. Please check back later for more information.

Week 05 - The ALU Module

Notice
This section is still under development. Please check back later for more information.

Week 06 - The RAM Module

Notice
This section is still under development. Please check back later for more information.

Week 07 - Building a Binary Counter

Notice
This section is still under development. Please check back later for more information.

Week 08 - The Program Counter Module

Notice
This section is still under development. Please check back later for more information.

Week 09 - Designing for 7-Segment Displays

Notice
This section is still under development. Please check back later for more information.

Week 10 - Introduction to EEPROM

Notice
This section is still under development. Please check back later for more information.


Week 11 - The Display Module

Notice
This section is still under development. Please check back later for more information.

Week 12 - Connecting the Modules with a Bus

Notice
This section is still under development. Please check back later for more information.

Week 13 - Designing Control Signals

Notice
This section is still under development. Please check back later for more information.

Week 14 - Control Logic Module

Notice
This section is still under development. Please check back later for more information.

Week 15 - Programming and Deployment

Notice
This section is still under development. Please check back later for more information.

Completion

Upon completion, each member of the class will have a modularized, extendable CPU. The CPU can be programmed using an Arduino Programmer, which can be borrowed during the class, or built in one of the after-hours office-hours. Here are some examples what can be done to extend and modify the basic circuitry:

  • Create additional circuitry to support more-advanced instructions
  • Add more capabilities to the ALU to enable more-powerful processing
  • Transition 7400-series integrated circuits to more-advanced functionality to reduce circuit complexity
  • Extend the processing capability to 16- or even 32-bit processing
  • Add additional input and output capabilities to the system (e.g., serial controllers, USB, disks, multi-line LCDs, etc...)
  • Building the modules in an FPGA