RAM module build - part 2
Summary
TLDRIn this instructional video, the presenter builds a 16-byte memory system with 4 address lines and 8 data lines, utilizing a 74 LS173 4-bit register for address selection. They explain how to connect the address lines to the register and introduce a programming mode using DIP switches for manual address and data setting. A 74 LS157 quad two-line to one-line data selector is employed to toggle between the DIP switches and the address register. The video concludes with a demonstration of switching between run and program modes, setting up for future data line configuration.
Takeaways
- 😀 The video discusses building a 16-byte memory system with four address lines and eight data lines.
- 🛠️ A 74 LS 173 4-bit register is used to connect the memory address lines to the address register.
- 🕹️ The memory system includes an 8-bit Tri-State buffer for outputting data to a bus.
- 🔌 The clock module is connected to the memory system, even though it's not directly related, for layout purposes.
- 🔄 The 74 LS 157 quad two-line to one-line data selector is introduced to toggle between the address register and dip switches.
- 🔲 The video demonstrates how to use dip switches to manually set memory addresses for programming the computer.
- 🔵🔴 Indicator LEDs are used to show the current mode of operation (programming or run mode).
- 🔑 A double throw switch is used to toggle between programming mode (using dip switches) and run mode (using the address register).
- 🔄 The video shows how to connect the address register outputs to the memory address inputs and verify the functionality.
- 🔍 The process of switching between different memory addresses using the address register or dip switches is demonstrated.
Q & A
What is the purpose of the 16-byte memory being built in the video?
-The purpose of the 16-byte memory is to store 16 bytes of data, which can be read from or written to using the four address lines, eight data lines, and an 8-bit Tri-State buffer for output to a bus.
What is the function of the 74 LS 173 in the memory system described?
-The 74 LS 173 is used as a 4-bit register to store the memory address, allowing the system to select which of the 16 bytes is being read or written to.
Why is the clock module connected to the memory system even though it's not directly related?
-The clock module is connected to the memory system for layout purposes, as the final computer design will have the clock module positioned just above the RAM.
How does the video demonstrate switching between programming mode and run mode?
-The video demonstrates switching between programming mode and run mode by using a double throw switch to toggle between the dip switches and the address register, with indicator LEDs showing the current mode.
What is the role of the 74 LS 157 in the memory system?
-The 74 LS 157 is used as a quad two-line to one-line data selector, allowing the system to choose between the address provided by the dip switches (programming mode) or the address from the address register (run mode).
How are the dip switches used in the memory system?
-The dip switches are used to manually set the memory address in programming mode, allowing for direct input of data into specific memory locations.
What is the significance of the strobe input on the 74 LS 157 chip?
-The strobe input on the 74 LS 157 chip acts as a master enable. When the strobe is low, it enables the chip, allowing the selection between the A and B inputs.
How does the memory system handle inputting data into the memory address register?
-The memory system handles inputting data into the memory address register by using the data enable pins on the 74 LS 173 register, which control whether the input from the bus is clocked in on the clock pulse.
What is the purpose of the current limiting resistors used with the indicator LEDs?
-The current limiting resistors are used with the indicator LEDs to prevent excessive current flow, which could burn out the LEDs, by limiting the current when they are connected directly to 5 volts.
How does the video ensure the memory system is not constantly resetting?
-The video ensures the memory system is not constantly resetting by managing the clear signal on the 74 LS 173 register, which needs to be kept low to prevent constant clearing of the register.
Outlines
💻 Building a 16-byte Memory System
The script begins with the construction of a 16-byte memory system using a 4-bit address to select one of the 16 memory locations for reading or writing. It features eight data lines for inputting data into the selected memory location and eight buffered output lines through an 8-bit Tri-State buffer for bus communication. The focus then shifts to connecting the address lines to an address register using a 74 LS 173, a 4-bit register. The presenter also discusses the integration of a clock module for synchronization and the need for a memory address register to manage memory addressing. The aim is to connect the memory address register to the memory and allow for manual data input via DIP switches for computer programming, necessitating a switch between register control and switch control.
🔌 Wiring the Address Selector Circuit
This section delves into the wiring of the address selector circuit using a 74 LS 157, a quad two-line to one-line data selector. The chip allows toggling between the address register and DIP switches for memory addressing. The presenter explains the functionality of the 74 LS 157, including its use of an enable strobe and the process of selecting between the A and B inputs. The wiring setup is detailed, including the connection of the address register outputs to the selector and the DIP switches to the selector's A inputs. The script also covers the use of a double-throw switch to toggle between programming and run modes, with indicator LEDs to show the current mode.
🔄 Configuring the DIP Switches and LEDs
The script continues with the configuration of DIP switches for manual memory addressing and the setup of indicator LEDs to reflect the current operational mode. The presenter discusses how the DIP switches, when off, default to inputting all ones and, when on, input zeros due to the internal pull-up resistors in the TTL chips. The switches are connected to the A inputs of the 74 LS 157 selector, allowing the user to control memory addressing manually. The LEDs are wired to indicate the current mode, with a red LED for programming mode and a green LED for run mode. The presenter also addresses the initial confusion regarding the LED indicators and resolves it by suggesting to reverse the switch orientation.
🔄 Switching Between Run and Program Modes
The focus of this part is on the functionality of switching between run and program modes using the 74 LS 157 selector and the double-throw switch. The presenter demonstrates how the selector's output changes based on the mode, reflecting the DIP switch settings in program mode and the memory address register's contents in run mode. The script includes a practical demonstration of how the memory system responds to address changes in both modes, showing that different memory contents are accessed based on the selected address. The presenter also discusses the need to connect the selector's outputs to the memory's address inputs for proper memory addressing.
🔄 Preparing for Data Line Integration
The final paragraph outlines the next steps in the project, which involve replicating the process for the data lines. The goal is to enable the setting of data using DIP switches during programming mode and then switching to run mode where the memory will use data from the bus. The script concludes with a summary of the progress made in setting up the memory section, including the ability to switch between run and program modes and address memory locations accordingly.
Mindmap
Keywords
💡Memory
💡Address Lines
💡Data Lines
💡Tri-State Buffer
💡74 LS 173
💡Clock Module
💡DIP Switches
💡74 LS 157
💡Programming Mode
💡Run Mode
Highlights
Building a 16-byte memory system with 4 address lines and 8 data lines.
Utilizing 74 LS 173, a 4-bit register, for memory address storage.
Connecting the memory address register to the bus for dynamic address input.
Integrating a clock module to synchronize memory operations.
Describing the function of the 8-bit Tri-State buffer for memory output.
Implementing a switch to toggle between programming and run modes.
Using 74 LS 157 for selecting between address register and DIP switches.
Configuring DIP switches for manual memory address and data input during programming mode.
Explaining the logic behind the address selection with AND and OR gates.
Demonstrating how to set the memory address using DIP switches in programming mode.
Connecting indicator LEDs to show the current mode of operation.
Powering up the system and testing the address register functionality.
Observing memory contents change with different addresses in programming mode.
Switching to run mode and using the memory address register to access memory.
Discussing the next steps for data line integration in the memory system.
Previewing the upcoming video's focus on data lines and bus integration.
Transcripts
so in the last video we started building
this 16 byte memory uh which is able to
store 16 bytes uh we've got uh the four
address lines here to select which of
the 16 bytes we're we're reading or
writing to uh we've got eight data lines
for inputting the data that we're going
to write into the the memory location
that's selected with the address line
and we've got our eight outputs that are
buffered through this uh uh 8bit
Tri-State buffer so we can output to to
a bus in this video what I want to do is
um you know start to connect the address
lines here to our address register and
since the memory address is Just 4 bits
we can we can use the 74 LS 173 that
we've used in the past which is a 4-bit
register so I'm going to start by uh
just getting another breadboard and and
connecting it up
here like that I'm also going to remove
this this top one and and connect the
clock module that we built uh in in some
of the F earlier videos um and it's not
that the clock module is directly
related to the memory at all but just
the final layout of the computer we're
going to have the clock module just
above the the
RAM and so now that gives us room in
here that we can go ahead and put
together our memory address register U
which is going to connect into our
memory address lines here so I'm going
to just get these out of the way for now
just move them all down
here just give ourselves a little bit
more
room so the memory address register
we're going to use the 74 LS
173 uh that we've that we've used many
times before for registers and I'll hook
that up over here uh that's going to be
connected to the bus because uh at at
various points we're going to have
memory address appear on the bus and
we'll want to bring that in and store
that in the memory address register
which will then be connected to to our
memory to tell it what address to uh to
address and and then once that address
is set there then we'll either output
contents from the bus or we might input
uh a new value from the bus into the
memory uh but while we're inputting or
outputting from the memory we need to
store the address to which we're storing
or reading from uh in this in this
address register uh so we could just uh
you know it seems like it'd be simple
enough to just take these address lines
and hook them up to this register and
and whatever stored in that register
will be the address that we're pointing
to in our in our memory here uh but we
don't want to just do that we also want
to be able to program the computer and
when we program the computer we
basically want to just switch the the
memory into a totally different mode
where we're able to set the address and
set the data uh by hand with uh with
like dip switches like
this and so we want to have some
switches here that allow us to set what
address we're we're pointing to and then
we'll have another set of dip switches
where we can set the data that we want
to write into that memory location uh so
we can program the computer by hand and
then we want to be able to switch out of
programming mode and use this register
so we basically want to we want these
address lines um to either be hooked up
to the register or so that the memory
can be addressed by uh you know data
coming in from the bus or an address
coming in from the bus or we want to be
able to set the address with these
switches and we want to be able to
switch between those two things you know
you can imagine we've got four bits over
here of address and we've got four bits
over here of address set on these
switches how do we switch between those
well this is this is a a fairly
straightforward uh circuit that you can
we can kind of Reason through that
allows us to select between two
different uh values so for example and
this is just one bit so for
example the the first bit of our address
uh that's stored in our register might
be a and the first bit of our address on
these switches might be b um and then we
can select which of those we want to use
using the select signal and you can kind
of see how that works where if select is
high then this input to the end gate
will be a one um which means that if
this other input to the end gate is a
one uh then the output's a one if this
input's a zero then the output's a zero
uh so if we're if select is a one then
this a signal is just based basically
going to pass through the and gate um
and because this is inverted this and
gate will definitely always be a zero
because we'll have a zero coming in here
um and then the or gate will just be
whatever is coming in a if select goes
low then this and gate is basically
always going to be off because we'll
have a zero coming in here um and we'll
have a one coming in here so this and
gate will pass through the B and then of
course the orgate it'll be a zero or
whatever B is and so the outut will just
be whatever B is um and so by setting
the select high or low we're selecting
whether we want a or b uh to appear on
this output conveniently there is a chip
that does exactly this it's the 74 LS1
157 which is a quad two line to one line
data selector so we're selecting between
you know from two lines to one line uh
which is which is kind of what we just
described and you can see here on the
data sheet uh it has um essentially four
copies of that of that circuit uh so you
can see the two end Gates and the orgate
which is what we were just looking at
here the two end Gates and the orgate
and then the inverter uh down here for
select that's inverting uh depending on
which whether whether we're selecting
the a the Four A's or the Four B's so
there's a single select that selects
between all four A's or all four B's um
this also you can see there's a third
input on all of these and Gates that
goes to the strobe um which is basically
just kind of a master enable um so as
long as the strobe is low then this
third input all these an Gates will be a
one and and essentially that enables the
whole chip so we'll just tie this low
for for our purposes and and then it'll
it'll essentially just behave uh like
like this uh circuit that I just showed
you um and so if you look at the pinout
for the 74 LS 157 you can see of course
we have our select input selecting A or
B and then you can see there's an A and
an output ab and an output uh ab and an
output ab and an output so it's
basically four of these that are all
tied to a single select um and then of
course we have our ground and our power
and then this strobe line which I said
we'll tie low to just to enable the
thing so this 74 LS 157 um will
basically allow us to select you know
and toggle between do we want to use the
switches to set the address of our
memory or do we want to use the memory
register to set the address of our
memory so I'll go ahead and add the 74
LS 157
here we can connect the
power uh
and ground here so connect the power for
that guy um and
then remember this uh pin 15 is this
strobe which we just want to set low to
enable this chip so we'll just set that
low and then while we here I can also
connect the power power for our address
register the 74 LS 173 so power and
ground I'm going to pull these LEDs out
of here and we're just using those for
testing uh so we got that powered
up and then the 74 LS 173 this is uh
what it looks like and remember again
you know it's got four uh D flip-flops
that are that are storing our four bits
in our register and we have um you know
our output control which if one and pins
one and two are are low
then our output is enabled and and we
always want that to be the case so we'll
go ahead and tie pins one and two low so
that our output is always
enabled and then we also have our uh our
data enable pins 9 and 10 and that
controls whether the input which is
going to come from the bus is is being
clocked in on on the clock pulse so this
is going to be a control signal uh to to
tell it to store whatever's on the bus
in this register so that's pins 9 and 10
so I'll hook pins 9 and 10 together and
then that's just a control signal that
we'll need to set either high or or low
uh to control whether we're storing a
new value in
here then pin seven is our clock so we
can hook that up to our clock up here
which we've now got
nearby so now these four pins here uh 11
12 13 and 14 are the the inputs for our
register and so those will be connected
off to our bus at some point uh and and
then our outputs are pins 3 4 5 and six
so we can connect the outputs to one of
the the two inputs of the one of the 74
LS 157 right because it has these A and
B inputs for the four uh the four bits
that it that it has um so let's go ahead
and connect the four bits of the
register to the to the four B inputs and
then we'll connect our dip switches to
the a inputs
okay so now the outputs of our uh memory
address register are going into one of
the inputs of our 157 74 LS 157 selector
so we'll be able to select either this
or the the dip
switches so now to hook up the dip
switches to the other input of the 74ls
157 what I want to do is take advantage
of the way that the inputs on these
chips work which is for for most of
these TTL chips that we're using
the inputs are are tied High there's a
resistor inside these these chips that
connects the input uh to to plus 5 volts
so if we don't connect these switches to
here at all then the a inputs on on this
will all be ones by default and if we
then connect some of the inputs to
ground then those inputs that we connect
to ground will be zeros and the rest of
the inputs that aren't connected will be
ones so what we can do is we can connect
this to the switches and then the
switches we can use to to selectively
connect a PIN to ground or not so for
example for the first bit here um pin
two is the a input pin uh three is the B
input and pin four is the output so for
the B input we already have that
connected up to our register for the a
input I can connect that
to uh the first switch here on our dip
switch and if it's off like this then
it's not connected this is going to be a
one if I turn it on then it will
complete the circuit over to this side
and if I connect that side to ground
then turning this on will connect this
to zero and so on is zero and then off
will be a one because it's not
connected and I can do the same thing
for the second bit connect the second
switch to the a input of our second
selector here and connect the other side
of this switch again to ground
and so if the switch is off then this
input is defaults to a one if the switch
is on then it connects it to ground and
it takes this down to a
zero same thing for the third bit in
this case the input is up here on on the
top side of the chip so I can just kind
of run through the uh the switch the
other
way and connect the ground down here and
so then again if the switch is on then
it connects the ground to that pin if
it's off then it doesn't and so then it
defaults to a
one and then finally for the last bit I
can do the same thing and connect to
ground here one thing that's a little
bit confusing about this is that when
the switches are in the down position
here when they're off uh then basically
we're inputting all ones and if they're
up like this they're all up they're all
on that means that we are we are
connecting all of these inputs to ground
and so we're inputting all zeros so it
might be a little bit confusing because
usually you would think down would be
zero and and up would be a one um
fortunately there's a pretty easy
solution to that which is turn the
switch around so that uh when the switch
is down it's on and when it's up it's
off so now we have the 74 LS 157 which
can select between either the dip switch
input or the address register input but
we need to have some way of telling it
which one we want so I'm going to add a
switch here that we can toggle between
the dip switches and the address
register and this is a double throw
switch so we can connect the center pin
here to ground um and then depending on
whether which position the switches in
whether we have pushed in or pushed out
uh it'll connect that ground to either
the left pin or the right pin and so
something I want to do just to make this
a little bit I don't know maybe a little
nicer to use is have uh some indicator
LEDs to tell us which position the
switch is in I you can look at the
switch and see but um I like having
these indicators so we can tell if the
computer which mode the computer is in
because we definitely want to be able to
tell pretty easily whether the computer
is in programming mode which will be the
red LED on or in run mode which means
the the green LED is on so what I'll do
is connect the the switch up here to
both of these LEDs so one side of the
switch to the red LED and the other side
of the switch to the green LED
and then the other side of the LED will
hook up to our 5 Vol through these
current limiting
resistors and we need currently many
resistors here uh you know because we're
connecting you know when whichever
position the switch is in we're going to
be connecting directly from 5 volts
through the LED to ground and so without
a current limiting resistor we'll be
pushing tons of current through the LED
and we'll burn it out uh we don't need
those in these cases because these chips
have uh resistors you know essentially
resistors on the The Collector side of
the outputs so it's already going to
limit the current that it can drive but
in this case we do need them and so if I
go ahead and connect up some power here
just to kind of show you what we've what
we've got so far let me uh just hook up
connect my power all the way through
here and then hook up power to this
whole
Board of course we've got our clock
going and something in our memory uh but
what you'll see now is depending on how
we toggle the switch uh it selects
either green or red basically um but the
other thing that happens is what this is
really doing is selecting uh which of
these two things is grounded and so in
this case the the red LED uh here is
grounded and in this case the green LED
is grounded to you know complete the
circuit from the 5 volts uh through the
resistor here uh and so what we can do
is we can connect you know the the red
LED side here to pin one of the 74 LS
1557 and pin one is the select pin which
selects which of the two inputs we're
going to use and so if we're on the the
red LED essentially pin one then goes
low and we're uh let's see which one are
we selecting so if uh select is low then
it looks like we're we're selecting the
a input uh so if we're on the red LED so
if pin one is low then we're selecting a
which is our dip switches so red LED on
means that we're using our dip switches
which means we're in programming mode
because we're using our dip switches to
program the computer and then if we
modes here uh then this is no longer
connected and so pin one will default to
being high in which case it's going to
use input two or B rather input B which
is our our register over here and so
we're going to be using the the address
register of course this will make a lot
more sense if we hook up the outputs of
the 74 LS 157 so we actually see what's
going
on okay so there's our outputs and now
now if we start here in run mode it's
going to you know our output here will
be whatever we've got in the register
which appears to be all zeros either
that or it's not working right and if we
switch to program mode then the output
here should reflect whatever our dip
switches show so 0011 makes sense if we
turn those off it's all zeros and you
can see it's it's just you know whatever
we put in our dip switches here is what
we're getting out here and then if we
switch to back to run mode you see we
get all zeros and that's um presumably
what is stored in this uh register and
we can try to get something else in this
register I think if we set the input
signal uh low here we should
see well I would expect it to read in
all ones because none of these inputs
are connected um oh but our our reset
signal is also not connected so this is
constantly being reset so um yeah pin 15
is the clear signal so we want to keep
that
high actually I think we want to keep it
low right okay that might make more
sense yeah so we want to we want our
clear signal to be low so that we're not
constantly clearing this right because
it would it would be defaulting to be
High um and
then if we bring our data enable low
then it should read in um whatever is on
the bus here which is which is going to
default all ones but we could try
hooking a couple of these bits let's
just hook up two bits here to
ground um and then set our our our input
signal low okay and then on the next
clock cycle it read that in um and so
that's what's in this register now okay
so it looks like we can we can input a
value into this register and it shows up
here if we're in uh run mode and then if
we switch over to program mode then we
get whatever we set on these
switches so now all we need to do is
just hook up our outputs here which
which right now are just going to these
LEDs and actually hook them into the
memory uh address input of our of our
actual
memory okay so now I've got our outputs
hooked up to our address line inputs of
our
memory so let's go ahead and power this
back up
again and so we can see it came up so
we're in program mode so the 0101 that
we have in our dip switches is what
we're seeing here and we're seeing
something random in memory so we don't
really know what that is but if we
change the address we should see
different things and there we go so if
we go to address zero we see that if we
go to address one we see something
different address
two something different address three
something different so there's something
different in each address I mean I guess
we don't know for sure if we're
addressing it right but I
I mean it seems reasonable that if we're
going to different addresses here we're
getting different things um and if we
switch out of program mode to run mode
uh we see this goes back to zero and we
see that we get this whatever random
thing was in address zero so it looks
like we're able to switch between run
and program mode and in run mode we are
going to be using whatever uh is in our
memory address register and actually we
can try to put that value back in here
if we switch this over there yep and we
can see when that changes we got to a
different address here if we go back to
program mode um we have the same address
set here so we see the same thing here
if we change
address yeah it looks like it looks like
we're able now to change our address
either in programming mode with our dip
switches or when we go to run mode it's
looking at whatever is in our memory
address register here which we can set
by um putting some value on these four
pins here uh which which will be
connected to the bus and then we'll have
a control signal to read from the bus so
great now uh in the next video we will
uh try to do the same thing for our for
our data lines um because again when
we're in program mode we want to be able
to use the dip switch to set our eight
data lines so we can set an address we
can set data and then we can write that
data into the memory and then we can
switch back to run mode and instead of
using the diff switches it'll use
whatever's on the bus so in the next
video we'll basically do the same thing
that we just did but for data lines and
that should wrap up everything we need
for our our memory section
関連動画をさらに表示
RAM module build - part 3
RAM module build - part 1
8-bit computer RAM intro
3. OCR GCSE (J277) 1.1 Von Neumann architecture
L-1.4:Types of Buses (Address, Data and Control) in Computer Organization and Architecture
Shift Register : Serial In Serial Out (SISO) Register Explained | Bidirectional Shift Register
5.0 / 5 (0 votes)