I am designing a retro computer as a project to learn digital electronics hands-on (not FPGA programming). I currently have an accumulator machine similar to the PDP-8 where the ALU has the accumulator register as one of its input, the other input comes from the data bus, and the output is clocked directly into the accumulator register on the rising edge.
I can use a 74LS173 for the register, or even a 74LS161 counter (as I do for the instruction pointer, IP). But I looked if I can just replace the single register with a 74LS170 (or 670) "register file", having 4 registers, but I'm missing the clock input. It's asynchronous like my 74LS189 memory. I am looking at the 74LS670 Data Sheet particularly the timing diagrams, and I can't seem to figure out how you could read from one of the registers, into the ALU and clock the result into the same register.
I would put read select (RA, RB) and write select (WA, WB) both at the same address, say 00. Soon the data appears on Q1,2,3, and 4. Soon the result comes out of the ALU. But the timing diagram shows -WE line go low before the data arrives! That doesn't seem to make sense. Why did they build it that way? It's even worse, according to this timing diagram the data output would appear even before I lower the -WE line.
This can't be true however, so what am I reading wrong? How did they use these register files without a clock? If I want asynchronous memory I could just use any SRAM chip.
UPDATE: It's been a veritable saga with me and these chips.
- Open collector logic puzzle solved, a non-issue, and moot with the '670 - Adapting the 74LS170 open-collector "register file" to active-high TTL input
- Wondering of to convert it to positive edge triggered - part 1 - Turn a positive clock edge into a negative pulse to make a 74LS170/670 register file synchronous
- Building the positive edge detector - Positive edge detection triggers on negative edge too
- Trying to apply the edge detector and it doesn't work - How do I make a 74LS170 or 74LS670 register file reliably clock in data on the rising edge?
And after this circle (circus?) I am right where I started. Pulling my hair out why they never made an edge triggered register file and instead followed up the '170 with a '670 that is just as useless as the '170.
The only thing that's interesting is the dual port nature. So I can read a different register than I write to. This is the only thing that could make it somewhat useful, if the constraint is that you never write to the same register that you just read from in the immediately preceding clock cycle.
Or if you do, read and write from the same register, you must pull high the !G_W again right after the clock went high and before it goes low again. That means, I need to OR-gate this !LOAD control with a 90 degrees phase-shifted (delayed) clock, in addition to the CLOCK itself; so a 3-input OR gate:
!G_W = !LOAD + CLK' + CLK
Darn! That is complicated! So I still don't know what the use of those '170 and '670 ever was? And why the '172, which is edge triggered had been so abandoned that you can't even get an LS version for it (let alone HC?)