Forum Discussion
11 Replies
- Altera_Forum
Honored Contributor
in what? a testbench in simulation? on a pin of a physical chip? and ethernet interface?
Please be more specific. - Altera_Forum
Honored Contributor
The purpose is TI generate patterns for simple test. And I use MAXII micro board. So, I have to define input logic of shift register for serial output.
- Altera_Forum
Honored Contributor
so, just to be clear, you are using the MAX2 to generate the test pattern for something else, you're not testing the max2?
- Altera_Forum
Honored Contributor
Yes, you are right.
Thanks. - Altera_Forum
Honored Contributor
Anyone can help me?
- Altera_Forum
Honored Contributor
All you need is a shift register that powers up to an initial value and then pumps it out.
- Altera_Forum
Honored Contributor
Tricky, thanks for the reply.
You mean to connect the inputs of shift registers to either bcc or gnd directly? If it's true, how can I change the input patterns other time cycles? - Altera_Forum
Honored Contributor
You will need a simple bit generator based on cyclic shift register as Tricky suggested:
i.e. reg started with initial value then on first clock edge it shifts with bit 63 assigned to bit 0, 0 to 1 ...62 to 63 and so on your data is then assign any one or more bits of shift_reg as per data width.-- not tested process(reset,clk) begin if reset = '1' then shift_reg <= x"0123456789ABCDEF"; -- 64 bits initial value elsif rising_edge(clk) then shift_reg <= shift_reg(62 downto 0) & shift_reg(63); end if; end process; - Altera_Forum
Honored Contributor
Thanks, Kaz.
It's the behavior of shift register. I need a 16 bit width. After assigned the initial value and 16 clk cycle passed, I will need another 16 bits input. How to generate the subsequent 16 bits and the following ones? Thanks! Cliff - Altera_Forum
Honored Contributor
If I understood you, you need to design a 16 bit shift register as above replacing 64 bits with 16 bits then kick it on every clock edge.
For changing value every 16 clock cycles then simply load new value into shift register. You will need a small counter say 0 ~ 3 to load a specific value at each count. if count 0 load x"...", else if count 1 load x"...." and so on.