so in the last few videos we built
pretty much all of the RAM module and in
this video I want to power it up test it
out and basically convince ourselves
that it's working right so we'll power
it up and it's on see the clock is
running and we're going to switch to
program mode and so we have all 0s here
we have all 0s here so if we push the
button in program mode it should write
all zeros to memory and ok ok however
making progress all right so it looks
like we wrote oh I think I see what's
going on oh boy so I'm just looking Colt
very closely here and what I see so
first off I guess the kind of explain
was gone through my mind here so we
wrote zeros here we did not we wrote
ones here and whenever you see ones one
thing to kind of think or maybe a
possibility is that you know one is sort
of the default input so if something's
not connected you get a one because they
all the inputs on all these 7400 series
and 74 LS series chips are pulled up too
they have like pull-up resistors on the
inputs so that makes me think that you
know maybe this is hooked up sort of
correctly I guess we could test that
actually if we maybe set that yeah so we
if we set that bit it's writing that
there if we turn that off it's not
writing it but no matter what we set
these two I'm guessing it won't change
yeah so that doesn't that does nothing
happens there so that makes me think
that we got this hooked up right we
don't have this hooked up right and the
first thing that I notice just just
inspecting it I see that I am I might be
off by by a couple are off by one here
to the power should be going to pin 16
here and I see it's going to pin 15 and
then also this this ground should be
going to pin 15 it looks like it's going
to pin 14 but then I would expect oh
yeah okay so I do have I do have this
this input from the dip switch that two
comes across and that goes to pin 15 of
course you can see
that's correct but it's just these two
wires are just off by one so I just need
to shift these over to the left so let
me pull the power off and do that so
this shift over and of course you know
if this if this chip wasn't powered
which it wasn't you know the power was
was not connected this is fallen out
whoo boy yeah so this chip wasn't
powered then you know its outputs would
be would be floating and the inputs on
these chips default to ones and so
whenever we do a write it just it just
writes all ones so that explains the
behavior that we saw so now I need to
figure out how to find a good place for
this ground what can I get it to reach
yeah think that'll work okay let's give
this try so if we power it up we get
some random stuff in memory there but
with these all zeros if we write we get
all zeros so it looks like that might
have fixed it so let's try setting a
different pattern in here and write that
okay looks like we write that and if we
switch to address one we get some other
random garbage and if we go to all zeros
here and right there then we got all
zeros if we go back to address zero we
should see yep we see that pattern
that's in address zero and roots one we
go to address two we get random stuff
but we could put in you know some other
pattern like that if we go back to
address zero we see that if we go to
address 1 we get 0 so it looks like we
are able to put whatever data we want
into memory by selecting the address
here selecting the data we want here and
pushing this button here to write that
data in that address so now if we go to
run mode then we should be now using the
memory address register here and it
looks like that's pointed to address 0
and so we're seeing what's in address 0
there now in this case we want to go to
address 1 we've got two kind
set our our our a one on the bus here so
we want to set these top three bits to
zero and then of course the bottom that
will default to one when we when we set
our read signal here so this is our read
and actually let me stop the clock for a
second here so if we say we want to well
write I guess from the from the
registers per seconds we're going to
write to the bus a 1 0 0 0 so if we set
this enabled there then on the next
clock pulse we get a 1 in our headers
register and of course we see the 0
because we have a 0 in that location of
memory if we want to go back to address
0 then we have to set all four of these
bits low so let's go ahead and set that
forth bit low and so this signal is
still inputting a right signal so on the
next clock pulse it should put a 0 into
the register here and that goes to 0 and
we see the the memory that are the the
data that's in that memory location 0
and we can try going to memory address 2
and on the next clock pulse whoops did I
oh I just have these wires mixed up let
me put these in the right order here so
I'm not confused there we go so this
should be addressed to on the next clock
pulse
yep puts it to there and then this is
the data that we had stored in address
location 2 so it looks like the memory
address register is working that's great
now if we want to read this data from
the the bus or read this data and put it
on the bus again we're going to connect
the bus over here and we can hook up
some LEDs just to to see for now what's
over here and like I did before I'm just
going to connect 3 of these LEDs just to
give us an idea so if we want to output
well right now so we have location 2 in
our address register and if we want to
take the data that's in location to put
that on the bus then that's this signal
here we take that low and we see well at
least the bottom 3 bits it looks like
we're outputting that
and I guess we can we can move this led
here and see yeah that fourth bit is is
set there and then the fifth bit should
be off sixth bit should be off seventh
bit should be on and the eighth bit
should be off okay so it looks like it's
out putting this thing on to the bus
when we tell it to and then when we tell
it not to it doesn't so then I think the
only other thing we want to test is make
sure that when we want to take data from
the bus and put it into memory that we
can do that and so in that case I'm
going to take these LEDs out of the way
and I'm going to use these wires here to
put a value on the bus so again you know
these are going to these are going to
default high so I'm just going to set a
couple of these I'm going to set this
second bit low and let's say the third
bit low may be the sixth bit low and the
seventh bit low just those four bits I'm
going to set low and then I'm going to
use this signal down here which is our
our right signal so you know we've got
this address one in the memory address
register so we see what's in memory
location one here we saw that we can
help with that too the bus now we have a
value that a different value that want
input from the bus and store in that
memory location and so if the control
logic of the computer wants to do that
then it would set this high to say I
want to write to memory and then on the
next clock pulse which if you can see
all of this and I just pulse the clock
here and we should see this new data go
into memory and there it is so that new
data is in memory oh it's something
something interesting happened here you
see the address changed to all ones and
that's because we're also writing to the
memory address register
normally that would never happen because
you wouldn't write to the memory address
register and the data at the same time
you'd want to to do one of the other so
let me back up a second
and turn off the writing to writing the
data to memory then I want to go back to
address one actually let me just double
check here address two it looks like it
wrote it there too
we'll go back actually might me would be
easier here is is we can use this reset
signal and just reset to address zero so
we're here we're at address zero and we
want to not write to the address
registers we don't want to change the
address we only want to change the
contents at that address we want to stay
on address zero and then we want to
write to that address this data until
then on the next clock pulse yes it
writes this data into memory so I'm
reasonably convinced that that this is
working now you know it's not a total
test of every connection so there might
be like one bit that's not hooked up
quite right and we'll we'll probably
find that later on when we start hooking
everything up together and running more
complex programs things will see some
subtle issues which are always fun to
troubleshoot but at least at least at a
quick quick sort of test it looks like
everything is working more or less the
way that we want one other thing I'm
going to do just as kind of a
convenience thing is we've got all these
little control signals everywhere I'm
going to I'm going to label them just to
make life a little bit easier for me so
if we go up to the clock this signal
here is the the halt signal I'm just
going to stick a little label there that
says this is this is halt which halts
the clock this is the memory address
register in signal so when this is when
this goes low we're going to input a
value into the memory address register
so I'm going to call that M I for memory
address register in and I've got the bar
there because it's a active low so
normally want that high this is the RAM
out signal so yeah when this is when
this goes low as an active low when this
goes low it outputs the
of RAM to the bus so mark that is ro for
RAM out and that's active low so we'll
keep that high normally and then of
course the input from input from the bus
to RAM we've got the RAM in signal down
here so I'll mark that as RI for RAM in
and that's active high so I don't have
the bar there so normally that will be
low unless we're inputting from RAM and
then while we're here since we've got
the instruction register down here I'll
label those as well this is the
instruction register out so this will
output whatever is on the in the
instruction register to the bus so
that's the i/o and that's an active low
so normally that'll be high unless we're
outputting the contents of the
instruction register to the bus and
finally the the instruction register in
so this will input data from the bus and
store it in the instruction register and
that's also active low so that's III and
then normal that'll be high and actually
one last thing that I want to do which
is when we're for the RAM in when we're
writing data from the bus into Ram which
you'll notice if we set this high so
we're Ram in when the clock signal goes
high you see that this is all zeros and
that's because when the clock signal is
high we're writing for the entire
duration of the of the clock signal high
really what we want to do is write just
on the leading edge of the clock so
right now we're landing the clock and
the RAM in signal oops you can't quite
see that we're Nanding the clock and the
RAM in signal so this this white pin one
here is the clock and this is the RAM in
signal but really what we want to do is
we want to look at the ramming signal
and just the leading edge of the clock
and just at that moment where the clock
goes high not the entire time that it's
high we want to actually that's the
that's the moment that we want to read
data from the bus and
put it into into RAM here so we can do a
really simple edge detector circuit by
pulling this pin low and then instead of
inputting the clock directly into that
pin if we if we go through a capacitor
then what will happen is this will only
be high for the time it takes the
capacitor to charge through this
resistor right because the clock will go
high so we get five volts over here and
then of course we've got zero volts
we've got ground here and so this will
charge through the capacitor and while
it's charging this pin will be high but
as soon as the capacitor charges current
will stop flowing through the capacitor
and this will go low again so it will
only be high for the for sort of that
moment that it takes for the capacitor
charge so this is a this is a point zero
one micro farad capacitor and this is a
1k resistor so a 0.01 micro farad
capacitor and a 1k ohm resistor and so
if we want to know the time it takes for
this to charge we just multiply these
together but first we've got to get it
into into standard units so 0.01 micro
farad's in standard units which we
farad's would be zero point zero zero
zero zero zero zero zero one farad's
times and then 1 kilo ohm is one
thousand ohms and if we multiply these
two together basically we're just moving
the decimal point over three here so we
get zero point zero zero zero zero one
and then the answer will be in seconds
and that'll be the time that it takes
for the capacitor to charge and so in
other words at point zero zero zero one
seconds is going to be ten ten
microseconds so basically the the right
signal here that ends up going to the 74
LS 189 s are our actual ram chips in
this in this scenario it was only going
to be ten microseconds so it's just
going to be four for an instant it's
going to write
whatever is on the bus in that instant
when the clock goes high which is which
is exactly the moment that we want to
register that so we can kind of test
this out now right now we have this
value in the bus if we just change one
of these bits to something else we've
got our RAM in notes can't quite see
I've got a ram in signal high here so on
the next clock cycle it should write
that value in here we'll just change
this this this bit here to high and so
on that clock signal you see it goes
high it doesn't matter how long that
clock signal is it's it's just the first
10 microseconds of the clock that it's
using to clock in that new value and so
if we change this value on the bus new
clock doesn't matter how long that clock
signal is it's the first 10 microseconds
that clocks in that value so now we have
a little bit of an edge detector here as
well so so that pretty much should do it
this this here is our Ram module I think
we we've pretty much got everything
working at least the first initial tests
that we can do here so I think in the
next videos will either work on the
program counter which is a fairly simple
circuit or I think I'll do that first
and then and then I'll get into the the
actual output register which is which is
kind of interesting because we're going
to do a binary to decimal converter