CPSC 121: Models of Computation Lab #4: Multiplexers

Similar documents
Lab 1: Full Adder 0.0

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

Two's Complement Adder/Subtractor Lab L03

CHAPTER 11: Flip Flops

Gates, Circuits, and Boolean Algebra

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

Multiplexers Two Types + Verilog

Mentor Tools tutorial Bold Browser Design Manager Design Architect Library Components Quicksim Creating and Compiling the VHDL Model.

Lab 1: Introduction to Xilinx ISE Tutorial

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

Electronic WorkBench tutorial

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

Creating a Project with PSoC Designer

5. Tutorial. Starting FlashCut CNC

ELEC EXPERIMENT 1 Basic Digital Logic Circuits

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

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

The components. E3: Digital electronics. Goals:

Getting Started with the Cadence Software

Quartus II Introduction Using VHDL Design

meridianemr PATIENT PORTAL Release Notes

Lab 3: Introduction to Data Acquisition Cards

Lab 3 - DC Circuits and Ohm s Law

Lecture 8: Synchronous Digital Systems

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

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

Multisim 7 Tutorial Creating Macros for Sub-circuits

Excel & Visual Basic for Applications (VBA)

Chapter 2 Logic Gates and Introduction to Computer Architecture

16-bit ALU, Register File and Memory Write Interface

QUICK START GUIDE. SG2 Client - Programming Software SG2 Series Programmable Logic Relay

Home Creating an Application New

Statgraphics Getting started

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

LESSON 7: IMPORTING AND VECTORIZING A BITMAP IMAGE

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

Installing S500 Power Monitor Software and LabVIEW Run-time Engine

How to Attach Files in Blackboard Learn , Messages, Discussions, and Assignments

Lab 1: Introduction to PSpice

VHDL Test Bench Tutorial

Cornerstone Electronics Technology and Robotics I Week 15 Voltage Comparators Tutorial

Before you can use the Duke Ambient environment to start working on your projects or

IGSS. Interactive Graphical SCADA System. Quick Start Guide

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

EXPRESS PCB TUTORIAL Author: Lee Morey Revised: JE Feb 2015

Advanced Outlook Tutorials

KiCad Step by Step Tutorial

Configuration Manager

Configuring a Custom Load Evaluator Use the XenApp1 virtual machine, logged on as the XenApp\administrator user for this task.

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.

WAMLocal. Wireless Asset Monitoring - Local Food Safety Software. Software Installation and User Guide BA/WAM-L-F

WebSphere Business Monitor V7.0 Business space dashboards

MICROSOFT WORD TUTORIAL

Working with SQL Server Integration Services

Sequential Logic: Clocks, Registers, etc.

Introduction to LogixPro - Lab

Physics 226 FPGA Lab #1 SP Wakely. Terasic DE0 Board. Getting Started

Beginner s Matlab Tutorial

The 104 Duke_ACC Machine

PSPICE TUTORIAL (BASIC)

Selecting a Sub-set of Cases in SPSS: The Select Cases Command

Using the JNIOR with the GDC Digital Cinema Server. Last Updated November 30, 2012

SuperOffice AS. CRM Online. Introduction to importing contacts

ASYNCHRONOUS COUNTERS

Lab 4 - Data Acquisition

ImageNow Document Management Created on Friday, October 01, 2010

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

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

MATERIALS. Multisim screen shots sent to TA.

IFAS Reports. Participant s Manual. Version 1.0

An Introduction to MPLAB Integrated Development Environment

Gates, Plexers, Decoders, Registers, Addition and Comparison

Counters and Decoders

Adding Animation With Cinema 4D XL

ezsystem elab16m Project 1F: Alarm System (Full Project description)

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

USB-MIDI Setup Guide. Operating requirements

SQL Server 2005: Report Builder

EE 209 Lab 1 Sound the Alarm

Figure 8-1 Four Possible Results of Adding Two Bits

CATIA Tubing and Piping TABLE OF CONTENTS

STEP 7 MICRO/WIN TUTORIAL. Step-1: How to open Step 7 Micro/WIN

Company Setup 401k Tab

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

isppac-powr1220at8 I 2 C Hardware Verification Utility User s Guide

Arduino Lesson 1. Blink

