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
How to deactivate the brainly app?​
galina1969 [7]

Answer:

Don't you just uninstall it?

Explanation:

5 0
3 years ago
Read 2 more answers
Which of the following describes a Trojan horse?
HACTEHA [7]

Answer:

the answer is

c. Trojan horses enter a secure space, while an infected file proceeds to be downloaded and run.

7 0
3 years ago
Laurel, the manager of a software company, assumes that the male employees in his organization are more creative and innovative
grandymaker [24]

Answer:

Sterotyping

Explanation:

A stereotype is an over-generalized perception or view about a particular category of individuals or group. It is a belief that people might have concerning each and every person of a particular group. The type of expectation can differ from people to people; it can be, for instance, a belief or perception about a particular group's personality, preferences, or ability.

5 0
3 years ago
In which of the following situations is having a good credit score important?
Triss [41]
<span>The correct answer is to be able to loan from banks. Having a good credit score, impacts one's approval for bank loans. It will enable a person to have a higher chance of getting his or her loan, approved by the banks, than those who have low credit scores. </span>
8 0
3 years ago
Seven Features of computer aids design software
astra-53 [7]
Computer-aided engineering (CAE) and finite element analysis (FEA) Computer-aided manufacturing (CAM) including instructions to computer numerical control (CNC) machines. Photorealistic rendering and motion simulation. Document management and revision control using product data management (PDM).
3 0
3 years ago
Other questions:
  • Discuss the differences between permanent internal memory and volatile internal memory.
    14·1 answer
  • Which one of the following is an example of hacktivism according to you and why?
    11·1 answer
  • On hearing my name, you may think that I am iterative, but I play a vital role in networking by boosting the signal strength to
    13·1 answer
  • What statement best describes Konrad Zuse?
    6·2 answers
  • How can you crop a photo in PowerPoint?
    15·2 answers
  • What is it called when an attacker convinces you to enter personal information at an imposter website after receiving an email f
    10·2 answers
  • How to add more then one picture on a brainy question really need this
    8·1 answer
  • Where do the projection lines converge in a perspective sketch?
    13·1 answer
  • What is a complier in computers
    9·2 answers
  • Question 1 of 10
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!