Hi there and welcome. In this video we are
going to go over a software tool called Logisim. This is the tool we are going to use in order
to build up the CPU. It is a freeware piece of software. I have put a link below where
you can go and download it. So let’s get started. You can pick up the gates up at the top left
hand corner , there are three sitting there. You can also go into the pull down menu under
gates and see there is a list of gates there. So let’s just pick a gate and get started.
Let’s pick the AND gate and make it a smaller size. We are only interested in 2 input s
so you can change the number of inputs here to 2 and we can see that we have 2 inputs
there in blue and an output in red. When you hover over the top of them you see the little
green circle so if you want to draw a line you hover over the top and left click and
you can draw the line. So there we have the 2 inputs and one output. You also got to put
down pins so there is an input pin there you can also get the pin from the wiring section.
So when we put the pin down you can see the little green dot and this is where the connection
is to the pin and we can change the direction of the pins by changing the direction here
so you can face west and now we have a west facing connection and we can change it to
north and south as well. So let’s go back to east and we now take the pin and place
it on the wire so you see the connection has been made and you see the wire changes to
dark green where dark green represents a zero. So let’s grab another pin and bring it down
and stick it there. You can label the pins. So let this one be A and you can change the
label direction also. Call the other pin B. Now place the output pin which is circular
and blue and lets place it. So now if you want to run a simulation you click the little
finger in the top left hand corner and this takes you to simulation mode. So when I change
A to a one the colour for a 1 is bright green but the output is still 0 as it is an AND
gate. So put A back to 0 and change B to 1 and of course the output is still 0. The output
will only be one when both inputs go high. So let A and B be high so the output now changes
to bright green or a 1. The next thing we want to do is build hierarchy. So let’s take
this and produce a NAND gate from it. So we ar out of simulation mode and take this link
out and stick in an inverter or a NOT gate. We have now built a NAND gate. If we want
to create a hierarchy you notice at the moment this little circle tells us we are sitting
on a page called main. This is your rough copy where you put your circuits together
and test them. If we want to create an actual instance we can go to PROJECT ADD CIRCUIT
and we can call it CPU_NAND. So now we have created another instance here called CPU_NAND.
There is nothing in it. We can go into main and copy and go into CPU_NAND and paste. So
now we have a NAND gate sitting in our CPU_NAND. If we wanted to draw the hierarchy we can
right click on CPU_NAND and go into EDIT CIRCUIT APPEARANCE which gives you a little circuit
which we can redraw. So lets draw it as a bigger rectangle and change the block thickness
to 2 and pick this point up and move to new block. also drag this point over and drag
the output over. Now you can’t quite see it because it is off the side of the screen but
if we click on this pin you can see it shows which pin this is in the right hand corner
of the page. This allows you tell what pin you are dealing with.So lets shift the remaining
pins and delete the rectangle. We can also name the pins say A , B and O and name it
NAND. So now this instance is available for you to use in the main section. So if we go
back to main we see there is nothing in it but we can go to CPU_NAND and pull across
the gate we just created. We can keep building up these hierarchys. If we copy and paste
to give 4 instances now we have 8 inputs and 4 outputs so let’s connect the outputs. Note
this is a random structure I am building just to show you how the tool works. So let’s add
a NOR gate with 4 inputs. You have to be careful as I can take this connection and you notice
there is no blue connection in the middle so I can connect this wire to the NOR gate
but it is not connected so you have to be careful with that.Let’s add some pins. We
will have 8 inputs. We could create a hierarchy with 8 inputs but the best thin to do is to
create a bus. Go to the WIRING section and grab a SPLITTER and place it down and change
fan out to 8 and bit width to 8. Note it has 0 to 7 on the pins which you can change so
7 is on top and 0 on bottom but be careful when it comes to hierarchies that we do not
mix these up as you will get short circuits. Now place an input pin now note the error
incompatible widths which tells us that the splitter is an 8 bit but the pin only 1 bit
so we need to change the pin to 8 bits. So our circuit is now completed. Call the input
pin i. This instance has been created on the scrap page called main so we can create a
new hierarchy and call it CPU_G1. So there it is now created and we can go into main
and cut and paste into CPU_G1 and we can go into this CPU G1 and create another hierarchy
and change the circuit appearance . We have an 8 bit input and a 1 bit output. So lets
redraw the instance and move the pins and we can name the pins and instance. So we
can go back to main and pick up a CPU_NAND and the new instance called CPU_G1 and create
a new circuit. So we could put our pins on and go again and create another level of
hierarchy . So that is 90 per cent of everything you need in Logisim to build a CPU all the
rest we will pick as we go along. Lets look at the wiring section so we got pins a tunnel which is a useful
one. If we place a tunnel and call it O and connect the tunnel then the wire has the value
O. So if I want to make a connection to another part of the circuit from O rather tan drawing
the wire we could just copy the tunnel and place it where required so both these points
are now connected. This save us cluttering the drawing up with wires. Also have a clock
you can setup the tick duration and we can choose SIMULATE and TICK ENABLE and you see
the clock ticking away. You can also tick it once by clicking on it. So this gives the
following simple clock. We can put in a constant so we can tie a point high but we need this
to be an 8 bit and we can tie it low. We have all the basic gates but we
will use our own gates as much as possible. I was going to do it all in NAND gates but
it’s a lot neater if I use some of the built in gates So we use the NOT BUFFER AND OR NOT
NOR NAND XOR gates mostly to build the CPU. There are other things like multiplexers bit
we will build these from scratch along with decoders etc. We build up our own ALU so
we do not use the ones given. We build the memory up from scratch as well, but in order
to load the memory from an external source we will use the RAM available in Logisim.
We use button , hex display. That is everything we
need to know about Logisim so in the next video we look at the simple NAND gate and
see how it can be used to build up the rest of the other gates. So thank you from listen
and goodbye.