And we can choose whichever flip-flop we want by the address
And then we can strobe the W thing to write it to that one or that one, but what about reading?
How do we combine the two outputs from our?
Flip-flops into a single output
Which we'll call D out here
I'm going to move this paper, so will let me just copy that
quickly
So I've redrawn things now without the input side of things that circuit would be exactly the same
But to make things easy when we talk about how we get the output out
I've just wiped it away, so we can just refer to what we need so we've got the two flip-flops
Zero, and one again. We've got our address input, and we've got one output
Which we called D
Out now the first difference
From writing is that we don't need any sort of read signal to say we want to read the value because we have the output
always
Liv's throwing
Whatever's in flip got one or in flip-flop zero what we do need is to connect the output of flip-flop
zero, and the output of flip-flop wand
Combined with the address input to D out so that when there's a zero on here
We get what I was in that one there and whenever there's a one in there
We get whatever's
in
That one and the way we do that again is we use a NAND gate so we can start off by putting a NAND gate
in here
connected to
That so now we have when a in contains zero the output of here will always be zero
When a in contains one the output of here will be whatever the value of Q is
That's from the truth table
We saw for the last one and we can do the same just in the same way for this one here
So we can bring the output
down
And we can put it into a NAND gate and actually a NAND gate is symmetrical
So it doesn't matter which input we connect things to we can use a not gate
Again make that in there and connect that that so now whenever a in contains zero this
Output here this not gate contains one and we end that with this thing here
So we now have two values if a is from zero
Then this one has the value of Q
and this one is guaranteed to be zero because
that's going to be zero anything ANDed with zero is zero so the we'll always be zero if it contains 1 this will be 0
Because anything ended with zero from the not gate is 0 and this will contain whatever this value is Q it
So we now got two
Signals, which are either the value from the flip-flop if the right flip probably said that did 0 or want all it's 0
So you need to combine these two together to produce our output and the way we do that is by using
An or gate looking at the inputs like that so what's coming on here well
Let's think about the truth table for an or gate. We have our two inputs a and B and our output Q
so we've got a value of 0 and 0 0 or 0 is 0 0
or 1 is 1 1 or 0 is 1 and 1 or
1 is obviously 1 so what we've got happening here when 18 is 0
the output of this and gate
Is 0 so anything odd with 0 is?
whatever
The value of the other one is so B is 0 or 1 so the output
When this is here is whatever the value of this output is on the other hand if a in contains 1
This and gate will contain the value of Q and it goes in there, so it'll either be 0 or 1
But this one will be 0 because this well we won inverted 0 and it was 0 everything is always going to be 0
so we've got 0 on the second input so 0 or 0 is 0 1 or 0
Is 1 so again the output and my follows the other input and so we can very quickly just using a nor gate this time
Merge the outputs of the two and gates to create
D out and actually we could design the circuit so all of these things
Were done using NAND gates because they're one of the simplest things to build
Particularly as we've got the inverted outputs from a flip-flop again
You could build that out using many address lines and many all gates around gates to produce your whole
memory
and that's how
Static Ram like you'd find out here
Works you have the equivalent of a flip-flop for each bit and you have address pins that decide which ones are stored
but not quite
There's actually another trick to how the memory is arranged in your typical RAM circuit to make things fit onto a piece of silicon
easier
So what they actually do is?
Rather than having and we're going to use four flip-flops here rather than having them arranged in one
Long line like that we actually arranged them into a grid and so we now have two rows
0 or 1 and 2 columns
0 or 1 so in this case we'd have to address inputs a 0 and a 1
And we use one set of these to select which row it is and we use the other to select which column
It is so if we want to access flip-flop 0 then we select
row 0 column
0 not access for the foot 1 we select row 0 column
1
Want access flip for three we select Row 1 column 1?
So we have a grid effectively of cells where we can store our data, and then again
We have the multiplexer is using all gates to combine them together to produce output
And then we can stack these in 3d to produce the sort of 8-bit outputs like I've got here. So this is a
626 4 chip, which I've pulled out of the BBC micro made in West Germany that shows how old it is, it's probably made
Sitting by this week 15
1986 on here you've got 8 input outputs for the data and
a
read white select pin
5 volts input 0 volts input and the rest of it will be says 8
Case is 8 1 9 to memory locations. That's 2 to the power of
13 I think
And I shall also do 2 to the power of 12
2 to the power of 11 2 to the power of 10 so that Shawn can check it on the calculator
And select the right fitting that I've written down
So we have 2 to the 13, and if you look at the data sheet for this memory chip
which I should bring up on the laptop so you can see that we actually have a row decoder which gets 8 inputs and
a column decoder a zero a nine a 10 11 and a 12 so this
8192 members locations, and they arranged of a grid of
256 rows and
32 columns and of course is then stacked eight high so they can store each of the 8 bits
It's exactly like the way of streets and houses arrange to places like Manhattan
you've got a grid of
things and you select which
Street you want and which Avenue you want and you go to that intersection and that's where the memory location is stored
Only if the two inputs differ if they're the same then the outcomes are 0
So here we go a 0 exclusive all of the 0 they're the same. It's 0