Advertisement
nontawat1996

debounce-switch-Assignment

May 18th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.68 KB | None | 0 0
  1. if clk'event and clk = '1' then
  2.                 -----------------------------
  3.                 if delay = 0 then
  4.                     countDelay <= 0;
  5.  
  6.                     if SignA = '1' then
  7.                         delay <= 1;
  8.                         tempSignA <= NOT tempSignA;
  9.                     end if ;
  10.  
  11.                     if SignB = '1' then
  12.                         delay <= 1;
  13.                         tempSignB <= NOT tempSignB;
  14.                     end if ;
  15.  
  16.                     if Operator = '1' then
  17.                         delay <= 1;
  18.                         tempOperator <= NOT tempOperator;
  19.                     end if ;
  20.  
  21.                 else
  22.                     countDelay <= countDelay + 1;
  23.  
  24.                     if countDelay = 5000000 then
  25.                         delay <= 0;
  26.                         countDelay <= 0;
  27.                     end if ;
  28.                 end if ;
  29. end if ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement