Pointless question...

Ray Arachelian ray at arachelian.com
Wed Jul 23 22:56:59 CDT 2008


Chuck Guzis wrote:
> I was musing today about the old recirculating stores (mercury delay 
> line, magnetostrictive, acoustic, etc.) used for memory on old iron.
>
> Suppose one wanted simulate one in modern components.  How would you 
> do it, if you had, say, a million bits to store?  
>
> Would you use a 1x1Mb DRAM and a counter to cycle through the 
> addresses?  Or an 8x128Kb SRAM with an external 8 bit shift register?
>
> Any other thoughts?  Access has to be read and write and make the 
> bitrate about 10MHz.
>   

It wouldn't matter really.  What does is that it behaves the same way.

If I had to do it, I'd almost always do it in software, I would base it 
on a cycle counter.  At whatever rate is proper.  If you say 10MHz, ok 
fine, so if I had a 10MHz CPU clock, I'd use that, if not I'd adjust for 
whatever would reconcile the CPU clock cycle rate versus the period 
(1/freq) for the memory.

In the end, you can always figure out what the proper math for it is, 
and get at the right bit.  If I had to emulate it, I'd do something like 
figure out what my current clock cycle is, and which bit out of those I 
needed, and do the modulo math to get at it.  So at some point, you'd 
divide by 8.  Since you're dividing by a power of two, you can (under 
most architectures) use a right shift, and use the left over bits to 
figure out the rest.

So if the CPU clock was 10MHz (and you need to be careful of how long 
each instruction takes), then use the clock cycle as a pointer into that 
memory, modulo its size.  If it really wasn't a million bits, but rather 
a power of two, say 2^20, it makes it a little bit easier.  (Mind you 
I'm horribly drunk - so I shouldn't even be typing, let alone trying to 
figure out powers of 2 here, but as a recently jobless unix sysadmin 
loser bum, indulge me my two seconds of neuronal discharge. :-)

So don't actually rotate the bits around, but instead look at the clock 
cycle counter and use that as an index into the memory at the moment in 
time you care about.
i.e. use 2^20-1 as a filter and AND that against the counter like so 
(apply grains of salt as needed): 

  valuenow=memory[ (counter & 0xFFFFF)>>8 ] & 1<<(counter & 0x07);

If you had to do it in hardware, well, use whatever you can as a 
counter, fed at the proper speed as an index into the address space.  I 
suspect a 555 timer wired up the right way to pulse at 10MHz, and wired 
to feed a 20 bit counter circuit which acts as the address bus of said 
memory would work, but there's probably more elegant ways of doing it.

Just my drunken worthless $10^-93  ;-)


More information about the cctalk mailing list