CAN SOMEONE RUN THIS WITH VHDL AND SEND ME THE OUTPUT? LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY LFSR8 IS PORT...

60.1K

Verified Solution

Question

Electrical Engineering

CAN SOMEONE RUN THIS WITH VHDL AND SEND ME THE OUTPUT?

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY LFSR8 IS
PORT (Clk, Rst: IN std_logic;
output: OUT std_logic_vector (7 DOWNTO 0));
END LFSR8;
ARCHITECTURE LFSR8_beh OF LFSR8 IS
SIGNAL Currstate, Nextstate: std_logic_vector (7 DOWNTO0);
SIGNAL feedback: std_logic;
BEGIN
StateReg: PROCESS (Clk,Rst)
BEGIN
IF (Rst = '1') THEN
Currstate <= (0 => '1', OTHERS =>'0');
ELSIF (Clk = '1' AND Clk'EVENT) THEN
Currstate <= Nextstate;
END IF;
END PROCESS;
feedback <= Currstate(4) XOR Currstate(3) XOR Currstate(2)XOR Currstate(0);
Nextstate <= feedback & Currstate(7 DOWNTO 1);
output <= Currstate;
END LFSR8_beh;

test bench:

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY Testbench IS
END Testbench;
ARCHITECTURE TBarch OF Testbench IS
COMPONENT LFSR8 IS
PORT (Clk, Rst: IN std_logic;
output: OUT std_logic_vector (7 DOWNTO 0));
END COMPONENT;
SIGNAL Clk_s, Rst_s: std_logic;
SIGNAL output_s: std_logic_vector(7 DOWNTO 0);
BEGIN
CompToTest: LFSR8 PORT MAP (Clk_s, Rst_s, output_s);
Clk_proc: PROCESS
BEGIN
Clk_s <= '1';
WAIT FOR 10 ns;
Clk_s <= '0';
WAIT FOR 10 ns;
END PROCESS clk_proc;
Vector_proc: PROCESS
BEGIN
Rst_s <= '1';
WAIT FOR 5 NS;
Rst_s <= '0';
FOR index IN 0 To 4 LOOP
WAIT UNTIL Clk_s='1' AND Clk_s'EVENT;
END LOOP;
WAIT FOR 5 NS;
ASSERT output_s = X\"88\" REPORT \"Failed output=88\";
WAIT;
END PROCESS Vector_proc;
END TBarch;

Answer & Explanation Solved by verified expert
3.7 Ratings (374 Votes)
Vhdl code is simulated and attaching code simulation waveformsbelowLIBRARY    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students