when I build the program counter I'm
going to lay it out physically the same
way it is in this diagram I'm going to
put it just above to a register so I'm
going to take my a register this is a
register of course the ALU and the B
register so I'm going to take another
breadboard and connect it here above the
a register so take off that strip and
connect these here like that and just
above the average here I'll build our
program counter start with the 74 LS 161
which is our 4-bit counter and then we
also have the 74 LS 245 which were is
our tri-state buffers and so you see
that's the same thing chip we're using
for the a register for the ALU and the B
register so very similar approach to
connecting to the bus there we'll start
by hooking up the power for each of
these chips I'll start with the count
enable that's pretty straightforward
because 74 LS 161 has these enable
signals or these AM these enable pins so
I'll connect pin 7 and 10 together and
that'll serve as our enable inputs so
this will serve as our as our counter
enabled signal which I'll tie to high
for now just so that it's enabled so
next I'll hook up the outputs of the 74
LS 161 which are pins 11 through 14 and
those outputs we want to go through the
74 LS to 45 that connect the output to
the 74 LS 161 counter to our tri-state
buffers so it's connecting it depends 11
through 14 here and so that allows us to
to implement our program counter out
signal or counter out signal here which
controls whether the contents of the
counter are going out on the bus and to
do that we we use our enable signal here
so this enable basically is our program
counter out to pin 19
so I hope in nineteen up here that's our
that's our counter out signal and I'll
tie that hi this is a inverted signal so
that that's now currently disabled and
of course we can also you know each of
these each of these uh pairs of pins you
know this buffer from from 11 to 9
there's also a buffer from 9 to 11 we
can set the direction of this of this
chip using pin 1 so in this case because
we're connecting the counter chip of the
161 to the top side here the bottom side
is the other side will be connecting to
the bus and so for output we're going to
be going in the down direction here so
from from B to a and so from B to a we
want our direction input to be low so we
want pin 1 to be low so I'll just go
ahead and tie that low by just
connecting pin 1 to 2 ground like this
and of course we definitely want to be
able to see what's going on in here so
you can never have too many LEDs so look
some LEDs up to to this so we can see
the the contents of the program counter
whenever we want and so this was going
to be looking at the you know this is
basically tied right to the the output
of the 74 LS 161 we'll be able to see
what those four bits are so at this
point if I connected to power it should
do something and well it starts at all
zeros
let me try connecting a clock to it let
me connect the power to my clock is the
clock circuit just connect the power
here and then the clock itself goes into
10 two on the 74 LS one sixty one we
connect the clock to pin 2 it looks like
we're counting so we've got a counter
that's great
and so if we take our counter enable and
we take that low to counter stop
counting so a clock is still going but
the counter is stopped and then if we
bring that high the counter counts again
we go low it stops until we can control
whether the counter is actually counting
so that seems to be working so let's try
the the counter out so this is what
takes the contents of the counter and
puts it out on the bus so the bus is
going to be connected down here on the
bottom side of the the 74 LS to 45 so
let's connect a couple LEDs up just to
see what this is outputting and right
now it's disabled so it shouldn't be
outputting anything and it looks like
that is the case I'll just connect these
four LEDs but if we take our counter
output enable and we bring that low we
see that the contents of the counter are
being put out on the bus and if we take
our counter output enable and take it
high then it's no longer putting that
out on the bus so it looks like the
counter algae's is working on the
counter enable are both working so the
only piece we have left is the jump and
the jump basically the program counter
in so it should take the contents of the
bus and load it into the program counter
and this should be pretty
straightforward as well because the 74
LS 161 one of the reasons we chose to
use it is it has these data input so it
has this ABCD input and it has a load
signal over here so the load signal is
going to be our jump so I can just
connect over here this is the that load
pin that's our that's our jump signal
and it's an inverted input can see I've
got the little bubble there so normally
it would be high it will tie it high and
then if we wanted to load a value in
we'd bring it low so if I turn off the
counter enable and just leave it there
then if I bring my my jump if they take
that low that will activate the jump and
it should load whatever is coming in
here because these aren't connected so
they default to high and it looks like
it's just loading it's loading that you
know that default of high for those for
those four inputs that aren't connected
so it looks like that jump is working or
maybe so really what we just need to do
is connect these these four inputs for
for that jump over to our bus and so
I'll just connect them over to the
outputs of the 74 LS 245 which are also
just going to be connected to the bus so
they're the outputs of the 74 LS 245 but
they're also connected to the inputs of
the 74 LS 161 so I think they're pretty
much does it for the program counter
though I think there's there's one more
thing I'll do which is you know because
this is a recent 8-bit bus and we're
only using four bits you know the least
stick the for least significant bits for
the program counter we've got these
these other four bits that it doesn't
really matter what they are when we're
outputting but I think it'd be nice just
to tie them all to to ground so I'm just
going to I'm just going to do that so
I'm just going to connect these top four
bits all to ground and so now when we're
outputting our program counter whatever
it is if we enable the counting when we
output this program counter
of course we're outputting the lower
four bits but then these upper four bits
will be outputting zeros rather than you
know probably ones or something else
doesn't really matter but but it's nice
to have those tied to ground and I think
that should do it for the program
counter