Starting from:
$35

$29

Project 0: Logisim Circuits Solution

Update 9 Sept 3pm:For the last question (6-bit selector), the hint should say that you can re-usesixcopies of your 1-bit selector circuit, not four copies.

Update 9 Sept 2:50pm:Re-using circuits for building the counter isn't actually a helpful hint at all. Re-using circuits for the battleship question is a good idea, however.

The goal for this assignment is to build a few simple circuits using basic logic gates, manipulate simple logic expressions, and become familiar with Logisim.

Download and installLogisimon your own computer, or use the version we have installed on radius by running:




~csci226/bin/logisim

This is a full-featured digital circuit simulator program. You have to download it to run it, but it can save your work, print out circuit schematics, etc. It should work on radius or on most any Windows, Linux, or Mac computer, though you might need to install or update Java for it to work.

Note: For later projects, it's important to use the above "Holy Cross Edition", not any of the other versions you might find online.

Run logisim and play around with the interface to become familiar with it.

Most of the things you need are in the top left toolbar. The green square creates an input "pin" The green circle creates an output "pin". You should also see NOT, AND, and OR gates.

Once you place some input pins, output pins, and gates, you can drag wires between the small small dots.

If you click on a component you can see its properties in the bottom left. You can change the orientation (facing left, right, up, or down), add names to the input and output pins, change the size of the gates, change how many inputs a gate has, and so on.

Use the "hand" tool (top left, in the toolbar) to click on the input pins to toggle them on and off. The outputs and wires should light up accordingly. If they don't, make sure you check "Simulation Enabled" under the "Simulation" menu.

Under the "Gates" folder on the left you will find additional gates you can use, like XOR and NOR gates.

Under the "Input/Output" folder you will find an LED if you want to add some color to your circuits. It lights up when its input is a one.

The built-in logisim help is actually pretty good. Look at the tutorial under the help menu if you are lost. There are plenty of online tutorials as well (try youtube, for example). We are using a customized version of Logisim, so online examples might look slightly different.

Now build the following circuits in logisim, using only the gates mentioned in class (AND, OR, NOT, NAND, NOR, XOR, XNOR). You can use versions of gates with 2 inputs, 3 inputs, or more, if you like.




Circuits with 1-bit wires
Under the "Project" menu, select "Add Circuit..." and create a new circuit named "shockley" (please enter all names exactly as shown). This will create a blank sheet where you can enter your circuit. The "shockley" circuit should output according to the following formula. It should have three input pins (labeled P, Q, and

R) and one output pin (labeled S).

S = (R + ¬Q) • ¬(R•¬Q + Q•¬P) + ¬R•(P¬Q)

Don't simplify here: make your circuit match the structure of the equation as given.

Test your circuit (using the hand tool) to try each possible combination of inputs, and check each case by hand on scrap paper to make sure the output in logisim is as expected.

Create a new circuit named "bardeen". This circuit should have the exact same behavior as "shockley", with the same inputs (P, Q, R) and output (S) names, but built using as few gates as you can manage. Simplifying to only four or five gates is definitely possible, maybe even fewer.

Prove algebraically that your circuit for "bardeen" is equal to the expression above for "shockley". That is, starting with the original expression for "shockley" above, show step by step, with one step per line, how to simplify and rearrange the "shockley" expression so it matches your circuit for "bardeen". Each step should

obvious, i.e. using the identities given at the end of lecture Topic 1. You can include your proof as a comment on your circuit (use the "text" tool), or you can write it out by hand and turn it in separately.

Create a new circuit named "brattain". This circuit should output according to the following truth table. It should have three inputs (A, B, and C) and one output (T).

A B C |T

~~~~~~~~~

0
0
0
|
1
0
0
1
|
1
0
1
0
|
1
0
1
1
|
0
1
0
0
|
0
1
0
1
|
0
1
1
0
|
0
1
1
1
|
1
Create a fourth circuit, named "selector". This circuit should have three inputs (X,Y,and S) and one output (V). When input S is zero, the output V should match the input X, and when the input S is one, the output V should match the inputY.In other words, output V should be a one only if either (a) S is zero and X is one, or (b) S is one and Y is one. I call this "selector" because among the three inputs, the value of S is essentially being used to selector which of the other two inputs gets sent through to theoutput.




Circuits with multi-bit wires
In logisim, individual wires can be bundled into a "bus" carrying multiple signals. Similarly, a single "input" or "output" pin can actually carry multiple input or output signals. Under the "Wiring" folder you will also find a "splitter" that can convert a multi-bit wire into several individual one-bit wires, or vice versa (use the properties at the bottom left to select the "bit width", which specifies how many bits are in the "fat" end of the splitter, and to select the "fan out", which specifies how many branches should appear at the branching side of the splitter; for this project, the bit width and fan out should usually be set to the same size).

