RAM module testing and troubleshooting

Ben Eater
10 Sept 201616:42

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

00:00

🔌 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.

05:00

🔍 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.

10:02

🏷️ 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.

15:04

⏲️ 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

RAM, or Random Access Memory, is a form of computer memory that can be read and changed in any order, typically used to store working data. In the video, the RAM module is the primary focus, as the creator is building and testing this component. The RAM module is essential for the computer's operation as it allows for the temporary storage and retrieval of data.

💡Power up

To 'power up' refers to the process of supplying power to a device or system, enabling it to operate. In the context of the video, the creator is powering up the RAM module to test its functionality and ensure it works as intended. This is a critical step in the testing phase of any electronic device.

💡Program mode

Program mode is a setting in which a device is configured to accept and store data. In the video, the creator switches to program mode to write data to the memory. This mode is essential for initializing the memory with specific data patterns to test the RAM module's ability to store and retrieve information accurately.

💡Pull-up resistors

Pull-up resistors are used in digital circuits to ensure that an input pin is at a high logic level when not actively driven by a signal. The video mentions that inputs on the 7400 and 74LS series chips are pulled up, which means they default to a high state when not connected. This is significant because it explains why the memory initially displayed ones, as the inputs were not connected and thus defaulted to the high state.

💡DIP switch

A DIP switch, or Dual In-line Package switch, is a type of electronic switch typically used for inputting binary or decimal numbers into a system. In the video, the DIP switch is used to control the input to the RAM module. The creator inspects the connections related to the DIP switch and identifies a wiring error that needed correction.

💡Memory address register

The memory address register is a component that holds the address of a memory location. In the video, the creator tests the functionality of the memory address register to ensure that data can be written to and read from specific memory locations. This is crucial for the proper operation of the RAM module as it allows for the selective access of stored data.

💡Control logic

Control logic refers to the part of a computer system that manages the flow of data and operations within the system. In the video, the creator discusses how the control logic would handle writing data to memory. Understanding control logic is vital for the proper functioning of the computer, as it dictates the sequence of operations and data flow.

💡Edge detector circuit

An edge detector circuit is a type of circuit that triggers on the rising or falling edge of a signal. In the video, the creator constructs an edge detector using a capacitor and a resistor to ensure that data is written to the RAM only on the leading edge of the clock signal. This precise timing is essential for the accurate operation of the memory module.

💡Instruction register

The instruction register is a part of a computer's central processing unit (CPU) that holds the current instruction being executed. In the video, the creator labels the instruction register and its associated signals, indicating its importance in the data processing and instruction execution within the computer.

💡Binary to decimal converter

A binary to decimal converter is a device or circuit that translates binary numbers into their decimal equivalents. The video ends with a mention of a binary to decimal converter in relation to the output register. This component is significant as it allows the computer to represent and display numbers in a format that is more easily understood by humans.

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

play00:00

so in the last few videos we built

play00:01

pretty much all of the RAM module and in

play00:03

this video I want to power it up test it

play00:05

out and basically convince ourselves

play00:07

that it's working right so we'll power

play00:09

it up and it's on see the clock is

play00:11

running and we're going to switch to

play00:13

program mode and so we have all 0s here

play00:16

we have all 0s here so if we push the

play00:19

button in program mode it should write

play00:21

all zeros to memory and ok ok however

play00:26

making progress all right so it looks

play00:29

like we wrote oh I think I see what's

play00:33

going on oh boy so I'm just looking Colt

play00:38

very closely here and what I see so

play00:42

first off I guess the kind of explain

play00:44

was gone through my mind here so we

play00:46

wrote zeros here we did not we wrote

play00:48

ones here and whenever you see ones one

play00:52

thing to kind of think or maybe a

play00:54

possibility is that you know one is sort

play00:57

of the default input so if something's

play00:59

not connected you get a one because they

play01:01

all the inputs on all these 7400 series

play01:03

and 74 LS series chips are pulled up too

play01:08

they have like pull-up resistors on the

play01:11

inputs so that makes me think that you

play01:14

know maybe this is hooked up sort of

play01:16

correctly I guess we could test that

play01:17

actually if we maybe set that yeah so we

play01:20

if we set that bit it's writing that

play01:22

there if we turn that off it's not

play01:24

writing it but no matter what we set

play01:25

these two I'm guessing it won't change

play01:28

yeah so that doesn't that does nothing

play01:30

happens there so that makes me think

play01:31

that we got this hooked up right we

play01:33

don't have this hooked up right and the

play01:34

first thing that I notice just just

play01:37

inspecting it I see that I am I might be

play01:42

off by by a couple are off by one here

play01:46

to the power should be going to pin 16

play01:49

here and I see it's going to pin 15 and

