Download Problem Session 3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
ECE 109 Spring 2014
Name:__________________________________________
Problem Session 3
Overview
Welcome to Logisim! Logisim is a logic simulator that allows you design and simulate digital
circuit using a graphical user interface. It was written by Carl Burch. Logisim comes with
libraries containing basic gates, memory chips, multiplexers and decoders, and other simple
components. In later problem sessions, you will use many of these components, but for now,
we will guide you through the process of creating basic logic gates using transistors.
Part 0: Preparation
Begin by downloading Logisim from the SourceForge page to your Linux account. There are
three choices of release to download, but the system should automatically detect that you are
using a Linux machine and offer you a .jar file as your download. Save the .jar file to your
desktop.
Change the name of the .jar to something easy to type like logisim.jar.
Launch Logisim by opening a terminal window and entering the command:
java –jar logisim.jar &
Part 1: An Inverter
Logisim is a simple tool to use, most of the features you will need are well documented in the
reference document. You can obtain the guide from the Logisim Documentation page. We'll
begin by working with a very simple circuit.
1. Start by downloading (right-click and select
Save As) this Logisim file containing an inverter
constructed using P-type and N-type
transistors. Select File->Open from the menu
bar at the top of the Logisim window to open
the file. You should see the following in your
Logisim window.
Jan, 2014
1
ECE 109 Spring 2014
Name:__________________________________________
2. Select the "Poke"
tool on the top tool bar and click on the input pin in your
schematic. Observe what happens to the output. Does this match what you think an
Inverter should do?
3. An inverter is defined by a truth table. Select Project->Analyze Circuit from the menu
bar at the top of the Logisim window. Observe the truth table for your inverter under
the Table tab. We will learn about the other tabs later.
4. Return to the Logisim main window, and click the "Select and Add Wires"
tool on the
top tool bar. Select each of the two transistors in turn and notice the information
displayed in lower-left corner of Logisim window. Notice that you can change the Type
and orientation (i.e., Facing) of each transistor.
5. Now try to build the inverter transistor circuit yourself. Select File->New from the menu
bar at the top of the Logisim window to open a new schematic window. Try to recreate
the inverter schematic that you were given. Here’s a condensed guide to the
functionality you’ll need. Be sure to ask your instructor for help when you need it.
1. Click the "Input Pin"
button on the menu bar to add inputs.
2. Click the "Output Pin"
button on the menu bar to add outputs.
3. Click the transistor symbol found in the Wiring folder to add transistors. Note, you
will have to change the orientation and type of the transistors to build your circuit.
Jan, 2014
2
ECE 109 Spring 2014
Name:__________________________________________
Also note that for both N-type and P-type transistors, the “arrow” points in the
direction of the output when they are properly orientated.
4. The power and ground symbols are also located in the Wiring folder.
5. Click the "Select and Add Wires"
tool on the menu bar to add wire connections.
Click and drag to connect the input pin to the gate of the transistors. You can only
draw vertical and horizontal wires but you can connect wires to each other and to
the inputs and outputs of components.
6. Use the Poke tool to exercise your inverter and then check the truth table of your
newly constructed inverter to verify that it is correct.
7. Note the following:
a. The P-type transistor is connected to high voltage. It connects “high voltage”
to output when the input to its gate is 0.
b. The N-type transistor is connected to ground. It connects “ground” to output
when the input to its gate is 1.
Show your schematic and truth table to your instructor before proceeding. Be
prepared to explain how the circuit works.
Part 2: An NAND
We can perform a logical function by connecting two switches – we just demonstrated that by
building an inverter. Additional logic functions such as AND and OR are created by placing the
N-type and P-type transistors either in series, or in parallel as shown below.
N-type transistors
P-type transistors
Figure 1: Series
connection with N-type
& P-type transistors
Jan, 2014
N-type transistors
P-type transistors
Figure 2: Parallel connection with Ntype & P-type transistors
3
ECE 109 Spring 2014
Name:__________________________________________
We will build CMOS logic gates which always have an equal number of P-type and N-type
transistors. The inverter required just one of each, but to build more complicated functions we
will need two or more transistors.
1. Open the Logisim file containing an NAND gate constructed using P-type and N-type
transistors. You should see the following in your Logisim window.
2. Notice the following about this schematic:
1. There are two inputs and each input is connected to one P-type and one Ntype transistor.
2. The P-type transistors are always connected to high voltage and the N-type
transistors are always connected to ground.
3. The “arrows” on both the P-type and N-type transistors point towards the
output.
4. The output separates the P-type and N-type transistors.
5. The P-type transistors are arranged in parallel and the N-type transistors are
arranged in series.
3. Use the Poke tool to change the inputs. Verify that the behavior you observe is
consistent with its truth table (Project->Analyze Circuit then Truth tab). NAND stands
for Not AND. Write down the truth table for AND (write it on a piece of paper), and
verify that the NAND truth table in Logisim is the inverse of your hand-written AND
truth table.
Show your AND truth table to your instructor before proceeding. Be prepared to
explain why NAND is implemented with the P-type transistors in parallel and the Ntype transistors arranged in series.
Jan, 2014
4
ECE 109 Spring 2014
Name:__________________________________________
Part 3: An NOR
Construct the schematic for NOR (Not OR).
HINT: Start by writing down the truth table for OR and then inverting it to produce the truth table for
NOR. Based on the NOR truth table, determine if the N-type or the P-type transistors are in series; the
other transistor type will be in parallel.
Show your NOR truth table and schematic to your instructor. Be prepared to explain why you
choose your implementation (i.e., which transistors are in series and which are in parallel).
Part 4: An OR
Combine a NOR circuit and an inverter circuit to produce the OR functionality.
Show your OR schematic to your instructor.
Part 5: What’s wrong with this picture?
Why is each of the implementations shown below incorrect?
Explain why each of the implementations above is incorrect and then go home.
Jan, 2014
5