chrisnonso
Newbie level 4
Hello all,
Please I am trying to design a walsh code of length 8 on FPGA using VHDL codes. I am using 2 T-flip flops, 3 AND gates and 1 OR gate to implement this design. I have been unsuccessful and really need some help as I am new to using VHDL code language. What I have so far shown below synthesizes but the simulation report does not reproduce the accurate result. Any help will be greatly appreciated. Thanks.
Library ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;
ENTITY walsh8 IS
PORT(clk: IN STD_LOGIC;
RESET: IN STD_LOGIC;
u0: IN STD_LOGIC;
u1: IN STD_LOGIC;
u2: IN STD_LOGIC;
OUTPUT: OUT STD_LOGIC);
END walsh8;
ARCHITECTURE fpga OF walsh8 IS
SIGNAL Q1: STD_LOGIC;
SIGNAL Q2: STD_LOGIC;
SIGNAL T : STD_LOGIC := '0';
BEGIN
PROCESS(clk, RESET)
BEGIN
IF (reset = '1') THEN
T <= '0';
ELSIF (clk='1' AND clk'EVENT) THEN
T <= NOT T;
END IF;
END PROCESS;
PROCESS (clk, RESET)
BEGIN
IF (RESET = '1') THEN
Q1 <= '0';
Q2 <= '0';
ELSIF(clk='1' AND clk'EVENT) THEN
Q1 <= T XOR Q1;
Q2 <= Q1 XOR Q2;
END IF;
OUTPUT <= ((u0 AND T) OR (u1 AND Q1) OR (u2 AND Q2));
END PROCESS;
END fpga;
Please I am trying to design a walsh code of length 8 on FPGA using VHDL codes. I am using 2 T-flip flops, 3 AND gates and 1 OR gate to implement this design. I have been unsuccessful and really need some help as I am new to using VHDL code language. What I have so far shown below synthesizes but the simulation report does not reproduce the accurate result. Any help will be greatly appreciated. Thanks.
Library ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;
ENTITY walsh8 IS
PORT(clk: IN STD_LOGIC;
RESET: IN STD_LOGIC;
u0: IN STD_LOGIC;
u1: IN STD_LOGIC;
u2: IN STD_LOGIC;
OUTPUT: OUT STD_LOGIC);
END walsh8;
ARCHITECTURE fpga OF walsh8 IS
SIGNAL Q1: STD_LOGIC;
SIGNAL Q2: STD_LOGIC;
SIGNAL T : STD_LOGIC := '0';
BEGIN
PROCESS(clk, RESET)
BEGIN
IF (reset = '1') THEN
T <= '0';
ELSIF (clk='1' AND clk'EVENT) THEN
T <= NOT T;
END IF;
END PROCESS;
PROCESS (clk, RESET)
BEGIN
IF (RESET = '1') THEN
Q1 <= '0';
Q2 <= '0';
ELSIF(clk='1' AND clk'EVENT) THEN
Q1 <= T XOR Q1;
Q2 <= Q1 XOR Q2;
END IF;
OUTPUT <= ((u0 AND T) OR (u1 AND Q1) OR (u2 AND Q2));
END PROCESS;
END fpga;