play01:52

then also this this ground should be

play01:55

going to pin 15 it looks like it's going

play01:57

to pin 14 but then I would expect oh

play02:00

yeah okay so I do have I do have this

play02:04

this input from the dip switch that two

play02:09

comes across and that goes to pin 15 of

play02:11

course you can see

play02:12

that's correct but it's just these two

play02:14

wires are just off by one so I just need

play02:16

to shift these over to the left so let

play02:19

me pull the power off and do that so

play02:21

this shift over and of course you know

play02:24

if this if this chip wasn't powered

play02:26

which it wasn't you know the power was

play02:28

was not connected this is fallen out

play02:30

whoo boy yeah so this chip wasn't

play02:33

powered then you know its outputs would

play02:35

be would be floating and the inputs on

play02:39

these chips default to ones and so

play02:40

whenever we do a write it just it just

play02:42

writes all ones so that explains the

play02:44

behavior that we saw so now I need to

play02:47

figure out how to find a good place for

play02:52

this ground what can I get it to reach

play02:58

yeah think that'll work okay let's give

play03:03

this try so if we power it up we get

play03:06

some random stuff in memory there but

play03:09

with these all zeros if we write we get

play03:12

all zeros so it looks like that might

play03:14

have fixed it so let's try setting a

play03:17

different pattern in here and write that

play03:22

okay looks like we write that and if we

play03:25

switch to address one we get some other

play03:27

random garbage and if we go to all zeros

play03:30

here and right there then we got all

play03:33

zeros if we go back to address zero we

play03:36

should see yep we see that pattern

play03:39

that's in address zero and roots one we

play03:42

go to address two we get random stuff

play03:44

but we could put in you know some other

play03:47

pattern like that if we go back to

play03:49

address zero we see that if we go to

play03:51

address 1 we get 0 so it looks like we

play03:54

are able to put whatever data we want

play03:58

into memory by selecting the address

play03:59

here selecting the data we want here and

play04:01

pushing this button here to write that

play04:03

data in that address so now if we go to

play04:07

run mode then we should be now using the

play04:10

memory address register here and it

play04:13

looks like that's pointed to address 0

play04:16

and so we're seeing what's in address 0

play04:18

there now in this case we want to go to

play04:22

address 1 we've got two kind

play04:24

set our our our a one on the bus here so

play04:29

we want to set these top three bits to

play04:31

zero and then of course the bottom that

play04:33

will default to one when we when we set

play04:37

our read signal here so this is our read

play04:40

and actually let me stop the clock for a

play04:41

second here so if we say we want to well

play04:43

write I guess from the from the

play04:45

registers per seconds we're going to

play04:47

write to the bus a 1 0 0 0 so if we set

play04:51

this enabled there then on the next

play04:54

clock pulse we get a 1 in our headers

play04:58

register and of course we see the 0

play05:00

because we have a 0 in that location of

play05:02

memory if we want to go back to address

play05:04

0 then we have to set all four of these

play05:06

bits low so let's go ahead and set that

play05:09

forth bit low and so this signal is

play05:11

still inputting a right signal so on the

play05:15

next clock pulse it should put a 0 into

play05:17

the register here and that goes to 0 and

play05:19

we see the the memory that are the the

play05:22

data that's in that memory location 0

play05:24

and we can try going to memory address 2

play05:27

and on the next clock pulse whoops did I

play05:33

oh I just have these wires mixed up let

play05:38

me put these in the right order here so

play05:39

I'm not confused there we go so this

play05:43

should be addressed to on the next clock

play05:44

pulse

play05:45

yep puts it to there and then this is

play05:46

the data that we had stored in address

play05:49

location 2 so it looks like the memory

play05:51

address register is working that's great

play05:54

now if we want to read this data from

play05:57

the the bus or read this data and put it

play06:00

on the bus again we're going to connect

play06:02

the bus over here and we can hook up

play06:05

some LEDs just to to see for now what's

play06:09

over here and like I did before I'm just

play06:16

going to connect 3 of these LEDs just to

play06:19

give us an idea so if we want to output

play06:21

well right now so we have location 2 in

play06:24

our address register and if we want to

play06:26

take the data that's in location to put

play06:27

that on the bus then that's this signal

play06:29

here we take that low and we see well at

play06:32

least the bottom 3 bits it looks like

play06:34

we're outputting that

play06:35

and I guess we can we can move this led

play06:37

here and see yeah that fourth bit is is

play06:40

set there and then the fifth bit should

play06:44

be off sixth bit should be off seventh

play06:48

bit should be on and the eighth bit

play06:51

should be off okay so it looks like it's

play06:54

out putting this thing on to the bus

play06:58

when we tell it to and then when we tell

