6.004 Computation Structures Spring 2009



Similar documents
FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Gates, Circuits, and Boolean Algebra

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

Decimal Number (base 10) Binary Number (base 2)

Design and Development of Virtual Instrument (VI) Modules for an Introductory Digital Logic Course

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

The 104 Duke_ACC Machine

Digital Electronics Detailed Outline

Lab 1: Full Adder 0.0

CHAPTER 11: Flip Flops

CMOS Binary Full Adder

Binary Adders: Half Adders and Full Adders

VHDL Test Bench Tutorial

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Two's Complement Adder/Subtractor Lab L03

CHAPTER 3 Boolean Algebra and Digital Logic

Step Response of RC Circuits

RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Multiplexers Two Types + Verilog

After opening the Programs> Xilinx ISE 8.1i > Project Navigator, you will come to this screen as start-up.

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

CSE140 Homework #7 - Solution

Sistemas Digitais I LESI - 2º ano

COMBINATIONAL CIRCUITS

Laboratory 4: Feedback and Compensation

Using Logic to Design Computer Components

Lecture 5: Gate Logic Logic Optimization

Building Blocks for Digital Design

ELEC EXPERIMENT 1 Basic Digital Logic Circuits

The components. E3: Digital electronics. Goals:

Memory Elements. Combinational logic cannot remember

Upon completion of unit 1.1, students will be able to

Three-Phase Dual-Rail Pre-Charge Logic

Figure 8-1 Four Possible Results of Adding Two Bits

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Design of Low Power One-Bit Hybrid-CMOS Full Adder Cells

Module 3: Floyd, Digital Fundamental

Flip-Flops, Registers, Counters, and a Simple Processor

DEPARTMENT OF INFORMATION TECHNLOGY

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

EXPERIMENT 8. Flip-Flops and Sequential Circuits

LAB4: Audio Synthesizer

Content Map For Career & Technology

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

Contents COUNTER. Unit III- Counters

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Chapter 10 Advanced CMOS Circuits

Fundamentals of Digital Electronics

The enable pin needs to be high for data to be fed to the outputs Q and Q bar.

LAB 7 MOSFET CHARACTERISTICS AND APPLICATIONS

Op-Amp Simulation EE/CS 5720/6720. Read Chapter 5 in Johns & Martin before you begin this assignment.

Lecture #21 April 2, 2004 Relays and Adder/Subtractors

Counters and Decoders

2.0 Chapter Overview. 2.1 Boolean Algebra

Sequential 4-bit Adder Design Report

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

BINARY CODED DECIMAL: B.C.D.

Karnaugh Maps (K-map) Alternate representation of a truth table

3.Basic Gate Combinations

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

RAM & ROM Based Digital Design. ECE 152A Winter 2012

Lecture 8: Synchronous Digital Systems

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell.

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Electronic Circuits Spring 2007

Document Contents Introduction Layout Extraction with Parasitic Capacitances Timing Analysis DC Analysis

MAS.836 HOW TO BIAS AN OP-AMP

A Lesson on Digital Clocks, One Shots and Counters

Computer Aided Design of Home Medical Alert System

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Interfacing To Alphanumeric Displays

Fault Modeling. Why model faults? Some real defects in VLSI and PCB Common fault models Stuck-at faults. Transistor faults Summary

Hands On ECG. Sean Hubber and Crystal Lu

A Lesson on Digital Clocks, One Shots and Counters

Logic in Computer Science: Logic Gates

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

Lecture N -1- PHYS Microcontrollers

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Jianjian Song LogicWorks 4 Tutorials (5/15/03) Page 1 of 14

Sequential Logic: Clocks, Registers, etc.

ASYNCHRONOUS COUNTERS

PSPICE TUTORIAL (BASIC)

Switch Mode Power Supply Topologies

International Journal of Electronics and Computer Science Engineering 1482

Gate Delay Model. Estimating Delays. Effort Delay. Gate Delay. Computing Logical Effort. Logical Effort

DM Segment Decoder/Driver/Latch with Constant Current Source Outputs

CD4008BM CD4008BC 4-Bit Full Adder

Lab 1: Introduction to PSpice

Designing Digital Circuits a modern approach. Jonathan Turner

CS311 Lecture: Sequential Circuits

DEGREE: Bachelor in Biomedical Engineering YEAR: 2 TERM: 2 WEEKLY PLANNING

e.g. τ = 12 ps in 180nm, 40 ps in 0.6 µm Delay has two components where, f = Effort Delay (stage effort)= gh p =Parasitic Delay

Transcription:

MIT OpenCourseWare http://ocw.mit.edu 6.004 Computation Structures Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 6.004 Computation Structures Lab #2 Your mission this week is to design and test a CMOS circuit that performs addition on two unsigned 4-bit numbers, producing a 5-bit result: A0 A1 A2 A3 B0 B1 B2 B3 ADD S0 S1 S2 S3 S4 When you ve completed and tested your design, you can ask JSim to send your circuit to the online assignment system using the process described at the end of Lab #1. The checkoff file for Lab #2 (lab2checkoff.jsim) checks that your circuit has the right functionality; the on-line system will give you 5 points for checking off your lab using this file. (You ll receive your points after completing the on-line questions and a checkoff meeting with a TA.) Note: Our ability to provide automated checkoffs is predicated on trusting that you ll use the checkoff and library files as given. Since these files are included in your submission, we will be checking to see if these files have been used as intended. Submittals that include modified checkoff or library files will be regarded as a serious breach of our trust and will be dealt with accordingly. Some suggestions on how to proceed: Å Let s start with a simple ripple-carry adder based on the full-adder module discussed in lecture. Later we ll discuss higher performance adder architectures you can use in the implementation of the Beta (the computer central processing unit we ll be designing in later labs). The full adder module has 3 inputs (A, B and C i ) and 2 outputs (S and C o ). The logic equations and truth table for S and C o are shown below. S = A B C in C o = A B + A C in + B C in 6.004 Computation Structures - 1 - Lab #2

