1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ra1l [238]
2 years ago
14

I'm doing a VHDL program in Vivado, using a zyboz7 20, which would have 2 teams, each of them with different buttons and led lig

hts. The idea is to use one button to obtain when a team scores a goal, so it will be displayed in the 7 segment-display (for example, if the button is pressed once, the display will show a one, and so on). When any of the team gets to 3, the led light given to that team will turn on.
Right now, I just have one team in the program and the constraints. Also, I have trouble understanding the debouncing of the button, I don't know if I'm using the wrong algorithm to attack the debounce issue, but it's as if the clock was delayed or it's not taking some of the input, I have been looking to a lot of tutorials but I can't find a way in which the programs can work without any issue. I will show my code here and the constraint, I will also explain the code so it will be easier to modify it if anyone can help me with the debounce issue.

Program's code:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.NUMERIC_STD.ALL;

entity sevenSementDis is
Port (
C : out STD_LOGIC;
won1: out STD_LOGIC;
team1, clk,reset: in STD_LOGIC;
SevenSD: out STD_LOGIC_VECTOR (6 downto 0));

end sevenSementDis;

architecture Behavioral of sevenSementDis is

type statetype is (Init,Gol,AnotherGol,victory);
signal state, nextstate: statetype;

signal clk_bit : INTEGER := 4;
signal clk_bit2 : INTEGER := 4;
signal count : STD_LOGIC_VECTOR (4 downto 0) := "00000";
signal clk_div : STD_LOGIC_VECTOR (4 downto 0) := "00000";
signal count_reset : STD_LOGIC_VECTOR (4 downto 0) := "00000";
signal clk_reset : STD_LOGIC_VECTOR (4 downto 0) := "00000";

begin
C<='0';

process (clk)
begin
if (clk='1' and team1='1') then
clk_div <= clk_div + '1';
end if;
end process;

process (clk_div)
begin
if (clk='1' and clk_div(clk_bit) = '1') then
count <= count + '1';
end if;
end process;

process(clk)
--variable Count : natural range 0 to 5 := 0;
begin

if rising_edge(clk) then

case(nextstate) is

when Init =>
SevenSD<="0111111";
won1<='0';
if count="00010" then
nextstate<=Gol;
else
nextstate<=Init;
end if;

when Gol =>
SevenSD<= "0000110";

if count="00011" then
nextstate<=AnotherGol;
else
nextstate<=Gol;
end if;

when AnotherGol =>
SevenSD<= "1001011";
if count="00100" then
nextstate<=victory;
else
nextstate<=AnotherGol;
end if;

when victory =>
SevenSD<= "1001111";
won1<= '1';


end case;
end if;
end process;

end Behavioral;

Explanation:

The ports: Won1 is the led light assigned to team 1. team1 is the button that I want to use when team 1 scores. The reset is also a button but I haven't been implemented. SevenSD is the 7-segment display. Clk is the clock and C is another led light that hasn't been implemented.

There are 4 states, Init(where the code starts), Gol (the team scores the first goal, which would also change the display), AnotherGol(team scores again and the display changes), and Victory (the display changes one last time and led light turns on). There are also state (which would take the actual state) and nextstate(which will tell the next state).

count is an integer that will be added when the button is 1 and the clk_div is also 1, it's the one that determines when to move to the next state. clk_bit is just the bits of the clock. clk_div is diving the clock to try to attack the debouncing issue. clk_bit2, count_reset,clk_reset are not implemented, they were created when trying to add the reset button, but when I erase them, the code just stops working at all.

the rest are some process to fight the debounce and the last one is the actual code, which goes around the different states until the victory state.
Computers and Technology
1 answer:
Furkat [3]2 years ago
4 0

Answer:

como lo echo es echo si no tengo un pájaro es

Explanation:

un pájaro azul

You might be interested in
Ronaldo wants to determine if employees would prefer having bagels or
nikklg [1K]

Answer:

surveys and questionnaires

7 0
3 years ago
g You need to build a circuit to perform parallel data transfers from one set of registers to another. The interconnections betw
Phoenix [80]

Answer:

JK Flip Flop

Explanation:

Flip Flops is a fundamental building blocks of digital electronics systems.  It  is an electronic circuit with two stable states that can be used to store binary data.  However, a JK Flip Flop is a type of universal flip-flop that makes the circuit toggle between two states and is widely used in shift registers.

So when building a circuit to perform parallel data transfers from one set of registers to another, a JK Flip Flop is the best choice he register FFs when you need to hold the interconnection between the register to a minimum.

6 0
4 years ago
Read 2 more answers
D) Informal high level descuption of an algorithm in english kcalled
Hatshy [7]
It might be d I’m not sure die
8 0
3 years ago
Read 2 more answers
Fifty part-time students were asked how many courses they were taking this term. The (incomplete) results are shown below. Need
Ne4ueva [31]

Answer:

The answer for B is 10% and for C is 40%.

Explanation:

To get the percentage for B you take the the frequecy of students taking 2 courses (5) and multiply it by 100 then you divide it by whole number of students.

For C you do the after adding the number of students taking 1 or 2 courses (20).

5 0
3 years ago
Pressing and holding the _______ key while dragging a corner handle of an image proportionally resizes it.
siniylev [52]
Shift key is correct key
3 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following STEM discoverers developed a new type of computer hardware?
    11·1 answer
  • Text that does not fit in a cell
    7·1 answer
  • 1.the following code example would print the data type of x, what data type would that be?
    12·1 answer
  • The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is st
    8·1 answer
  • What are the characteristics of a good text-based adventure game? In other words, what are some features that should be in the g
    7·1 answer
  • The digital EGR valve used on GM 3800 engines allows for how many different EGR flow rates?
    15·1 answer
  • You are having difficulty changing permissions for a folder on an NTFS volume that was created by another user. How can you best
    6·1 answer
  • Which visual aid would be best for showing changes inacts population size over time?
    15·1 answer
  • Brent recently received funding for his fast-food chain in Michigan. As a result, he hires Angela to set up a top-level domain s
    6·1 answer
  • Which step in the penetration testing life cycle is accomplished using rootkits or trojan horse programs? maintain access gain a
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!