Starting from:

$34.99

CS2110 Project 1 - Hardware Basics Solution



1 Introduction
2 Setup
The software you will be using for this project and all future circuit based assignments is called CircuitSim - an interactive circuit simulation package.
In order to use CircuitSim, you must have Docker up and running. If you do not have Docker, follow the instructions laid out in the installation guide found under Canvas → Files → Docker.
CircuitSim is a powerful simulation tool designed for educational use. This gives it the advantage of being a little more forgiving than some of the more commercial simulators. However, it still requires some time and effort to be able to use the program efficiently.
3 Part 1 — Introduction to CircuitSim
The first part of this project is designed to get you up to speed with CircuitSim. If you do not have CircuitSim running through Docker, see the setup section of this document to get there.
3.1 Read Resources
Read through the following resources
• CircuitSim Wires Documentation https://ra4king.github.io/CircuitSim/docs/wires/
• Tutorial 0: My First Circuit https://ra4king.github.io/CircuitSim/tutorial/tut-1-beginner
3.2 Complete Tutorial 1
In the existing file tutorial1.sim and subcircuit Tutorial 1, complete the following tutorial. Do not rename the subcircuit or file. Be sure to label your two inputs a and b, and your output as c.
Complete Tutorial 1 https://ra4king.github.io/CircuitSim/tutorial/tut-2-xor
3.3 Complete Tutorial 2
In the existing file tutorial2.sim and subcircuit Tutorial 2, complete the following tutorial. Do not rename the file or subcircuit. Name the input in, and the output out.
Complete Tutorial 2 https://ra4king.github.io/CircuitSim/tutorial/tut-3-tunnels-splitters
4 Part 2 — ALU
Now that we have the basics down, we can move on to more complex circuits and logic. All computer processors have a very important component known as the Arithmetic Logic Unit (ALU). This component allows the computer to do, as the name suggests, arithmetic and logical operations. For this part, you’re going to build an ALU of your own, along with creating some of the gates.
For this part of the project you will:
1. Create the standard logic gates (NAND, NOR, NOT, AND, OR)
2. Create an 8-input multiplexer and an 8-output decoder
3. Create a 1-bit full adder
4. Create an 8-bit full adder using your 1-bit full adder
5. Use your 8-bit full adder and other components to construct an 8-bit ALU
When building these circuits, restrictions have been placed on what you can use. These restrictions are listed at the beginning of each section. Using anything not listed will result in heavy deductions. You also need to have everything in its correctly named sub-circuit. More information on the sub-circuits is given below.
Use tunnels where necessary to make your designs more readable, but do not overdo it! For gates, multiplexers, decoders, and adders you can often make clean circuits by placing your components strategically rather than using tunnels everywhere.
4.1 1-Bit Logic Gates
Allowed Components: Wiring Tab and Circuits Tab
All of the circuits are found in the gates.sim file.
For this part, you will create a transistor-level implementation of the NAND, NOT, NOR, AND, and OR logic gates.
Remember for this section that you are only allowed to use the components listed in the Wiring section, along with any of the logic gates you are implementing in CircuitSim. For example, once you implement the NOT gate you are free to use that subcircuit in implementing other logic gates. Implementing the gates in the order of the subcircuit tabs can be the easiest option.
Hint: Start by creating the NAND and NOT gates from transistors. Then use this gate as a subcircuit for implementing the others.
All of the logic gates must be within their named sub-circuits.
4.2 Muxes
Allowed Components: Wiring Tab, Gates Tab, and Circuits Tab
All of the circuits are found in the muxes.sim file.
4.2.1 Decoder
The decoder you will be creating has a single 3-bit selection input (SEL), and eight 1-bit outputs (labeled A, B, C, ..., H). The decoder uses the SEL input to raise a specific output line. 000 should correspond to A, 001 should correspond to B, etc.
4.2.2 Multiplexer, commonly abbreviated as ”mux”
The multiplexer you will be creating has 8 1-bit inputs (labeled appropriately as A, B, C, ..., H), a single 3-bit selection input (SEL), and one 1-bit output (OUT). The multiplexer uses the SEL input to choose a specific input line for forwarding to the output. 000 should correspond to A, 001 should correspond to B, etc.
4.3 Adders
Allowed Components: Wiring Tab, Gates Tab, and Circuits Tab
All of the circuits are found in the alu.sim file.
4.3.1 1-Bit Adder
The full adder has three 1-bit inputs (A, B, and CIN), and two 1-bit outputs (SUM and COUT). The full adder adds A + B + CIN and places the sum in SUM and the carry-out in COUT.
For example:
A = 0, B = 1, CIN = 0 ==> SUM = 1, COUT = 0
A = 1, B = 0, CIN = 1 ==> SUM = 0, COUT = 1
Hint: Making a truth table of the inputs will help you.
4.3.2 8-Bit Adder
You should daisy-chain 8 of your 1-bit full adders together in order to make an 8-bit full adder.
This circuit should have two 8-bit inputs (A and B) for the numbers you’re adding, and one 1-bit input for CIN. The reason for the CIN has to do with using the adder for purposes other than adding the two inputs.
There should be one 8-bit output for SUM and one 1-bit output for COUT.
4.4 8-Bit ALU
Allowed Components: Wiring Tab, Gates Tab, Plexer Tab, and Circuits Tab
You will create an 8-bit ALU with the following operations. Feel free to use the circuits you made in previous parts of this lab to implement the following operations.
000 add [A + B]
001 sub [A - B]
010 max [max(A, B)]
011 popCounter See below
100 mostSignificantOne See below
101 isMultipleOf16 [A % 16 == 0]
110 multiplyBy5 [A * 5]
111 isNegative [A < 0]
isMultipleof16 and isNegative should return either 00000000 for false or 00000001 for true popCounter: For this operation, you will need to implement a population counter. At it’s core, a population counter is a circuit that counts the number of 1s in a given bit vector using only combinational logic. For the population counter in this project, you will need to create an circuit that will count the number of 1s in input A.
Examples:
A = 00101111 => return 00000101
A = 11110000 => return 00000100
mostSignificantOne: To elaborate, this operation should return the 8-bit representation of the value that is produced when all bits of C are cleared except for the most significant 1. Keep in mind that C is given in a 4-bit representation.
Examples:
C = 0110 => return 00000100
C = 1100 => return 00001000
Notice that popCounter, mostSignificantOne, isMultipleOf16, multiplyBy5, and isNegative only operate on the A or C input. They should NOT rely on B being a particular value.
This ALU has two 8-bit inputs for A and B, one 4-bit input for C, and one 3-bit input for OP, which is the op-code for the operation in the list above. It has one 8-bit output named OUT.
The provided autograder will check the op-codes according to the order listed above (add (000), sub (001), etc.) and thus it is important that the operations are in this exact order.
5 Part 3 — Advanced Combinational Logic
All of the circuits are found in the project.sim file.
(Note: The following does not represent an accurate Project 1 experience)
G Gates 3hrs
M Muxes 4hrs
D Decoders 7hrs
R Adders 5hrs
A ALU 13hrs
(Note: These do not represent the actual amount of time it will take to finish Project 1)
Your goal is to create a circuit which can tell you whether a given combination of parts can be completed within the 16 hours. An input value of 1 indicates that you are trying to complete the part and that it will take the time specified in the table. A input value of 0 indicates that the part will not be attempted and will take 0 hrs. An output value of 1 indicates the given combination of parts can be completed in the 16 hours and an output value of 0 indicates the given combination of parts cannot be completed in 16 hours.
Ex: If G = 1, M = 0, D = 0, R = 0, and A = 1 then the output should equal 1 since Gates and the ALU will take 16 hours.
As always, do not change/delete any of the input/output pins.
5.1 Karnaugh Maps
While it is not a deliverable, making 2 K-maps and reducing boolean expressions will make this circuit significantly easier to design. To aid this, we have provided a template for both K-maps below:
A M0G0 M0G MG MG0 A0 M0G0 M0G MG MG0
D0R0 D0R0
D0R D0R
DR DR
DR0 DR0
5.2 Boolean Logic Details
For this part of the project, we are asking that you approach this problem in sum of products format.
This means that after your reductions using the K-maps, you should have something in the format
D = A0B + C
before attempting to build the circuit. Failure to do so can lead to complications in your circuit that prevent the reduction we are looking for.
5.3 Circuit Details
To prevent trivialization of this assignment, we have placed a few restrictions:
• All of this circuit should be contained in the project.sim file
• You should try to reduce the amount of AND and OR gates as much as possible.
Hint: The K-maps do this for you!
6 Autograder
To run the autograder, run
java -jar project1-tester-1.0.jar
at a command prompt in the same directory as all your .sim files. This is the same autograder that Gradescope uses, but is much easier and faster to use.
7 Deliverables
Please submit the follow files:
1. tutorial1.sim
2. tutorial2.sim umbrella
3. gates.sim NOT, NAND, NOR, AND, OR
4. muxes.sim Decoder, MUX
5. alu.sim 1-Bit Adder, 8-Bit Adder, 8-Bit ALU
6. project.sim Advanced Combinational Logic
to Gradescope under the assignment “Project 1”.
8 Demos
• Sign up for a demo time slot via Canvas before the beginning of the first demo slot. This is the only way you can ensure you will have a slot.
• Your overall project score will be ((project_score * 0.5) + (demo_score * 0.5)), meaning if you received a 90% on your project, but a 30% on the demo you would receive an overall score of 60%. If you miss your demo you will not receive any of these points and the maximum you can receive on the project is 50%.
• You will be able to makeup one of your demos at the end of the semester for half credit.
9 Rules and Regulations
9.1 General Rules
2. Please read the assignment in its entirety before asking questions.
4. If you find any problems with the assignment, it would be greatly appreciated if you reported them tothe author (which can be found at the top of the assignment). Announcements will be posted if the assignment changes.
9.2 Submission Conventions
2. Do not submit links to files. The autograder does not understand it, and we will not manually gradeassignments submitted this way as it is easy to change the files after the submission period ends.
9.3 Submission Guidelines
2. You are also responsible for ensuring that what you turned in is what you meant to turn in. Aftersubmitting you should be sure to download your submission into a brand new folder and test if it works. No excuses if you submit the wrong files, what you turn in is what we grade. In addition, your assignment must be turned in via Canvas/Gradescope. Under no circumstances whatsoever we will accept any email submission of an assignment. Note: if you were granted an extension you will still turn in the assignment over Canvas/Gradescope.
4. Projects turned in late receive partial credit within the first 48 hours. We will take off 30% of thepoints for a project submitted between 0 and 24 hours late, and we will take off 50% of the points for a project submitted between 24 and 48 hours late. We will not accept projects turned in over 48 hours late. This late policy is also in the syllabus.
9.4 Syllabus Excerpt on Academic Misconduct
Academic misconduct is taken very seriously in this class.
3. A student must submit an assignment or project as his/her own work (this is what is expected of thestudents).
9.5 Is collaboration allowed?
• Publishing your assignments on public repositories accessible to other students is unauthorized collaboration and thus Academic Misconduct.

More products