I'm trying to develop a parallel-in-serial-out shift register using D-flip flops for data transmission, but I'm stuck on one aspect of it. I was wondering if you guys could help me out.
To better illustrate the problem of what I'm trying to achieve, consider this simple example. I have a counter running on a clock (call it CLK) at 100 MHz (period of 10 ns). My counter generates a 10-bit number in binary every clock cycle (accompanied by what I call a "data flag" to indicate that valid data is present), so I have to load it in my shift register and send out all the bits of the number before the next number gets loaded. In essence, I load a new number into the shift register on every cycle of CLK, but at the same time, my shift register is running on a second clock of 1 GHz (period of 1 ns). Let's call this clock CLK_10. With the incoming data and my "data flag" holding their value throughout one cycle of CLK and with the D-flip flops that make up the shift register running on the faster CLK_10 signal, how do I ensure that it loads once during a cycle of CLK? Most of the shift register examples I see load and shift on the same clock, but with me shifting on two different clocks, I run the risk of constantly loading the D-flip flops and not shifting properly. I thought of trying to create a single-shot "load" pulse signal, but I don't know how to do that with my faster CLK_10 and the incoming "data flag" signal. Any advice?
To add a bit more detail, this is all part of an effort to try and build an 8b10b module. Now that the data encoding is done, I'm focusing on the transmission/receiving part. At first, I thought to use a finite state machine, but then when I worked on the receiving part, I switched to a shift register implementation (as that seemed to be the easiest method for incoming serial data).