Typically S is implemented using two cascaded 2-input XOR gates. One can use three 2-input NANDs and one 3-input NAND to implement C o (remember that by Demorgan s Law two cascaded NANDs is logically equivalent to a cascade of AND/OR). The module performs the addition of two one-bit inputs (A and B) incorporating the carry in from the previous stage (C i ). The result appears on the S output and a carry (C o ) is generated for the next stage. A possible schematic for the 4-bit adder is shown below: A 3 B 3 A 2 B 2 A 1 B 1 A 0 B 0 0 S 4 S 3 S 2 S 1 S 0 Å Since we re using individual gates to implement the logic, a good place to start is to build your own gate library (e.g., inverter, 2-input NAND, 2-input NOR, 2-input XOR), test them individually, and then use them to implement your design. It s much easier to debug your circuit module-by-module rather than as one big lump. XOR/XNOR can be challenging gates to design; here s one suggestion for how they might be implemented: 6.004 Computation Structures - 2 - Lab #2

Å You can use voltage sources with either a pulse or piece-wise linear waveforms to generate test signals for your circuit (see Lab #1 for details). Another source of test waveforms is the file /mit/6.004/jsim/8clocks.jsim which can be included in your netlist. It provides eight different square waves (50% duty cycle) with different periods: clk1 clk2 clk3 clk4 clk5 clk6 clk7 clk8 period = 10ns period = 20ns period = 40ns period = 80ns period = 160ns period = 320ns period = 640ns period = 1280ns For example, to completely test all possible input combinations for a 2-input gate, you could connect clk1 and clk2 to the two inputs and simulate for 20ns. Å Interpreting analog signal levels as logic values can be tedious. JSim will do it for you automatically if you ask to plot L(a) instead of just a. The logic-high and logic-thresholds are determined by the vih and vil options:.options vih=2.6 vil=0.6 Initial values are specified in /mit/6.004/jsim/nominal.jsim, but you can respecify them in your own netlist. Voltages between vil and vih are displayed as a filled-in rectangle to indicate that the logic value cannot be determined. For example: A vih vil L(A) 6.004 Computation Structures - 3 - Lab #2

You can also ask for the values of a set of signals to be displayed as a bus, e.g., L(a3,a2,a1,a0). The signals should be listed most-significant bit first. A bus waveform is displayed as a filled-rectangle if any of the component signals has an invalid logic level or as a hexadecimal value otherwise. In the following plot the four signals a3, a2, a1 and a0 are interpreted as a 4-bit integer where the high-order bit (a3) is making a 1 0 transition. The filledin rectangle represents the period of time during which a3 transitions from V IH to V IL. L(a3,a2,a1,a0) 0xF 0x7 Å Here s a list of design tasks you might use to organize your approach to the lab: 1. Draw a gate-level schematic for the full-adder module. XOR gates can be used to implement the S output; two levels of NAND gates are handy for implementing C o as a sum of products. 2. Create a MOSFET circuit for each of the logic gates you used in step 1. 3. Enter.subckt definitions in your netlist for each of the logic gates. Use Jsim to test each logic gate with all possible combinations of inputs. Debugging your gate designs one-byone will be much easier than trying to debug them as part of the adder circuit. Here s a sample netlist for testing a 2-input NAND gate called nand2:.include "/mit/6.004/jsim/nominal.jsim".include "/mit/6.004/jsim/8clocks.jsim".subckt nand2 a b z internals of nand2 circuit here.ends Xtest clk1 clk2 z nand2.tran 20ns.plot clk1.plot clk2.plot z 4. Enter a.subckt definition for the full-adder, building it out of the gates you designed and tested above. Use Jsim to test your design with all 8 possible combinations of the three inputs. At this point you probably want to switch to using Fast Transient Analysis do to the simulations as it is much faster than Device-level Simulation. 5. Enter the netlist for the 4-bit adder and test the circuit using input waveforms supplied by lab2checkoff.jsim. Note that the checkoff circuitry expects your 4-bit adder to have exactly the terminals shown below the inside circuitry is up to you, but the.subckt ADDER4 line in your netlist should match exactly the one shown below..include "/mit/6.004/jsim/nominal.jsim".include "/mit/6.004/jsim/lab2checkoff.jsim" subckt definitions of your logic gates.subckt a b ci s co full-adder internals here 6.004 Computation Structures - 4 - Lab #2

.ends.subckt ADDER4 a3 a2 a1 a0 b3 b2 b1 b0 s4 s3 s2 s1 s0 * remember the node named "0" is the ground node * nodes c0 through c3 are internal to the ADDER module Xbit0 a0 b0 0 s0 c0 Xbit1 a1 b1 c0 s1 c1 Xbit2 a2 b2 c1 s2 c2 Xbit3 a3 b3 c2 s3 s4.ends lab2checkoff.jsim contains the necessary circuitry to generate the appropriate input waveforms to test your adder. It includes a.tran statement to run the simulation for the appropriate length of time and a few.plot statements showing the input and output waveforms for your circuit. When debugging your circuits, you can plot additional waveforms by adding.plot statements to the end of your netlist. For example, to plot the carry-out signal from the first full adder, you could say.plot Xtest.c0 where Xtest is the name lab2checkoff.jsim gave to the ADDER4 device it created and c0 is the name of the internal node that connects the carry-out of the low-order to the carry-in of the next. 6.004 Computation Structures - 5 - Lab #2