Guest
Hello Folks,
I have a sequence which I need to transmit N-times.After completion I
need to invert the sequence and transmit again for M-Times.then I need
to stop transmission. I have mentioned my code below. My question
is,After the transmission N-times, I couldnt see the inversion of same
bit sequence for M-times.ALso I need some control to stop the process
and rise a signal (singal : EOP - used in entity) to inform the
transmission in complete. Can anybody pour some light on it ?
(NOTE : N = 174 and M = 192 I have used a counter to check the clock
cycles)
Thanks in advance,
Regards,
ALI
LIBRARY IEEE;
USE IEEE.STD_lOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
-------------------------------------------------------------------
ENTITY ALPHA IS
PORT
(
CLK : IN STD_LOGIC;
RESET : IN STD_lOGIC;
SOTx : IN STD_LOGIC;
I_OUT : OUT STD_LOGIC;
Q_OUT : OUT STD_LOGIC;
EOP : OUT STD_LOGIC
);
END ALPHA;
-------------------------------------------------------------------
ARCHITECTURE ARCH_ALPHA OF ALPHA IS
CONSTANT INT_IOUT : UNSIGNED(0 TO 15):= "0000110010100110";
CONSTANT INT_QOUT : UNSIGNED(0 TO 15):= "0000011010101100";
SIGNAL INT_COUNT : NATURAL;
-------------------------------------------------------------------
BEGIN
INP: PROCESS(CLK,RESET)
VARIABLE DATAV_IN1 : UNSIGNED(0 TO 15);
VARIABLE DATAV_IN2 : UNSIGNED(0 TO 15);
BEGIN
IF (RESET = '0') THEN
I_OUT <= '0';
Q_OUT <= '0';
EOP <= '0';
DATAV_IN1 := INT_IOUT;
DATAV_IN2 := INT_QOUT;
ELSIF (RISING_EDGE(CLK) AND (SOTX = '1')THEN
INT_COUNT <= INT_COUNT + 1;
I_OUT <= DATAV_IN1(0);
Q_OUT <= DATAV_IN2(0);
IF INT_COUNT <= 176 THEN
DATAV_IN1 := ROTATE_LEFT(DATAV_IN1,1);
DATAV_IN2 := ROTATE_LEFT(DATAV_IN2,1);
ELSE
DATAV_IN1 := NOT(ROTATE_LEFT(DATAV_IN1,1));
DATAV_IN2 := NOT(ROTATE_LEFT(DATAV_IN2,1));
END IF;
IF INT_COUNT = 192 THEN
EOP <= '1';
END IF;
END IF;
END PROCESS INP;
-------------------------------------------------------------------
END ARCHITECTURE ARCH_ALPHA;
I have a sequence which I need to transmit N-times.After completion I
need to invert the sequence and transmit again for M-Times.then I need
to stop transmission. I have mentioned my code below. My question
is,After the transmission N-times, I couldnt see the inversion of same
bit sequence for M-times.ALso I need some control to stop the process
and rise a signal (singal : EOP - used in entity) to inform the
transmission in complete. Can anybody pour some light on it ?
(NOTE : N = 174 and M = 192 I have used a counter to check the clock
cycles)
Thanks in advance,
Regards,
ALI
LIBRARY IEEE;
USE IEEE.STD_lOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
-------------------------------------------------------------------
ENTITY ALPHA IS
PORT
(
CLK : IN STD_LOGIC;
RESET : IN STD_lOGIC;
SOTx : IN STD_LOGIC;
I_OUT : OUT STD_LOGIC;
Q_OUT : OUT STD_LOGIC;
EOP : OUT STD_LOGIC
);
END ALPHA;
-------------------------------------------------------------------
ARCHITECTURE ARCH_ALPHA OF ALPHA IS
CONSTANT INT_IOUT : UNSIGNED(0 TO 15):= "0000110010100110";
CONSTANT INT_QOUT : UNSIGNED(0 TO 15):= "0000011010101100";
SIGNAL INT_COUNT : NATURAL;
-------------------------------------------------------------------
BEGIN
INP: PROCESS(CLK,RESET)
VARIABLE DATAV_IN1 : UNSIGNED(0 TO 15);
VARIABLE DATAV_IN2 : UNSIGNED(0 TO 15);
BEGIN
IF (RESET = '0') THEN
I_OUT <= '0';
Q_OUT <= '0';
EOP <= '0';
DATAV_IN1 := INT_IOUT;
DATAV_IN2 := INT_QOUT;
ELSIF (RISING_EDGE(CLK) AND (SOTX = '1')THEN
INT_COUNT <= INT_COUNT + 1;
I_OUT <= DATAV_IN1(0);
Q_OUT <= DATAV_IN2(0);
IF INT_COUNT <= 176 THEN
DATAV_IN1 := ROTATE_LEFT(DATAV_IN1,1);
DATAV_IN2 := ROTATE_LEFT(DATAV_IN2,1);
ELSE
DATAV_IN1 := NOT(ROTATE_LEFT(DATAV_IN1,1));
DATAV_IN2 := NOT(ROTATE_LEFT(DATAV_IN2,1));
END IF;
IF INT_COUNT = 192 THEN
EOP <= '1';
END IF;
END IF;
END PROCESS INP;
-------------------------------------------------------------------
END ARCHITECTURE ARCH_ALPHA;