Notes on Excel Forecasting Tools. Data Table, Scenario Manager, Goal Seek, & Solver

Downloading <Jumping PRO> from Page 2

Introduction. - Please be sure to read and understand Precautions and Introductions in CX-Simulator Operation Manual and

ORDERING ONLINE WITH YOURAVON.COM

Producing Standards Based Content with ToolBook

EE 242 EXPERIMENT 5: COMPUTER SIMULATION OF THREE-PHASE CIRCUITS USING PSPICE SCHEMATICS 1

Lab 17: Building a 4-Digit 7-Segment LED Decoder

Audacity is a free, totally free, audio editing program. Get it here:

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Basic Pivot Tables. To begin your pivot table, choose Data, Pivot Table and Pivot Chart Report. 1 of 18

McAfee Endpoint Encryption Reporting Tool

Tutorial: Configuring GOOSE in MiCOM S1 Studio 1. Requirements

Transcription:

CPSC 121: Models of Computation Lab #4: Multiplexers Collaboration: For this lab, you should work in teams of two. Each team member must be able to answer questions based on or use skills developed in the lab (including working The Magic Box). We suggest that team members adopt and regularly change driver and navigator roles, where the driver works with the lab tools while the navigator checks the driver s work, keeps the team on track, and manages references and resources. Because of limited supplies, you will not be able to work alone on the parts involving The Magic Box. Objectives In this lab, you design, build, analyze, and scale up a multiplexer circuit. Multiplexers allow computers to choose among multiple inputs, for example, when deciding which of the many bytes in memory to access, or which of the results from several operations we really want. Together with adders (subject of a later lab), multiplexers are among the key circuit elements in a modern computer. Pre-lab As usual, read through the lab beforehand. Complete your pencil-and-paper design of and truth table for a twoinput multiplexer, as outlined below and on the next page. Hand in your pre-lab design to your TA when you arrive to the lab. 1 Discussion Period Your TA will lead you in a class discussion pertaining to the work you ll be doing in this lab. In the groups you are divided into, write down your answers and hand in your group submission at the end of the discussion period. 2 Multiplexers A multiplexer allows a circuit to select one of two (or more) inputs, depending on the value of a select control input. That is, a two-input multiplexer has two data inputs d0, d1 and one control input s, and it outputs d0 if s is LOW (FALSE), and d1 if s is HIGH (TRUE). 2.1 Building a Two-Input Multiplexer You will now build a two-input multiplexer using basic gates (AND, OR, NAND, NOR, and XOR) and inverters. We provide a logic formula for a two-input multiplexer: y =( s d0) (s d1). You should verify that this formula produces the correct behaviour. TODO (prelab): Fill in a truth table for a two-input multiplexer 1

Design: Translate the logic formula y =( s d0) (s d1) into a circuit. TODO (prelab): Draw this circuit in the space provided. 2.2 Implement your Multiplexer in The Magic Box Ask your TAs for the neccessary Magic Box components, then determine the chips that you need, and wire up your design. Make sure that you leave room on your breadboard to add one more chip later. You will need it if you implement the four-input multiplexer in the challenge problems. Test: Connect the inputs of your multiplexer to switches from your Magic Box. Connect the output of your multiplexer to an LED of your Magic Box. Check that your multiplexer performs correctly. TODO: Demonstrate to one of your TAs that your circuit works. 2.3 How are Multiplexers Used? In this section we explore how multiplexers similar to the one you have designed are used in building computers. Specifically, we will look at where multiplexers show up in the computer we looked at in lab 1 and learn how the Arithmetic Logic Unit (ALU) is built around a single, large multiplexer. Open the file cpu.v from lab 1 in TKGate. TODO: How many multiplexers are there in the computer? Which modules are they located in? TODO: Open the ALU module and look at this multiplexer in detail and answer the following questions: 2

