Intel 4003 shift register |
In my mind I was picturing one Verilog always block for the shift register and a continuous assignment statement for the output enables. Four lines of code plus the module definition.
As it turns, the i4003 shift register is a more complicated chip than I expected.
What I suspect Intel wanted to implement was an array of edge-clocked D flip-flops similar to the 74164 depicted here, with added tri-state output buffers.
Logic diagram for the 74164 shift register |
Since there is no way to guarantee such delays in an FPGA, my emulation of the i4003 uses a high-speed system clock input to drive a delay timer. The CP input is sampled on each rising edge of the system clock and compared with the CP value saved 250ns previously. If they are different a counter is started; when the counter indicates 250ns has passed the saved value is updated. The rising edge of the delayed CP causes the entire register to shift one bit, adding the serial input to the low end of the shift register. On the falling edge of the delayed CP another FF is updated from the high end of the shift register, and that is used as the serial output. This emulates the behavior of a real i4003 chip reasonably closely.
No comments:
Post a Comment