play07:01

it not to it doesn't so then I think the

play07:04

only other thing we want to test is make

play07:05

sure that when we want to take data from

play07:07

the bus and put it into memory that we

play07:10

can do that and so in that case I'm

play07:11

going to take these LEDs out of the way

play07:13

and I'm going to use these wires here to

play07:17

put a value on the bus so again you know

play07:20

these are going to these are going to

play07:22

default high so I'm just going to set a

play07:24

couple of these I'm going to set this

play07:26

second bit low and let's say the third

play07:31

bit low may be the sixth bit low and the

play07:38

seventh bit low just those four bits I'm

play07:41

going to set low and then I'm going to

play07:45

use this signal down here which is our

play07:47

our right signal so you know we've got

play07:50

this address one in the memory address

play07:52

register so we see what's in memory

play07:53

location one here we saw that we can

play07:55

help with that too the bus now we have a

play07:57

value that a different value that want

play07:59

input from the bus and store in that

play08:00

memory location and so if the control

play08:03

logic of the computer wants to do that

play08:05

then it would set this high to say I

play08:07

want to write to memory and then on the

play08:10

next clock pulse which if you can see

play08:14

all of this and I just pulse the clock

play08:17

here and we should see this new data go

play08:19

into memory and there it is so that new

play08:22

data is in memory oh it's something

play08:25

something interesting happened here you

play08:26

see the address changed to all ones and

play08:28

that's because we're also writing to the

play08:31

memory address register

play08:32

normally that would never happen because

play08:33

you wouldn't write to the memory address

play08:36

register and the data at the same time

play08:38

you'd want to to do one of the other so

play08:41

let me back up a second

play08:44

and turn off the writing to writing the

play08:47

data to memory then I want to go back to

play08:51

address one actually let me just double

play08:52

check here address two it looks like it

play08:57

wrote it there too

play09:02

we'll go back actually might me would be

play09:05

easier here is is we can use this reset

play09:07

signal and just reset to address zero so

play09:10

we're here we're at address zero and we

play09:13

want to not write to the address

play09:16

registers we don't want to change the

play09:18

address we only want to change the

play09:20

contents at that address we want to stay

play09:21

on address zero and then we want to

play09:23

write to that address this data until

play09:27

then on the next clock pulse yes it

play09:30

writes this data into memory so I'm

play09:33

reasonably convinced that that this is

play09:35

working now you know it's not a total

play09:38

test of every connection so there might

play09:41

be like one bit that's not hooked up

play09:44

quite right and we'll we'll probably

play09:46

find that later on when we start hooking

play09:48

everything up together and running more

play09:50

complex programs things will see some

play09:52

subtle issues which are always fun to

play09:54

troubleshoot but at least at least at a

play09:57

quick quick sort of test it looks like

play09:59

everything is working more or less the

play10:02

way that we want one other thing I'm

play10:04

going to do just as kind of a

play10:06

convenience thing is we've got all these

play10:08

little control signals everywhere I'm

play10:09

going to I'm going to label them just to

play10:11

make life a little bit easier for me so

play10:14

if we go up to the clock this signal

play10:17

here is the the halt signal I'm just

play10:20

going to stick a little label there that

play10:22

says this is this is halt which halts

play10:26

the clock this is the memory address

play10:30

register in signal so when this is when

play10:34

this goes low we're going to input a

play10:36

value into the memory address register

play10:38

so I'm going to call that M I for memory

play10:40

address register in and I've got the bar

play10:43

there because it's a active low so

play10:46

normally want that high this is the RAM

play10:50

out signal so yeah when this is when

play10:53

this goes low as an active low when this

play10:55

goes low it outputs the

play10:57

of RAM to the bus so mark that is ro for

play11:04

RAM out and that's active low so we'll

play11:09

keep that high normally and then of

play11:16

course the input from input from the bus

play11:19

to RAM we've got the RAM in signal down

play11:21

here so I'll mark that as RI for RAM in

play11:27

and that's active high so I don't have

play11:29

the bar there so normally that will be

play11:31

low unless we're inputting from RAM and

play11:34

then while we're here since we've got

play11:36

the instruction register down here I'll

play11:37

label those as well this is the

play11:39

instruction register out so this will

play11:42

output whatever is on the in the

play11:43

instruction register to the bus so

play11:47

that's the i/o and that's an active low

play11:49

so normally that'll be high unless we're

play11:51

outputting the contents of the

play11:53

instruction register to the bus and

play11:55

finally the the instruction register in

play11:58

so this will input data from the bus and

play12:00

store it in the instruction register and

play12:02

that's also active low so that's III and

play12:07

then normal that'll be high and actually

play12:11

one last thing that I want to do which

