6 Pages

Lab7

Course: CSE 115, Fall 2009
School: SUNY Buffalo
Rating:
 
 
 
 
 

Word Count: 816

Document Preview

Lab CSE115 7 Introduction Spring 2009you will create a simple circuit simulator. You will first build gate simulators for AND, OR In this lab and NOT gates. Then you will build gate simulators from these basic gates for some other useful gates. Finally, you will build more complex circuits, like an ADDER. You have TWO WEEKS to complete this lab. NOTE: At this point the description only reveals what you need to do...

Register Now

Unformatted Document Excerpt

Coursehero >> New York >> SUNY Buffalo >> CSE 115

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Lab CSE115 7 Introduction Spring 2009you will create a simple circuit simulator. You will first build gate simulators for AND, OR In this lab and NOT gates. Then you will build gate simulators from these basic gates for some other useful gates. Finally, you will build more complex circuits, like an ADDER. You have TWO WEEKS to complete this lab. NOTE: At this point the description only reveals what you need to do for the first week. Objectives The high-level objectives of this lab are to have you, build a complete program with minimal constraints work with Boolean operators model physical components in software Lab Tasks At your lab session your teaching assistant will briefly discuss what you must do in the lab, and answer any questions you may have. Step 1: Log in Step 2: Start Eclipse Step 3: Submit your lab 6 work Step 4: Do the lab! To successfully complete this lab, we recommend that you follow the steps below, in the given order. Step 4.1: Check out the SP09-CSE116-Lab7 project from the repository Check out the SP09-CSE115-Lab7 project from the labs repository. There is one file in the project: Circuit.java Circuit is an interface which specifies one method: public boolean value(); When called this method should return the output of the circuit given its inputs. Step 4.2: Define a NOT gate A Not gate has a single input. In its value method, the Not class must return the negation of its inputs value. The relationship between Not and Circuit is shown by the UML diagram below: Notice the presence of an association relationship. When defining the Not class, first draw the UML diagram using green to see what you have available in the class. The only thing you will need to do after drawing the diagram is define the value method. Remember that a Not gate returns the negation of its input value, and that in Java Boolean negation is expressed using !. Step 4.3: Define a Switch It will be convenient to have a Switch defined as a type of Circuit. A Switch is a special Circuit whose value can be set to either true or false, by calling its public void on() or public void off() methods, respectively. Step 4.4: Test the Not gate In the DrJava interactions pane, create a Switch and a Not gate. Make the the Switch input to the Not gate. Check that the value of the Not gate is true if the Switch is off, and false if the Switch is on. Heres a sample interaction: Welcome to DrJava. > lab7.Switch s = new lab7.Switch(); > s.off(); > s.value() false > s.on(); > s.value() true > lab7.Not n = new lab7.Not(s); > n.value() false > s.off(); > n.value() true Step 4.5: Define and test an And gate An And gate has two inputs. In its value method, the And class must return the conjunction of its inputs value, expressed in Java using the && operator. The relationship between And and Circuit is shown by the UML diagram below: Next you should test your And gate. In the DrJava interactions pane, create two Switches and an And gate. Make the two Switches the inputs to the And gate. Check that the value of the And gate is true if both Switches are on, and false otherwise. Step 4.6: Define and test an Or gate An Or gate has two inputs. In its value method, the Or class must return the disjunction of its inputs value, expressed in Java using the || operator. The relationship between Or and Circuit is shown by the UML diagram below: Next you should test your Or gate. In the DrJava interactions pane, create two Switches and an Or gate. Make the two Switches the inputs to the Or gate. Check that the value of the Or gate is false if both Switches are off, and true otherwise. Step 4.7: Define and test an Xor gate Finally for this week, define and test an Xor gate. An Xor gate is an exclusive or gate. The output of this gate is true if either of its inputs are true, but false if both or neither of its inputs are true. There are in fact many ways to build an Xor gate; heres one: Step 4.8: Next week Next week you will build a simulator for a circuit called a Full Adder, which adds two bits and computes a carry bit. You will then use this 1-bit Full Adder to build a larger adder, which can add two binary numbers of some set width (e.g. 3 bits). More details will be provided in recitation next week. Due dates You must submit your work for this lab no later than the start of your recitation the week of April 14 April 17. The assignment will be open for submission no earlier than Monday April 13.
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

