CS 355 - Computer Organization/Architecture II
Project 1

Due: See class webpage

## 1. Project Description

In this assignment, you will design and implement a circuit with 5 inputs a, b, c, d and e and 3 outputs x, y and z that counts the number of one's in the input.

For example, if the input signals are a = 1, b = 0, c = 1, d = 1 and e = 1, then the output signals xyz = 100 representing the number 4 in the binary system.

If the input signals are a = 1, b = 1, c = 1, d = 1 and e = 1, the output signals should also be xyz = 101 (= 5).

And if the input signals are a = 1, b = 1, c = 0, d = 0 and e = 1, then the output signals should be xyz = 011, representing the number 3 in the binary system, and so on.

Here is another example and shows what the ciruit should do when the input signals are a = 1, b = 0, c = 0, d = 1 and e = 1:

Note: if you need a refresher on binary numbers, the CS255 online notes on this subject is here: click here

Write a EDiSim "program" that implement the above circuit.

Put the switches on the left (you will need 5 switches), the probes on the right (you need 3 probes) and the digital circuit between the switches and the probes.

Use the following coordinates for the components:

• The Switches and NOT-gates on the first column:

 ``` Switch aa A '0' ZERO; Not aa A NOTA; Switch ba B '1' ZERO; Not ba B NOTB; Switch ca C '2' ZERO; Not ca C NOTC; Switch da D '3' ZERO; Not da D NOTD; Switch ea E '4' ZERO; Not ea E NOTE; ```

• Put all the AND-gates that computes the 1st bit of the binary number at coordinate ed

Put all the AND-gates that computes the 2nd bit of the binary number at coordinate cd

Put all the AND-gates that computes the 3rd bit of the binary number at coordinate ad

• Put the OR-gate that connect the values from the AND-gates for the 1st bit of the binary number at coordinate ee

Put the OR-gate that connect the values from the AND-gates for the 2nd bit of the binary number at coordinate ce

Put the OR-gate that connect the values from the AND-gates for the 3rd bit of the binary number at coordinate ae

• Finally, put the probe for the 1st bit of the binary number at coordinate ef

Put the probe for the 2nd bit of the binary number at coordinate cf

Put the probe for the 3rd bit of the binary number at coordinate af

This is what your circuit should look like:

Note:

 You can be creative and find more efficient solutions on your own and implement it.

## 2. Doing EDiSim projects

• The EDiSim system are described in these webpages:

 Setup your account to use EDiSim: click here Brief history of EDiSim: click here My write-up EDiSim: click here How to use EDiSim built-in components: click here For pj2 and later projects: defining and using new component: click here

To do project 1, you must be familiar with the items 1 and 3 in the above list

Consult item 4 on how to use a built-in component.

(Item 5 will be needed in project 2)

• Edit your EDiSim project file as:

 ``` gedit pj1.h (or use your favorite editor) ```

and write the EDiSim circuit program that implement the above circuit.

• To make grading uniform, please use the following keyboard assignments:

 First switch: use the digit 0           Second switch: use the digit 1 Third switch: use the digit 2 Fourth switch: use the digit 3 Fifth switch: use the digit 4

To run your circuit use this command:

 ``` cs355sim pj1.h ```

Toggle keys '0', '1', '2', '3' and '4' to interact with the circuit.

Verify correct circuit behavior

• I have made available compiled programs of the correct solutions in the directory /home/cs355001/Solutions

• To see how the project 1 circuit should behave, use this command:

 ``` /home/cs355001/Solutions/pj1-sol ```

## 3. Turn in

You must turn in your circuit file pj1.h using the following command:

 ``` /home/cs355001/turnin pj1.h pj1 ```

## 4. Extension requests

• Each project must be turned in before the specified dead line (see class webpage for the deadline

• You can request upto 3 extensions in the semester without any penalties without any questions asked

(A 4th extension request will be automatically denied --- personal emergencies and illiness with documentation will receive a "free" extension)

• To request an extension for this project, us the following command:

 ``` /home/cs355001/req-ext pj1 ```

## 5. Handling Errors in Logic-Sim

I will be compiling a list of commonly asked questions/answers on the projects.

The list of commonly asked questions/answers is accessible through the following hyperlink: click here

## Statement of Policy on Computer Assignments

Students will be graded partially on the basis of their programming assignments. These programming assignments are to be treated as examinations, and are expected to be your individual work. While discussions with other students in the course may be permitted or encouraged by your instructor, you should write your program yourself. The mathlab representatives are available to explain error messages, discuss briefly technical details with which you may not be familiar, and give short suggestions as to how you might detect logic errors. The reps should not, however be asked to write part or all of your program. Your instructor (and any teaching assistants assigned to the course) will be glad to help you to the extent that he or she feels reasonable.

Submissions based on other students solutions in prior offerings of the course specifically violate these guidelines, as do submissions prepared with the help of an outside "tutor".

You should take precautions to protect the confidentiality of your work: preserve the secrecy of your password, do not make files or directories sharable, pick up your printouts promptly and dispose of printouts where they will not tempt other students. All work should be done either in the class directory of your ITD account (preferred) or in your "priv" directory (only if you do not have a class directory).

All submissions should include a comment statement near the top of the program of the form:

THIS CODE IS MY OWN WORK, IT WAS WRITTEN WITHOUT CONSULTING A TUTOR OR CODE WRITTEN BY OTHER STUDENTS - your name

Cases of apparent plagiarism or collusion will be referred to the Honor Council.