1. How many inputs does the multiplexer have? 2. For each input, list its number and describe the meaning of the output in the box below, ignoring for now the third column. 3. In a text editor, load the program we looked at in lab 1, cpu.mem. The op codes 10-17 correspond to the different options in the ALU multiplexer. The control signal for the multiplexer is 3 bits wide. This corresponds to three of the bits in the op codes in cpu.mem. Look at the commands, MUX inputs and bits in the opcodes and write down in the table your guess at what the 3-bit control signal for the ALU Multiplexer is for each input. MUX Input Number Operation Description Control signal 2.4 A Glitch in the System Start a new schematic in TKGate. Select New from the File menu. TKGate will ask you for the name of the new file. Use a meaningful name like muxdesign.v. TODO: Enter your two-input multiplexer design into TKGate. You can add labels to switches s,d0,d1 and outputs if you like by choosing Make/Comments. Run the simulator and verify that it operates as expected. In your testing, pay special attention to the case where both input switches are up and you flip the value of the control input back and forth from HIGH to LOW. You should see a glitch when you flip the control input from HIGH to LOW. The LED will briefly flicker yellow. Your next task will be to trace the circuit s operation to help explain why. 1. From the Simulate menu, choose Begin Simulation. A trace window will appear. Don t press Run quite yet. 2. Set all your inputs to ON. 3. Double-click each separate wire in your circuit: the four wires that lead from switches or to the LED, the wire between the inverter and the AND gate, and the two wires that lead from AND gates to the OR gate. You should see black diagonal lines (probes) on each wire. The labels like w0 next to each probe will become important in a moment. 4. Now press Run. In the scope window that we ve previously ignored, you will now see seven lines tracing out the values of each of your wires. 3

5. Click the + magnifying glass about three times to make the graph clearer. Where a line is high/green, the wire s value is HIGH and where a line is low/pink, the wire is LOW. The lines chart the wires values in time, with time moving forward to the right (and pausing each time the circuit finishes calculating). Each line s label matches one of the probes you attached to your circuit. 6. Find the line representing your circuit s output. You should see that it starts out as red with both high and low lines. This indicates that it has no value at this time. Although it s hard to see, at the very end of the graph, the line goes green, as expected to indicate the line is HIGH. 7. Now, flip your control input to OFF. The scope window should show the computations performed after your action. If you look again at the line for your circuit s output, you will see that it is HIGH/green for most of the time but towards the end goes to the red both high and low state again. TODO: Explain the cause of the glitch, why is the LED wire red near the end leading to a yellow light. Do this by describing what happens in the circuit from the time when the switch is flipped to OFF until the time when the circuit stabilizes and the trace ends with only green and pink lines. It might help to think about this in terms of the trip of the electrons flying out of the switch at the moment it is switched to OFF. How does the current travel through the circuit and what effect will this have on the voltage of the final wire leading to the LED? TODO: Show your simulation, trace, and explanation to your TA. 3 Challenge Problem Problem: TKGate Modules Your next design will be a four-input multiplexer. You can build this using your two-input multiplexer as a building block. TKGate calls such building blocks Modules. If you have not done so already, save your TKGate design for the two-input multiplexer you will be using it again shortly. Then, exit TKGate and start it again. You should get the tutorial screen. If it does not appear, go to Options from the File menu and select Novice Mode (the square to the left of Novice Mode should be red). Then try starting TKGate again. Now that you have the tutorial screen, click on Using Modules and go through the two screens of that tutorial. Once you have finished the tutorial, create a module for the two-input multiplexer that you designed earlier. 1. Open the file for your multiplexer. You should be in a module called main. 2. Select Copy from the Module menu. A dialog box will pop-up with main in the From field. Type mux2 in the To field and click OK. The module name mux2 will appear in the list of modules to the left of the schematic area. However, you are still editing main. 3. Double click on mux2 and you will now be editing the module that you just created. Note that the status line at the bottom now says Module: mux2 Replace the switches in this schematic with input ports labeled d0, d1, and s, and replace the LED with an output port labeled y. You now have a module for your two-input multiplexer. 4

4. Double click on main in the list of modules to resume editing the top-level module. Delete the circuit for the multiplexer. 5. Create a module instance of mux2. Add inputs d0, d1 and s, and an output called y, to the module instance. Make sure that the port names specified in the dialog match the names you gave the ports when you created the mux2 module. If they do not match, then you will get the message, No gates driving net some-name when you try starting the simulation. TODO: Connect switches to the inputs of your mux2 module instance and an LED to its output. Verify that it works correctly. Finally, show your TKGate simulation to your TA. 5