Computer Organization
Computer Science 251
Dickinson College
Spring Semester 1997
TTh 2:00 - 3:15
South College 04
Project #1 - Logic Gates Implementation
Due 2/4/97
Introduction:
In this project you will be implementing functions that represent the basic logic gates (NOT, AND, OR, NAND, NOR, XOR). These gates will be the building blocks that you will use to build a simulated computer over the course of the semester. I've also put together a project resouce page with links to UNIX and C++ reference and tutorial material that you might find useful. If you find any other really useful web sites let me know and I'll add them to the page.
Files For This Project:
To do complete this project you will need to obtain the Logic.h and LogicGates.h header files.
- SysSpecs.h
- Header file that defines several system parameters such as the word size for the computer. You don't need to worry about the contents of this file for this project. It is here only because Logic.h requries it.
- Logic.h
- Header file that defines an enumeration for Boolean variables and several functions for converting to and from Boolean types. You will find the conversion functions useful in several of the projects.
- LogicGates.h
- Header file that defines the functions which represent the basic logic gates. These are the functions that you will be writing.
Obtaining The Files:
The files for this project can be obtained in one of several ways depending on what platform you are using:
- Windows 3.1/95/NT with a Web Browser:
-
- Click on the link below for the file you want.
- When the file appears on the screen choose Edit | Select All
- Choose Edit | Copy
- Open your C++ Development environment.
- Open an empty document.
- Choose Edit | Paste
- Windows 3.1/95/NT or UNIX using FTP:
-
- Get command prompt in UNIX or MS-DOS.
- Type FTP
- At the FTP> prompt enter the command:
open physics.dickinson.edu
- Supply the Username and Password you were given in class.
- Enter the following sequence of commands:
- binary - Sets the file transfer type to binary.
- cd cs251 - Switches into the class directory.
- ls - Lists the files in the class directory.
- get SysSpecs.h - Copies the SysSpecs.h file to your machine.
- get Logic.h - Copies the Logic.h file to your machine.
- get LogicGates.h - Copies the LogicGates.h file to your machine.
- close - Closes the connection to the server.
- quit - Quits the FTP program.
The Assignment:
- Get the Logic.h and LogicGates.h header files.
- Read through and understand both of these header files.
- Decide how you are going to implement and test the function prototypes in the LogicGates.h file.
- Write up a short design document that describes your implementation and testing strategy. I know you might be tempted to wait until after you have finished the project to do this, however, I strongly recommend you write a rough draft before you write any code.
- Create a file named LogicGates.cpp that implements the function prototypes in the LogicGates.h file. LogicGates.cpp will need to #include "LogicGates.h" and "Logic.h".
- Create a file named main.cpp that contains the main() function. The main function should call test functions that thouroughly test all of the logic gate functions. The main.cpp file will need to #include "LogicGates.h" and "Logic.h".
- Create a make/project file to compile your files. If you are doing this on ZAX then you will want to use the make program. A sample makefile and a description of how to use it are available on the project resources page. If you are using your own PC based development environment the you'll have to check your manuals for how to create multi-file projects.
- Test your functions and revise the design document describing your implementation and testing strategies.
Submitting Your Solution:
For this project you need to submit 3 files.
- LogicGates.cpp - contains your implementation of the functions prototypes in the LogicGates.h header file.
- Main.cpp - contains your main() function and all of your test code.
- Design Document - the design document describes your implementation and testing strategies.
You should use the following procedure for submitting your files:
- Get command prompt in UNIX or MS-DOS.
- Type FTP
- At the FTP> prompt enter the command:
open physics.dickinson.edu
- Supply the Username and Password you were given in class.
- Enter the following sequence of commands:
- binary - Sets the file transfer type to binary.
- cd cs251 - Switches into the class directory.
- ls - Lists the files and Directories in the class directory.
- cd "groupname" - Switches to your groups folder.
- put LogicGates.cpp - Sends the LogicGates.cpp file.
- put Main.cpp - Sends the Main.cpp file.
- put DesignDoc.txt - Sends the design document (if you called it DesignDoc.txt)
- close - Closes the connection to the server.
- quit - Quits the FTP program.
Grading of Solutions:
The grade for your project will be divided equally into two parts, Design and Implementation. The Design portion of the grade includes:
- How effectively you have used the tools available to you. In this case that means did you use the enumerations, typedefs and conversion functions from Logic.h in an appropriate way.
- The elegance of your solution. This means does your code implement a solution in a reasonable way.
- The effectiveness of your test cases. I'll be looking to see if the test cases you implemented show with reasonable certainty that your solution is correct. Sometimes you will be able to test your classes/functions for every possible case and sometimes that will not be a reasonable approach and you will need to be more careful when selecting your test cases.
The Implementation part of your grade includes:
- Readability and Maintainability of your code. This is a qualitative appraisal of how well your code has been written. What I'm looking for is code of which I can follow the logic (comments help!). I also want to see appropriate defines, typedefs and the like to make your code easier to modify, update and maintain.
- The correctness of your solution. I will determine this by compiling my test cases using your implementation files. For this project I will compile my Logic.h, LogicGates.h, and main.cpp files with your LogicGates.cpp file. I will then run my test cases using the functions you implemented in LogicGates.cpp.
These pages designed and maintained by Grant Braught
Braught@Dickinson.edu