RAM module testing and troubleshooting
Summary
TLDRIn this video, the creator tests a self-built RAM module by powering it up and verifying its functionality. They check for correct data storage and retrieval, addressing issues with wiring and pull-up resistors. The video demonstrates writing zeros and ones to memory, reading data back, and using control signals for input and output. The creator also troubleshoots a wiring mistake, discusses the importance of edge detection for RAM writing, and labels control signals for clarity. The video concludes with a functional RAM module and plans for future videos on the program counter and a binary to decimal converter.
Takeaways
- 😀 The video is focused on testing a RAM module to ensure it's functioning correctly.
- 🔌 The initial power-up of the RAM module revealed the clock was running, and the module was in program mode.
- 💡 The video demonstrates writing zeros to memory, which unexpectedly resulted in ones, indicating a potential default input issue.
- 🔍 Upon inspection, it was discovered that some wires were connected incorrectly, specifically power and ground connections were off by one pin.
- 🛠️ The video shows a hands-on approach to fixing the wiring issue, which was crucial for the proper operation of the RAM module.
- 📈 After fixing the wiring, the RAM module was tested again, and it was observed that writing different patterns to memory worked as expected.
- 🔄 The video explains the process of reading data from memory and outputting it to the bus, showcasing the functionality of the memory address register.
- 🔧 The script includes a troubleshooting session where the presenter identifies and corrects an issue with the RAM in signal and its interaction with the clock signal.
- 💻 The video concludes with the addition of labels to various control signals for convenience and better understanding of the system.
- 📚 The presenter plans to work on the program counter and the output register in upcoming videos, with the latter involving a binary to decimal converter.
Q & A
What was the initial problem the presenter encountered when testing the RAM module?
-The initial problem was that the RAM module was writing all ones instead of zeros, which suggested a potential issue with the wiring or connections.
Why did the presenter suspect that the default input might be '1'?
-The presenter suspected the default input might be '1' because the inputs on the 7400 series and 74 LS series chips are pulled up with pull-up resistors, which would result in a '1' if nothing is connected.
What was the wiring mistake that the presenter identified during the testing?
-The wiring mistake was that the power should have been going to pin 16, but it was connected to pin 15, and the ground should have been going to pin 15 but was connected to pin 14.
How did the presenter confirm that the wiring issue was fixed?
-The presenter confirmed the wiring issue was fixed by writing zeros to the memory and observing that the memory now correctly reflected the written zeros.
What is the purpose of the memory address register in the RAM module?
-The memory address register is used to select a specific memory location to read from or write to within the RAM module.
Why did the presenter decide to label the control signals?
-The presenter decided to label the control signals to make it easier to understand and manage the various signals during testing and future reference.
What is the function of the RAM in signal as described in the script?
-The RAM in signal is used to write data from the bus into the RAM memory. It is active high and is used to transfer data during the leading edge of the clock signal.
How did the presenter create an edge detector circuit to control the RAM in signal?
-The presenter created an edge detector circuit by using a 0.01 microfarad capacitor and a 1k ohm resistor, which charges during the high state of the clock signal and discharges quickly, creating a short high pulse that triggers the RAM in signal.
What is the significance of the 10 microseconds delay in the edge detector circuit?
-The 10 microseconds delay ensures that the RAM in signal is only high for the leading edge of the clock pulse, allowing data to be written to the RAM during just that moment.
What is the next step the presenter plans to take after testing the RAM module?
-The next steps the presenter plans to take are to work on the program counter circuit and then proceed to the output register, which will involve creating a binary to decimal converter.
Outlines
🔌 Powering Up the RAM Module
In this segment, the video creator powers up the RAM module they've been building in previous videos to test its functionality. They observe the clock running and switch to program mode to write all zeros to the memory. The initial test reveals that all memory locations are filled with ones, suggesting a default input issue. The creator inspects the connections and identifies a wiring error, where power and ground connections are off by one pin. After correcting the wiring, they retest and successfully write different patterns to the memory, confirming that the RAM module is now functioning as intended.
🔍 Debugging and Testing Memory Address Register
The video continues with the creator debugging the memory address register. They notice that the memory outputs random data when not all address bits are set low, indicating a potential issue with the wiring. After correcting the wiring, they proceed to test the memory address register's ability to read and write data at different memory locations. They successfully demonstrate writing to and reading from various addresses, confirming that the memory address register is working correctly. However, they encounter an unexpected behavior where the address register changes to all ones, which is a result of simultaneously writing to the memory address register and data, an action that should not normally occur.
🏷️ Labeling Control Signals for Clarity
To simplify the process and avoid confusion, the video creator decides to label all the control signals on the breadboard. They label signals such as the halt signal, memory address register in, RAM out, RAM in, instruction register out, and instruction register in, each with an explanation of their function and whether they are active high or low. This step is crucial for organizing the setup and making it easier to troubleshoot and understand the flow of data and control signals within the system.
⏲️ Implementing an Edge Detector Circuit
In the final part of the video, the creator focuses on refining the RAM write operation to occur only on the leading edge of the clock signal. They implement an edge detector circuit using a capacitor and a resistor to ensure that data is written to RAM at the precise moment the clock signal goes high. This modification ensures that the RAM write operation is synchronized with the clock's rising edge, preventing data from being written during the entire high state of the clock signal. The creator tests this setup and confirms that the RAM module now correctly writes data only during the initial 10 microseconds of the clock's high state.
Mindmap
Keywords
💡RAM module
💡Power up
💡Program mode
💡Pull-up resistors
💡DIP switch
💡Memory address register
💡Control logic
💡Edge detector circuit
💡Instruction register
💡Binary to decimal converter
Highlights
Powering up the RAM module for the first time to test its functionality.
Observing the clock running and switching to program mode.
Writing all zeros to memory and encountering an issue with ones being written instead.
Hypothesis that ones are the default input due to pull-up resistors on chip inputs.
Testing the hypothesis by setting specific bits and observing memory writing.
Identifying a wiring mistake with power and ground connections.
Fixing the wiring and retesting the memory writing with all zeros.
Writing different patterns to memory and verifying successful storage.
Switching to run mode and using the memory address register.
Demonstrating the ability to read data from specific memory addresses.
Testing the write operation from registers to memory.
Unexpected behavior of the memory address register writing to all ones.
Using a reset signal to return to address zero for further testing.
Labeling control signals for easier reference and troubleshooting.
Creating an edge detector circuit for the RAM in signal using a capacitor and resistor.
Calculating the time it takes for the capacitor to charge and its impact on the RAM in signal.
Testing the edge detector circuit to ensure data is written on the leading edge of the clock signal.
Final verification of RAM module functionality before moving on to the program counter.
Anticipating future work on the output register and binary to decimal converter.
Transcripts
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
Ver Más Videos Relacionados
RAM module build - part 3
[Part 1] Unit 3.3 - Memory Units
Lecture 5 Program structure, syntax and program to print single character in assembly language urdu
RAM module build - part 1
No Contact Fluid Sensor
Angular Login and Signup Page | Local-Storage | angular tutorial | angular tutorial for beginners
5.0 / 5 (0 votes)