play12:13

is when we're for the RAM in when we're

play12:16

writing data from the bus into Ram which

play12:19

you'll notice if we set this high so

play12:21

we're Ram in when the clock signal goes

play12:24

high you see that this is all zeros and

play12:29

that's because when the clock signal is

play12:32

high we're writing for the entire

play12:33

duration of the of the clock signal high

play12:35

really what we want to do is write just

play12:37

on the leading edge of the clock so

play12:39

right now we're landing the clock and

play12:42

the RAM in signal oops you can't quite

play12:44

see that we're Nanding the clock and the

play12:46

RAM in signal so this this white pin one

play12:50

here is the clock and this is the RAM in

play12:53

signal but really what we want to do is

play12:55

we want to look at the ramming signal

play12:58

and just the leading edge of the clock

play12:59

and just at that moment where the clock

play13:01

goes high not the entire time that it's

play13:04

high we want to actually that's the

play13:06

that's the moment that we want to read

play13:07

data from the bus and

play13:09

put it into into RAM here so we can do a

play13:11

really simple edge detector circuit by

play13:14

pulling this pin low and then instead of

play13:18

inputting the clock directly into that

play13:21

pin if we if we go through a capacitor

play13:27

then what will happen is this will only

play13:30

be high for the time it takes the

play13:32

capacitor to charge through this

play13:33

resistor right because the clock will go

play13:35

high so we get five volts over here and

play13:39

then of course we've got zero volts

play13:41

we've got ground here and so this will

play13:44

charge through the capacitor and while

play13:45

it's charging this pin will be high but

play13:49

as soon as the capacitor charges current

play13:50

will stop flowing through the capacitor

play13:51

and this will go low again so it will

play13:54

only be high for the for sort of that

play13:56

moment that it takes for the capacitor

play13:58

charge so this is a this is a point zero

play14:00

one micro farad capacitor and this is a

play14:02

1k resistor so a 0.01 micro farad

play14:09

capacitor and a 1k ohm resistor and so

play14:13

if we want to know the time it takes for

play14:16

this to charge we just multiply these

play14:17

together but first we've got to get it

play14:19

into into standard units so 0.01 micro

play14:22

farad's in standard units which we

play14:24

farad's would be zero point zero zero

play14:28

zero zero zero zero zero one farad's

play14:33

times and then 1 kilo ohm is one

play14:37

thousand ohms and if we multiply these

play14:41

two together basically we're just moving

play14:43

the decimal point over three here so we

play14:45

get zero point zero zero zero zero one

play14:48

and then the answer will be in seconds

play14:51

and that'll be the time that it takes

play14:53

for the capacitor to charge and so in

play14:57

other words at point zero zero zero one

play14:59

seconds is going to be ten ten

play15:03

microseconds so basically the the right

play15:07

signal here that ends up going to the 74

play15:10

LS 189 s are our actual ram chips in

play15:13

this in this scenario it was only going

play15:14

to be ten microseconds so it's just

play15:16

going to be four for an instant it's

play15:17

going to write

play15:18

whatever is on the bus in that instant

play15:20

when the clock goes high which is which

play15:22

is exactly the moment that we want to

play15:24

register that so we can kind of test

play15:27

this out now right now we have this

play15:31

value in the bus if we just change one

play15:33

of these bits to something else we've

play15:35

got our RAM in notes can't quite see

play15:37

I've got a ram in signal high here so on

play15:40

the next clock cycle it should write

play15:43

that value in here we'll just change

play15:45

this this this bit here to high and so

play15:48

on that clock signal you see it goes

play15:50

high it doesn't matter how long that

play15:52

clock signal is it's it's just the first

play15:55

10 microseconds of the clock that it's

play15:57

using to clock in that new value and so

play15:59

if we change this value on the bus new

play16:02

clock doesn't matter how long that clock

play16:06

signal is it's the first 10 microseconds

play16:07

that clocks in that value so now we have

play16:09

a little bit of an edge detector here as

play16:11

well so so that pretty much should do it

play16:14

this this here is our Ram module I think

play16:16

we we've pretty much got everything

play16:18

working at least the first initial tests

play16:21

that we can do here so I think in the

play16:24

next videos will either work on the

play16:27

program counter which is a fairly simple

play16:29

circuit or I think I'll do that first

play16:33

and then and then I'll get into the the

play16:35

actual output register which is which is

play16:37

kind of interesting because we're going

play16:39

to do a binary to decimal converter

Rate This

5.0 / 5 (0 votes)

関連タグ
RAM TestingDebuggingComputer HardwareElectronicsMemory ModuleDIY ProjectTech TutorialCircuit AnalysisLogic GatesDigital Systems
英語で要約が必要ですか?