0% found this document useful (0 votes)
11 views3 pages

Tut 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Tut 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

HH

4FTC2065:
4COM2003/8 From Silicon to C: Logisim Exercises

1. Getting started (5-10 mins)

a) Learn to use Logisim to edit and save circuits. This is quite intuitive. First open LogisimUH and use
the file menu to save a blank circuit file to your user area; call it first.circ

In the upper left corner of the Logisim window, locate two very important tools: the arrow (design
selector) and the hand (simulation control). Use the arrow to place and connect components on the
design board, then use the hand to set up test inputs for checking circuit behaviour.

b) Locate the component libraries underneath the tool bar. For this session you will only need the
“Wiring” and “Gates” libraries.

Start off by placing two Pins on the design board and changing their “Label” attributes to “A” and
“B”. Then place a Probe on the design board and label it “X”

c) Become familiar with logic gates. Fetch an AND gate by clicking on the corresponding line in the
library list and place it on the design board. Experiment with changing its attributes: Facing, Gate
Size and Number of Inputs (set this to 2) and see how the gate symbol changes on the design board.
Leave the Data Bits attribute set to 1.
Try copy/paste using ctrl/C, ctrl/V, and duplicate using ctrl/D (on a Mac the keyboard shortcuts are
cmd/C, cmd/V, etc).

d) Each of the gates you have used has at least two input terminals and one output terminal (except
NOT which has only one input). To draw a wire click on a terminal and drag away from it (wires are
represented as lines on the design board). You can connect terminals to one another by drawing
wires between them. Wires can be connected to one another, removed (by drawing backwards, or
by clicking on them and pressing delete), and made to pass over one another without a connection
being made. Try drawing wires in many directions, with turns, achieving connections at some
intersections and a pass-over in the others. The point is to get comfortable with Logisim so that
drawing circuits becomes a matter of deciding what to connect or disconnect, rather than how.

Also practice highlighting part of a circuit (by selecting an area and/or holding Shift down and
clicking on items) and dragging it away. Notice that the wires automatically extend to preserve
connection. The combination Ctrl/X+ctrl/V on a highlighted part disconnects it from the surrounding
circuit making it possible to relocate it without getting entangled in wires. Practice that, too.

e) Once you have practiced adding and connecting gates however you like, continue to the Logic Gate
exercises. For each exercise, build the circuit, make sure that the Simulate menu at the top has
“Simulation Enabled” checked, then press the hand button and proceed with changing the signals
on Pins A and B in the design window to test the outputs

Satisfy yourself that the output of the circuit is correct for each combination of inputs and if not,
attempt to determine why before rushing to ask your tutor. Look at the colour of the wires,
whether it is bright green, dark green (1 or 0 respectively), blue (floating) or red (illegal). See that
this corresponds to what you believe the circuit should do. Red indicates that the wire is connected
to one or more output terminals that are not correctly driven (a conflict, a floating transistor gate,
etc.) and blue indicates that you did not achieve good contact with a terminal, or that no input
signal is being asserted
HH

2. Logic Gate exercises (40-45 mins)

a) Create a new circuit file. Name it gates-2input.circ and save it. Place two Pins, labelled “A” and “B”
on the design board and make sure each of them has its “Three-state?” attribute set to “No”. Add a
Probe, label it “X” and investigate the behaviour of each of the following gates and draw their truth
tables. Save the .circ file.
i) 2-input AND ii) 2-input OR iii) NOT
iv) 2-input NAND v) 2-input XNOR vi) 2-input OR with input A inverted

b) Create another new circuit file called three-inputs.circ containing three Pins, A B and C and a Probe,
X. Construct the following circuits and use the outputs you get from them to fill in their truth tables.
In each case there will be three input signals (A, B, C) and one output signal (X), so they will all look like:
A B C X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
• X = (A OR B OR C)
• X = NOT A AND NOT B AND NOT C
• X = NOT (A AND C) OR (B AND C)
• X = (A XOR B) AND NOT C

c) Create truth tables for the following circuits, implement them, and save each circuit in its own
circuit file
• A circuit with two inputs A, B and a single output Q which obeys the following rule:
Q is high (1) when only one of A or B is high (1), otherwise Q is low (0).
• A circuit with two inputs X, Y and a single output Z which obeys the following rule:
when X is high (1) Z has the same value as Y, otherwise Z is high (1)
• A circuit with two inputs A, B and two outputs Q, R, which obeys the following rule:
When A and B are both high Q is high and R is low, otherwise Q is low and R follows A
• A circuit that has three inputs A, B, C and a single output X, which obeys the following rule:
When only one of A and B is high X is low, otherwise X has the same value as C
HH

3. Some homework exercises

a) Create a new .circ file called addbits.circ with two input Pins A and B and two Probes S and C, and
wire up the following:
• S = A XOR B
• C = A AND B
You have just built a simple device that adds together two 1-bit numbers, A and B, giving a 1-bit
sum, S, and a 1-bit carry, C

b) Create a new .circ file called addslice.circ with three input Pins A, B and Cin and two Probes, S and
Cout, and wire up the following:
• S = (A XOR B) XOR Cin
• Cout = (A AND B) OR (A AND Cin) OR (B AND Cin)
You have just built a device that adds together two 1-bit numbers, A and B, and a carry-in, Cin,
giving a 1-bit sum, S, and a 1-bit carry-out, Cout

c) Investigate the truth tables for gates provided by Logisim with 3-, 4- (or more) inputs.

d) Use the sum of minterms procedure to design and create a circuit with three inputs (A,B,C) and one
output (X) with the following truth table:

A B C X
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1

e) The device you created and saved in the file addbits.circ is called a half adder
Investigate the half-adder in the lecture slides and work out how to connect two together to create
a full adder. Wire up a full-adder like this and compare the behaviour of this device with the device
you implemented and saved in the file addslices.circ

You might also like