Add a circuit named "decoder". This should have a single 2-bit input (N), and four 1-bit outputs (A, B, C, and D). The A output should be a one only when the N input is "00". The B output should be a one only when the N input is "01". The C output should be one only when the N input is "10". And the D output should be a one only when the N input is "11". Note: you should have a single N input, configured to have 2 "data bits". Feed that input into a "splitter" (with bit width 2 and fan out 2) to get two separate wires. Those two wires should then go to several different gates, and eventually from those gates to the fouroutputs.

Add a circuit named "counter". This should have a single 3-bit input (V), and a single 4-bit output (C). The circuit should count how many bits of V are ones, and theithoutput wire in C should turn on when there are exactlyiones in the input. In other words, bit 3 of C should be one if and only if all three input bits are ones, bit 2 of C should be a one when there are exactly two bits in the input that are ones, bit 1 of C should be a one if and only if there is a lone one among the inputs, and bit 0 of C should be a one when none of the input bits is a one. For this circuit, you will need a splitter after the input to split the 3-bit input into three separate wires. These wires will then feed to various gates to produce four different output wires. use another splitter, facing the other direction to join these four wires into one large wire going to the outputpin.

Add a circuit named "battleship". This should have a single 4-bit input named T, and no outputs. Instead of outputs, it should have 16 RGBLED lights (look for them under Input/Output), arranged into a grid, like shown in the picture. Note, the grid wires go right through (under) the lights. In this arrangement, each light turns red when its horizontal wire is turned on, turns cyan when its vertical wire is turned on, and turns white if both the horizontal and vertical wires is turned on.

Your goal is to arrange it so that each input pattern will cause the correct light to turn white, according to the following table.

| Whichlight InputT|shouldbeyhite?

~~~~~~~~~~~~~~~~~~~~~~~~~

0
0
0
0
|
light
0
0
0
0
1
|
light
1
0
0
1
0
|
light
2
0
0
1
1
|
light
3
0
1
0
0
|
light
4
0
1
0
1
|
light
5
0
1
1
0
|
light
6



0
1
1
1
|
light
7
1
0
0
0
|
light
8
1
0
0
1
|
light
9
1
0
1
0
|
light
A
1
0
1
1
|
light
B
1
1
0
0
|
light
C
1
1
0
1
|
light
D
1
1
1
0
|
light
E
1
1
1
1
|
light
F



For example, if the input T is "1011", then light B should turn white (this example is shown in the picture above). (Hint:Youcan re-use any of the circuits you have already built without copy-and-paste. Instead, just select your previously-built circuit from the left panel, and place it inside your new circuit.) Hint: This circuit is much easier than it appears, especially if you make use of the circuits you havealready

made. Notice, for example, that the inputs for the row containing lights 8, 9, A, B all start with "10", so whenever the input starts with "10" then you should turn on the wire for that row. Similarly, the inputs for the right-most column of lights (3, 7, B, and F) all end in "11", so whenever the input ends in "11" you should turn on the wire for that column.

Lastly, add a 6-bit version of your selector circuit, named "selector2x6". As before there should be three inputs (X,Y,and S) and one output (V). Butnow,X and Y are both 6-bit inputs, and V becomes a 6-bit output. Input S remains a 1-bit input. The idea is that when S=0, each of the V outputs should match the corresponding X input, and when S=1, each of the V outputs should match the corresponding Y input. In other words, each signal in the V output should be a 1 only if S is zero and the corresponding signal in X is a one, OR, S is one and the corresponding signal in Y is a one. Hint:Youcan build this circuit usingsixcopies of your original "selector" circuit. There is no need to copy and paste. Instead, just grab your "selector" from the left side panel and place several of them in your new "selector2x6" circuit. Each will appear as a small chip of its own, inside of which are separate copies of your original selector circuit. Hover the mouse over the pins of these chips to see the name of eachpin.




Testing and Style
Make sure you test each of your circuits to make sure it works as expected. You should try every possible combination of inputs, within reason, and check the output for each to make sure it matches the descriptions above.

Style counts! Attach labels to your input and output pins (using the properties tab in the lower left; don't use the "text" tool for this purpose). Arrange your wires so they are neat and organized, with no extraneous squigles, crossings, or dead ends. Don't run wires on top of gates or so close to gates that they can't be seen easily. Lay out your components in a neat and organized fasion.




Good!










Bad...




Submissions
Submit your work electronically from the radius directory that contains your (presumably thoroughly tested) program source code and your collaboration log. The command to submit is:




~csci226/bin/submit circuits

Be sure to submit a collaboration log!Your files should be calledcollaboration.txtandproject0.circ.

The collaboration log is expected with each and every project. Failure to turn in a log will result in deductions. You must turn in a log even if you did not discuss your project with anyone. Simply state that no discussions took place.

You may submit version after version of your files electronically. Each successful submission will replace any all previously successfully submitted files. That is, only your last set of successfully submitted files will be visible to and will be graded by your instructor.

Get started early and have fun!




Honor Code
The honor code applies to all programming done in this course. Reread the course collaboration policy as well as the department statement on the honor code. Ask your instructor if you have any questions about this policy.

More products