Question

Design running LEDs with two selects - left-to-right or right-to-left. ( BASYS 3) Specification A switch...

Design running LEDs with two selects - left-to-right or right-to-left. ( BASYS 3)

Specification

A switch selects the running direction

entity knight_rider is port (ck, sel: in std_logic;

z: out std_logic_vector(15 downto 0));

end knight_rider;

Homework Answers

Answer #1

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity knight_rider is
port (
   clk : in std_logic;
   sel : in std_logic;
   z : out std_logic_vector(15 downto 0)
);
end knight_rider;


architecture behave of knight_rider is
signal temp : std_logic_vector(15 downto 0);
begin

  process(clk)
  begin
   if (clk'event and clk = '1') then
   if (sel = '1') then
   temp <= temp(14 downto 0) & temp(15); -- right to left
   else
   temp <= temp(0) & temp(15 downto 1); -- left to right
   end if;
   end if;
  end process;

  z <= temp;

end behave;

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
A.)Two particles, both carrying charge 3 C are traveling parallel to each other with velocities of...
A.)Two particles, both carrying charge 3 C are traveling parallel to each other with velocities of v⃗ =17000i^v→=17000i^ in m/s. They are positioned at the points (0,3,0)(0,3,0) and (0,−3,0)(0,−3,0). What is the magnitude and direction of the magnetic field at (0,3,0)(0,3,0) due to the particle located at (0,−3,0)(0,−3,0)? [Enter the magnitude in answer box 1 and the direction as one of either "in", "out", "up", "down", "left", or "right" in answer box 2. Assume that the xx-axis corresponds to left/right,...
A.)Two particles, both carrying charge 3 C are traveling parallel to each other with velocities of...
A.)Two particles, both carrying charge 3 C are traveling parallel to each other with velocities of v⃗ =17000i^v→=17000i^ in m/s. They are positioned at the points (0,3,0)(0,3,0) and (0,−3,0)(0,−3,0). What is the magnitude and direction of the magnetic field at (0,3,0)(0,3,0) due to the particle located at (0,−3,0)(0,−3,0)? [Enter the magnitude in answer box 1 and the direction as one of either "in", "out", "up", "down", "left", or "right" in answer box 2. Assume that the xx-axis corresponds to left/right,...
Read the attached articles about the proposed merger of Xerox and Fujifilm. Utilizing your knowledge of...
Read the attached articles about the proposed merger of Xerox and Fujifilm. Utilizing your knowledge of external and internal analysis, business and corporate strategy, and corporate governance, please discuss the following questions: 1. What is the corporate strategy behind the merger of Xerox and Fujifilm? 2. Why did Xerox agree to the merger? Is this a good deal for Xerox? Discuss the benefits and challenges they face with the merger. 3. Why did Fujifilm agree to the merger? Discuss the...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT