Project 3: A Simple Computer. Course: CS 354 Posting Date: January 22, 2001 Due Date: May 7, 2001 Builds On: Project 2 Use: Your favorite digital simulator. Those who do not use Digital Works 2.0 will have to arrange to demonstrate their circuits on a computer with their digital simulator installed. Background: Description: Now that you have had practice building circuits with a digital simulator, it is time to build something really interesting, a significant part of a simple computer. You will learn something very basic and important about computer architecture, how to assemble the sequential and combinational circuits you already know into registers, instruction decoders and an ALU. (Alas, time does not permit us to deal with the memory system and four phase system clock.) You will also learn (or reinforce) some very important lessons about oral presentations. In your future professional career, you will often have to present your ideas to an audience, and now is the time to begin learning how. In project 2, you used a digital simulator to build a simple 4 bit ALU which does ADDITION, SUBTRACTION, and bitwise AND and OR. In this project, you will construct a simple 4 bit CPU by adding registers and a simple data bus to your ALU. In detail, the steps you need to follow are: (1) Construct a 4 bit register from 4 edge triggered D latches with a common clock line. (2) Complete your 4 bit CPU by wiring an ALU and two 4 bit registers together with a 4 bit data bus. Data will be routed around the bus by three 4 bit muxes. Your completed CPU will look like this: Data X | ------------------------------------------- | | | /4 /4 | | | | v v | ----------- | Sl-DA -->| D/A Mux | | ----------- ----------| | | | /4 /4 | | | | v v | --------- -------- --------- | Ld-B -->| Reg B | | Zero | Ld-A -->| Reg A | | --------- -------- --------- | | | | | /4 /4 /4 | | | | | --- ------------------------ --- | | | | | | v v v v | ----------- ----------- | Sl-BZ -->| B/Z Mux | Sl-AZ -->| A/Z Mux | | ----------- ----------- | | 4 4 | | ----/---- ----/---- | | | | v v | 3 ------------------- | ALU-Control ---/---->| 4 bit ALU | | ------------------- | | | \4 | | | --------------------------------- The control lines and corresponding functions for your CPU are line function ------- ---------- Ld-A load the A register. Ld-B load the B register. Sl-DA select Data X or ALU output as input to Register B. Sl-AZ select Register A or Zero as input to the ALU. Sl-BZ select Register B or Zero as input to the ALU. ALU-Control select ALU operation (3 control lines). Data X consists of 4 switches for toggling input into Register B. Zero consists of 4 switches permanently set to 0. All control lines should have switches attached at the ends so you can set them. The Ld-A and Ld-B lines are attached to the clock lines for Registers A and B. (Warning: DO NOT ATTACH A SYSTEM CLOCK. Instead, toggle the Ld-A and Ld-B lines as needed.) The Sl-DA, Sl-AZ and Sl-BZ lines are connected to the selection lines for the 4 bit muxes. Here is how to carry out some sample operations with your CPU: (1) Load Register B with data: Set the Data X switches accordingly, set the Sl-DA line to Data X, and toggle the Ld-B line. (2) Move the contents of Register B to Register A: Set the Sl-DA line to ALU, set the Sl-AZ line to Zero, set the Sl-BZ line to B, set the ALU-Control lines to ADD, and toggle the Ld-A line. (3) Move the contents of Register A to Register B: Set the Sl-DA line to ALU, set the Sl-AZ line to A, Sl-BZ line to Zero, set the ALU-Control lines to ADD, and toggle the Ld-B line. (4) Add the contents of Registers A and B and store the result in Register A: Set the Sl-DA line to ALU, set the Sl-AZ line to A, set the Sl-BZ line to B, set the ALU-Control lines to ADD, and toggle the Ld-A line. (5) Add the contents of Registers A and B and store the result in Register B: Same as (4), except you toggle the Ld-B line instead. Detailed Specifications: (1) You may work on this project individually or in teams of two. (2) You MUST use hierarchical design appropriately. (3) You must hand in a typed and stapled project report containing (a) A title page with YOUR NAMES on it, plus project title (eg. A 4 Bit CPU), date, course number (Computer Science 354), and design software used (eg. Digital Works 2.0, or the name of the digital simulator you used if different). (b) A typed description of your project written in proper English. (c) Drawings, either produced by software or NEATLY drawn by hand using a template, of circuit diagrams at the gate level for all basic components, such as a Full Adder and 1 bit 2 to 1 Mux. Your drawings MUST have titles and accompanying English text sufficient for understanding, and you MUST label all input and output lines. (d) Drawings, either produced by software or NEATLY drawn by hand using a template, of circuit diagrams at the block level for all higher level components, such as the 4 bit ALU and the CPU itself. (Note: Sometimes, block level diagrams include a few individual gates.) The same labeling and English documentation rules as in (c) apply. (4) You must hand in a copy of your digital simulator project files on a 3.5" floppy disk. Your disk must have a paper label WITH YOUR NAMES ON IT. (5) Your project report and disk must be handed in IN A FOLDER, the kind with pockets so your report and disk don't fall out. Your folder MUST HAVE YOUR NAMES ON IT. (6) You must demonstrate your project to me during the last week of classes or exam week, each team will demonstrate their project to me. (There will be a signup sheet for demo times.) Your project grade will depend on the quality of your demonstration as well as your project report. You are to pretend that I am your boss at Fly By Night Electronics. You have been working on the MK I Computer, which you have, through diligent work, brought to the early prototype stage. You want Fly By Night to invest valuable company resources in the further development of the MK I. Your demonstration is supposed to sell me, AND MY BOSS, on the idea. Above all, you do not want to make me look bad in front of my boss, so you cannot afford to fumble around as you carry out your demonstration. So BE WELL PREPARED. A typical demonstration will consist of a digital simulator tour through the components of the project, culminating in a demonstration that your project actually works. You will have to explain things orally to me as you go along. I will ask questions, but you cannot depend on me to guide you through your demo by asking. You must prepare a suitable presentation, and know what you are going to show or demonstrate next. Stumbling costs you points, so be prepared. Not knowing what input terminal is what costs you points, so label your terminals. Demonstrations will take place during the last week of class.