You have no items in your shopping cart.

Subtotal: 0.00

Slide switch

Slide switches are most common used in electronic circuits for digital input of ON/OFF states. They allow control over current flow in a circuit. You’ll usually find slide switches in SPDT or DPDT configurations.

Push Buttons

Push-button switches are the classic momentary switch. Typically these switches have a really nice, tactile feedback when you press them.

Schematic to interface Slide Switch and Push Button with Coolrunner II CPLD Development Board



Schematic to interface Slide Switch and Push Button with Coolrunner II CPLD Development Board



Schematic to interface Slide Switch and Push Button with Coolrunner II CPLD Development Board

Slide Switch and Push Button Placement in Spartan3an CPLD Project Kit



Slide Switch and Push Button Placement in Spartan3an CPLD Project Kit



Slide Switch and Push Button Placement in Spartan3an CPLD Project Kit

Interfacing Slide Switch and Push Button with Coolrunner II CPLD Development Board

Push Button interface is straight forward. One end of Push Button connected to CPLD and another end connected to ground. Slide switch interface to CPLD is Pulled High by default at open end and another end is connected to ground which act as OFF State.

VHDL Code for Slide Switch Interfacing with Coolrunner II CPLD Development Board

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

entity sw_led is
    Port ( a : in  STD_LOGIC_VECTOR (7 downto 0);
           b : out  STD_LOGIC_VECTOR (7 downto 0));
end sw_led;

architecture Behavioral of sw_led is

begin

b <= a;

end Behavioral;

User Constraint File

net a(0) loc="p22";
net a(1) loc="p23";
net a(2) loc="p24";
net a(3) loc="p25";
net a(4) loc="p26";
net a(5) loc="p28";
net a(6) loc="p30";
net a(7) loc="p31";

net b(0) loc="p14";
net b(1) loc="p15";
net b(2) loc="p16";
net b(3) loc="p17";
net b(4) loc="p18";
net b(5) loc="p19";
net b(6) loc="p20";
net b(7) loc="p21";

VHDL Code for Push Button Interfacing with Coolrunner II CPLD Development Board

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

entity push_sw is
    Port (sw1,sw2,sw3,sw4,sw5 : in  STD_LOGIC;
           led1,led2,led3,led4,led5: out  STD_LOGIC);
end push_sw;

architecture Behavioral of push_sw is
begin
led4<= sw4;
led3<= sw3;
led2<= sw2;
led1<= sw1;
end Behavioral;

User Constraint File

NET "led1" LOC = P7;
NET "led2" LOC = P8;
NET "led3" LOC = p10;
NET "led4" LOC = P11;
NET "sw1" LOC = P29 | PULLDOWN;
NET "sw2" LOC = P30 | PULLDOWN;
NET "sw3" LOC = P31 | PULLDOWN;
NET "sw4" LOC = P32 | PULLDOWN;