SUNY Buffalo - CSE - 115
CSE115 Lab 7Spring 2009IntroductionIn this lab you will create a simple circuit simulator. You will first build gate simulators for AND, OR and NOT gates. Then you will build gate simulators from these basic gates for some other useful gates. Fi
SUNY Buffalo - CSE - 115
M ISSION ALTERNATE PROCEDURE IntroductionAs explained in the lab 3 write-up, you will normally submit labs using the Web-CAT system. This document describes an alternate submission mechanism which we can use in case the Web-CAT system ever encounte
University of Florida - U - 030205
CNS /Update Newsletter FeatureGatorLink E-mail Users Can Now Send from Any ISPCNS Document ID: u030205aLast Updated: 2/17/03UF Computing & Networking Services112 Bryant Space Sciences Bldg, University of Florida P.O. Box 112050 Gainesville Flo
University of Florida - CIS - 6930
Crowds: Anonymity for Web TransactionsMICHAEL K. REITER Bell Laboratories, Lucent Technologies and AVIEL D. RUBIN AT&T LabsResearchIn this paper we introduce a system called Crowds for protecting users anonymity on the world-wide-web. Crowds, name
University of Florida - CIS - 6930
ANONYMITYAn Simple Example! " # % # ! $ $ # $ $% $ & '$#( )* * # #+ , $ . # ,$ /,$ 0 "$ " $ 1" # % # " 1 $ $ #) #2 $3 6 $1 3 $& 4$# 5 * $& " 7 , 0 "* * $ *1What is anonymity?4$# $ 6"! $$$ 66$ $ 6 85$#$ $0 6 $6$ $$$$
St. John Fisher - KEEP - 260
Laura Richter March 13, 2007Extinction Swish Title of Lesson: Why Are Dinosaurs History Goal(s): To teach students the different theories of extinction. Age Group: 3rd-4th grade. Learning Objectives:Students will be able to: Describe each theory
Allan Hancock College - CP - 3110
James Cook University Faculty of Science Engineerin g and I nf orm a t ion TechnologyScho ol of Maths Physics & Informa t io n TechnologySUBJECT OUTLINE CP3110:03 Fundamentals of Software Engineering Cairns, Study Period 2, 2006HANDBOOK DESCRIPTI
Colorado - ECEN - 5682
ECEN 56821-22-07Theory and Practice of Error Control CodesSpring 2007P. MathysProblem Set 1(Solutions are due Mon. 1-29-07)1) The 10-digit ISBN (International Standard Book Number) system assigns a unique number of the form ISBN = d10 d9
Colorado - ECEN - 5682
ECEN 56822-19-07Theory and Practice of Error Control CodesSpring 2007P. MathysProblem Set 4(Solutions are due Mon. 2-26-07)1) Problem 4.22 in the book. Prove that the minimum distance of the incomplete product of an n1 , k1 , d1 ) linear
Colorado - ECEN - 5682
ECEN 56822-26-07Theory and Practice of Error Control CodesSpring 2007P. MathysProblem Set 5(Solutions are due Mon. 3-05-07)1) Problem 11.1 in the book. Consider the (3,1,2) nonsystematic feedforward encoder with g(0) = (1 1 0) , g(0) = (1
Colorado - ECEN - 5682
ECEN 56823-12-07Theory and Practice of Error Control CodesSpring 2007P. MathysProblem Set 6(Solutions are due Mon. 3-19-07)1) It is desired to nd the best ternary (i.e., q = 3) rate R = 1/2 and constraint length K = 3 (i.e., m = 2 memory
Wells - CS - 131
CS 131 Exam 1 October 5, 2007 Name_ Time started_1. a.Finished_(12 points) Identify briefly 4 of the following. Syntax error. Define and give an example. An error in language. It will prevent the program from compiling. Example: cout > "hello";
University of Florida - SUR - 6427
A Place in the World:A Review of the Global Debate on Tenure SecurityFORD FOUNDATIONBy Lynn EllsworthMission StatementF ORD FOUNDATIONThe Ford Foundation is a resource for innovative people and institutions worldwide. Our goals are to: Stre
Allan Hancock College - N - 4377702
FUTURES&LANGUAGESEdwardDeBonostheorythatyesandnoareusedtodetermine factfromfictioncanbefurtherexpandedtoforecastpossibilities forthefuturenomatterhowsurealthestatementmightbe. AccordingtoDeBonoapoisanextremeouttherestatementof possibility. DeBonosta
Uni. Worcester - MA - 3457
MA3457/CS4033 Assignment IDue: Friday 18th January, 20081. Section 1.2: 4abc 2. Section 1.2: 10 3. Section 1.2: 12 4. Compute (x, f ) (the condition number for f at x) for (a) f (x) = ex (b) f (x) = xp (p I R) Explain what the results tell you. 5
Uni. Worcester - MA - 3457
MA3457/CS4033 Assignment IIDue: Friday 25th January, 20081. Construct in two ways the polynomial of degree 2 or less whose graph passes through the points (0, 1.1), (1, 2), and (2, 4.2). Verify that they are the same. 2. Simple polynomial interpo
Uni. Worcester - MA - 3457
Assignment VIDue: Friday 22nd February, 20081. Section 4.1: 2a,b; 4a,b 2. Section 4.1: 6a,b; 8a,b 3. Section 4.1: 22 4. Section 4.1: 23 5. Section 5.2: 5a, 6b,d; 7a, 8b,d 6. Section 5.2: 10 7. Section 5.2: 16
Uni. Worcester - MA - 3457
MA3457/CS4033 Project IIDue: Friday 29th February, 2008This project is to be done in pairs. There are 3 problems that are to be completed. These problems are in a separate pdf le. The problems have come fom the book Numerical Computing with MATLA
Uni. Worcester - MA - 3457
Write a Matlab routine favouriteode to solve dy/dt = f (y, t), for t0 t tf inal using your favourite solver. The rst input argument of each routine species the function f (y, t). This argument should be the name of an M-le that takes y and t as in
UVA - DS - 237
Tiphaigne de la Roche - a 18th century writer - made a remarkable forecast of photography in his Giphantie - a phantasy sci-fi novel: subtitled: A view of what has passed, what is now passing, and during the present century what will pass in the worl
University of Florida - MIL - 4712
Computer Architecture in VHDL1Appendix A: The ISA of a Small 8-bit ProcessorIntroduction to Small8 An Instruction Set Processor (ISP) is characterized by its instruction set, address modes (means to access data), programming model, and the prese
UVA - DS - 237
Figure 2 The first use of the Kodak Girl motif in 1893.
UVA - DS - 237
UNI - CNS - 062
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|04 Nov 2008 19:17:11 -0000 vti_extenderversion:SR|5.0.2.6790 vti_title:SR|CannonWorld, Event-driven Programming, and Border Layout vti_modifiedby:SR|BEN-SCHAFER\schafer vti_nexttolasttimemodified:TR|04
NYU - JEC - 375
Empirical Part of the Exam of Econometrics IIJAU-ER CHENMarch 27, 20061Data DescriptionThe data used in this exercise are the following: y : log of GNP, at 2000 prices; i: yield on threemonth Treasury bills; p: log of the Consumer Price Index
University of Florida - CGS - 2422
CGS 2422 EXAM III SPRING 1997The Registrar of the University of Florida uses the following database tokeep student records: Information about all the courses offered by theuniversity is stored in a file named 'COU
Texas San Antonio - MS - 317
University of Texas at San Antonio Archives and Special Collections MS 317. Archives for Research on Women and Gender Oral History Project Bonnie Reed Transcript, July 17, 1997Tori Beckman-Wilson: This is Tori Beckman-Wilson, its July seventeenth,
Texas San Antonio - MS - 317
University of Texas at San Antonio Archives and Special Collections MS 317. Archives for Research on Women and Gender Oral History Project Bonnie Reed Transcript, July 23, 1997Interview by Tori Beckman Wilson on July 23, 1997. She interviewed Bonni
Texas San Antonio - MS - 317
University of Texas at San Antonio Archives and Special Collections MS 317. Archives for Research on Women and Gender Oral History Project Julia Gayden Transcript, June 11, 1997Tori Beckman-Wilson: This is Tori Beckman-Wilson, its June eleventh, ni
W. Alabama - CS - 125
May students often wonder what is the best way to study for a CS exam. As with all exams, everyone has different method to studying. But, since for many of you this will be your first CS exam ever, it can be a bit confusing what you should concentrat
W. Alabama - CS - 125
Final Exam Study Questions1. If the value of a primitive parameter changes, does it change the value of the argument? Answer: No; a primitive argument keeps its original value. This is because primitives are passed by value.2. Cons
W. Alabama - CS - 125
Final Exam Study Questions1. If the value of a primitive parameter changes, does it change the value of the argument? Answer: No; a primitive argument keeps its original value. This is because primitives are passed by value.2. Cons
W. Alabama - CS - 125
1. Review Question: LoopsWrite a program that will read in two positive integers from the user, a and b, and determine whether or not either one is a multiple of the other (a is a multiple of b if there exists some integer k such that a = k*y). If i
W. Alabama - CS - 125
1. Identify the variables that are both valid in Java and follow its naming conventions:NumChequestypeoffile2ndCardcardOne2. Which of the following are primitive types?int char String Board boolean3. What is the assign
W. Alabama - CS - 125
1. Review Question: LoopsWrite a program that will read in two positive integers from the user, a and b, and determine whether or not either one is a multiple of the other (a is a multiple of b if there exists some integer k such that a = k*y). If i
W. Alabama - CS - 125
1. Review Question: LoopsWrite a program that will take in two positive integers, a and b, read in from the user, and determine whether or not either one is a multiple of the other (a is a multiple of b if there exists some integer k such that a = k
W. Alabama - CS - 125
Additional Programming Problems1. Given an integer n, place pegs on a 2n+1 by 2n+1 board to form a "T". 2. Given three integers a, b, and c as input, print out: "There are q integers between a and b which are divisible by c." For example, if a=1, b=
W. Alabama - CS - 125
Additional Programming Problems1. Given an integer n, place pegs on a 2n+1 by 2n+1 board to form a "T".2. Given three integers a, b, and c as input, print out: "There are q integers between a and b which are divisible by c." For example, if a=1, b
W. Alabama - CS - 125
Writing a Class You wish to create a class that will model an Online Messenger Account. Instance Variables: * there will be an instance variable to keep track of the email address of the person using the account * there will be an instance variable t
W. Alabama - CS - 125
1. Review Question: LoopsWrite a program that will take in two positive integers, a and b, read in from the user, and determine whether or not either one is a multiple of the other (a is a multiple of b if there exists some integer k such that a = k
W. Alabama - CS - 125
Wint er 2007 Midt erm R e vi e w S tuffW e will go through these two questions in the Re view on Friday. 1. Write a program called BoardThingy to draw the following diagram. The user sup plies the size of the board.Board Size = 1Board Size = 4
W. Alabama - CS - 125
1.IdentifythevariablesthatarebothvalidinJavaandfollowits namingconventions: NumChequestypeoffile2ndCardcardOne2. Which of the following are primitive types? int char String Board boolean3.WhatistheassignmentoperatorinJava? Answer:=4. Use 2 lines
Texas San Antonio - CS - 6453
1 d 9 d9U dd d) d 1UDQdQ191 Y4& G 1 DiDeb 4 ibbn m i l j d i i g d odhBPkag DtdFd@td hf e& D&U u p y xuvrwvurs prp i P&r &Pa DI@tF@tFqh
Drexel - MATH - 633
Homework 71. Problem 14, page 147. Everybody was OK with this problem. 2. Problem 20, page 149. Everybody was OK with this problem. 3. Problem 21, page 149. (a) If xn is a sequence in E that converges to x E then this sequence is Cauchy. By Propos
UGA - CS - 1730
8.1Introduction Operator overloading Enabling C+s operators to work with class objects Using traditional operators with user-defined objects Requires great care; when overloading is misused, program difficult to understand Examples of already ov
University of Florida - FIN - 6434
Are U.S. CEOs Overpaid?Steven N. Kaplan University of Chicago Booth School of Business12008 by S. KaplanU.S corporate governance system has been demonized.Ebbers - WorldcomSkilling - EnronGrasso - NYSEScrushy - HealthsouthKozlowski
Carnegie Mellon - EE - 525
DynamicTrafficControlChunHanChen TimothyKwan TomBolds ShangYiLin RandalHongGroup2Project Objective : Dynamic Control of Traffic Lights Wed. Dec. 3ManagerPresentationOutlineMarketing ProjectDescription DesignProcess FloorPlanEvolution Layout
Vanderbilt - ME - 248
Pipe ow assignmentME 2481. Download and install the CFD package Fluent: The website is www.fluentusers.com You will need to create a username with a vanderbilt address. It is important that you use your own username (not the one I gave you in cla
Vanderbilt - ME - 248
Chip cooling CFD assignmentME 248We want the heat transfer coecient for a chip in an air channel. A CFD analysis has been set up and can be downloaded from Oak. Run the analysis for the conditions described and answer the following questions. The
Drexel - PHYS - 750
Homework set #1 1. Using the resultsd 2z M F ( y a) = = 2 dy EI EI for the cantilever shown, (a) Show that the deflection of the cantileverat a distance y from the fixed end is 2z L a y z FFy z= ( y 3a ) 6 EI(b) Show that, for a cantilever w
Penn State - CS - 101
CMPSC 101 Ch. 3 worksheet #Name -Trace the following program. Show the output in a rectangle & trace the values of each variable in a column. 1. Assume that the user inputs the value 3. #include <iostream> using namespace std; double computePrice
Penn State - CS - 101
CMPSC 101 Name Nick Robin Ch. 3 worksheet #3 Trace the following program. Show the output in a rectangle & trace the values of each variable in a column. 1. Assume that the user inputs the value 4. $36.18 #include <iostream> using namespace std; dou
Penn State - CS - 101
CMPSC 101 - Ch. 10 Worksheet #3Name Nick Robin1. (True/False) The five-dimensional array is the most common type of multidimensional array. 2. (True/False) C+ will only allow you to declare five-dimensional or smaller arrays. 3. (True/False) Whe
Penn State - CS - 101
CMPSC 101 - Ch . 7 Worksheet #1Name Nick Robin1. In the right margin, show what output would be displayed by the following program. #include <iostream> using namespace std; int main() { int a = 3; int b = 4; int c = 8; if (a < b) cout < "a is le
Penn State - CS - 101
CMPSC 101 - Ch. 1 Worksheet #4Name Nicholas Robin1. Write a declaration statement that declares a double variable named salary. Double salary =0.0;2. Write an assignment statement that assigns the value 30000.56 to a variable named salary. Sal
Penn State - CS - 101
Nick Robin CMPS 101 a2 Test Case # 1 2 3 4 5 6 Movies 0 50 3 47 13 30 Possible Inputs Books Peanuts 0 0 50 50 5 1.3 49 44 25 16 48 1.6 Expected Outputs Average 0 1403.48 100.36 1332.43 492.16 957.31 Reasons Lower Boundary Upper Boundary Small Order L
Washington University in St. Louis - MEXMRS - 0106
PDS_VERSION_ID = PDS3 RECORD_TYPE = STREAM OBJECT = TEXT PUBLICATION_DATE = 2005-10-19 NOTE
Washington University in St. Louis - MEXMRS - 0106
=Upfront Notes= This "aareadme.txt" file contains the description of the naming convention that will be used for all MEX kernels. One part of them will be directly produced by an automated system located at ESTEC,PST. Consequently, we c
Washington University in St. Louis - MEXMRS - 0106
$MEX LIGHT TIME FILE 1*LITIME 2*PREP JPL Mars Express Navigation Team 3*TITLE
Washington University in St. Louis - MEXMRS - 0106
$MEX ORBIT PROPAGATION AND TIMING GEOMETRY FILE v002* OPTG optg.out* TITLE 2004 Mars Express Mapping: OPTG File* CREATION JPL 04-JUN-30/08:28:01* BEGIN SCE 04-JUN-30/00:00:00.000* CUTOFF SCE 04-AUG-17/00:00:00.000*
Washington University in St. Louis - MEXMRS - 0106
=MEX CK Files= Last update: 10 NOV 2004 This "aareadme.txt" file describes the contents of the KERNELS/CK directory of the MEX SPICE data server. It also provides the file naming conventions used for the MEX CK kernels, and it provi