Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

University of the Philippines

Electrical and Electronics Engineering Institute

EEE 105: Computer Organization

Logisim Tutorial
Logisim
• Is an educational tool for designing and
simulating digital logic circuits.
• Has the capacity to build larger circuits from
smaller subcircuits and to draw bundles of wires
• Is useful for designing and simulating an entire
CPU for educational purposes
– This will be our next machine problem!

EEE 105: Computer Organization UP EEEI


Schematic Editor Window

EEE 105: Computer Organization UP EEEI 4


Schematic Editor Window

Library
This is the area where you draw logic
circuits

Properties
box

EEE 105: Computer Organization UP EEEI 5


Example 1: 2-to-4 decoder
• We will create the 2-to-4 decoder shown

Inputs
Outputs

• You’ll learn how to drag and drop gates and


connect them to create complex logic
EEE 105: Computer Organization UP EEEI 6
Example 1: 2-to-4 decoder
In “Gates” folder, look
for AND Gate

We need 4 AND
gates with 2 1-bit
inputs

Tinker with the


properties and see
the changes reflect
on the instance

EEE 105: Computer Organization UP EEEI 7


Example 1: 2-to-4 decoder
In “Gates” folder, look
for NOT Gate

We need 2 NOT gates

NOT gate should


be set to face
South

EEE 105: Computer Organization UP EEEI 8


Example 1: 2-to-4 decoder
In “Wiring” folder, look
for Pin

Put an Input Pin

A Pin can be set to


be an input or
output

EEE 105: Computer Organization UP EEEI 9


Example 1: 2-to-4 decoder

2 input pins

4 output pins

EEE 105: Computer Organization UP EEEI 10


Example 1: 2-to-4 decoder
Click on the input
pin to start wiring

EEE 105: Computer Organization UP EEEI 11


Example 1: 2-to-4 decoder

Drag up to the input of


NOT gate to connect

EEE 105: Computer Organization UP EEEI 12


Example 1: 2-to-4 decoder

Final schematic for decoder

EEE 105: Computer Organization UP EEEI 13


Example 1: 2-to-4 decoder

Put labels to the pins

EEE 105: Computer Organization UP EEEI 14


Example 1: 2-to-4 decoder
Choose the “hand”
as your cursor to
change value of
pins

Click on the pin to


change value

Change the value of the pins to


test the decoder

EEE 105: Computer Organization UP EEEI 15


Example 2: 4-to-16 decoder
• We will use the 2-to-4 decoder from previous
example.
• You’ll learn how to create a symbol and
instantiate previously designed logic blocks to
enable a more modular design

• To start, open a new circuit schematic.

EEE 105: Computer Organization UP EEEI 16


Example 2: 4-to-16 decoder

Click the “+” sign to


add new subcircuit

Put the subcircuit


name

EEE 105: Computer Organization UP EEEI 17


Example 2: 4-to-16 decoder

Double-click on
the subcircuit to
edit it

Copy and paste the circuit


from previous example

EEE 105: Computer Organization UP EEEI 18


Example 2: 4-to-16 decoder

Go back to “main”
circuit the click on
the subcircuit to
create an instance

EEE 105: Computer Organization UP EEEI 19


Example 2: 4-to-16 decoder

Right-click on subcircuit and


click “Edit Circuit Appearance”
to change block appearance

EEE 105: Computer Organization UP EEEI 20


Example 2: 4-to-16 decoder

Draw it like this

EEE 105: Computer Organization UP EEEI 21


Example 2: 4-to-16 decoder

Draw the 4-to-16


decoder. Note that 4 of 5
decoders shown have
enable signals. Modify
the decoder from
previous example to have
enable input.

EEE 105: Computer Organization UP EEEI 22


Example 3: 16-bit register
• We will create a 16-bit register using D flip flops
• You’ll learn how to use flipflops as well as wire
manipulation (i.e. grouping several wires together
and splitting them, tunneling wires) for a cleaner
looking design

• Create another circuit schematic for this example

EEE 105: Computer Organization UP EEEI 23


Example 3: 16-bit register
• Flipflops can be found inside the “Memory”
library
Aside from the D, Q, and
clock ports, flipflops also
have other input ports,
namely: preset, enable,
and clear.

You can hover your mouse


cursor over the ports
around the symbol to learn
more about the
functionality of these ports

EEE 105: Computer Organization UP EEEI 24


Example 3: 16-bit register
• Create pins to connect the flipflop ports

The preset pin is tied to


constant 0 (also found in
“Wiring” library)

EEE 105: Computer Organization UP EEEI 25


Example 3: 16-bit register
• Instantiate 16 D flipflops and connect their clock,
reset, enable, and preset ports together

EEE 105: Computer Organization UP EEEI 26


Example 3: 16-bit register
• We also have to create a port for the 16-bit
register input and output
Just put 16 to the Data
Bits field of the Pin to
create a 16-bit input/output

EEE 105: Computer Organization UP EEEI 27


Example 3: 16-bit register
• However, since every flipflop only takes 1-bit
input and has a 1-bit output, how do we extract 1
bit from the collection of 16 bits coming to and
from the pins we have just created?

• We can use wire splitters!

EEE 105: Computer Organization UP EEEI 28


Example 3: 16-bit register
• Wire splitters can be found inside the “Wiring”
library. You can use them to split or combine wires
Fan Out determines the total
number of ports going in/out the
splitter

Bit Width In determines the total


number of bits that will be
split/combined given the ports

Splitters are reversible, meaning


they can split or combine wires
depending on the orientation
EEE 105: Computer Organization UP EEEI 29
Example 3: 16-bit register
• Friendly tip: If ever your design becomes
crowded with wires, you can also use tunnels.
This allows you to virtually connect wires without
the need for actual routing on your circuit.

EEE 105: Computer Organization UP EEEI 30


Example 3: 16-bit register
• Tunnels can also be found under the “Wiring”
library.
Make sure you have the same
label names for your tunnels.
Also, make sure that the data bits
are consistent!

EEE 105: Computer Organization UP EEEI 31


Example 3: 16-bit register
• Finish the design of the 16-bit register

EEE 105: Computer Organization UP EEEI 32


Example 3: 16-bit register
• You can easily extend the design to create a 32-
bit register! You can create clocks under the “Wiring” library.
You can set the clock frequency on the “Simulate”
menu -> “Tick Frequency”

EEE 105: Computer Organization UP EEEI 33


Example 4: ROM
Data being read
• ROM – read-only memory also shown on
instance

Address port to
specify location of Output data
data to be read

EEE 105: Computer Organization UP EEEI 34


Example 5: RAM
• RAM – random-access memory (supports read and write
operations)
Output for read
Input ports
ADDRESS and
DATA for storage

LD pin – set to 1 for read


All writes to RAM
are synchronous,
thus, the CLK
input

STR pin – set to 1 for write

EEE 105: Computer Organization UP EEEI 35

You might also like