VHDL Interfacing Programs
VHDL Interfacing Programs
VHDL Interfacing Programs
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity bcd_seg is
end bcd_seg;
begin
process (sel)
begin
en1 <='1';
end if;
end if;
end if;
end if;
end process;
"00111111" ; --0
end Behavioral;
Program 2:
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity lcd is
clk : in std_logic);
end lcd;
P1:process (clk,clkdiv)
begin
end if;
P2:process (clkkey)
begin
end if;
P3:process (state32,lcdheader)
begin
case state32 is
end case ;
end Behavioral;
Program 3:
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity dc_motor is
clk : in std_logic);
end dc_motor;
begin
P1:process(clk)
begin
end if;
end process P1;
P2:process(clk1)
begin
else
end if;
end if;
P3:process(clk1)
begin
end if;
end if;
end behavioral;
Program 4:
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity stepper_motor is
cntrl : in std_logic;
end stepper_motor;
begin
P1:process(clk)
begin
end if;
end process P1;
P2:process(clk1)
begin
else
end if;
end if;
end Behavioral;
Program 5:
entity dacsqr is
Port ( clkin : in std_logic;
douta : out std_logic_vector(7 downto 0));
end dacsqr;
begin
P1:process(clkin)
begin
if clkin'event and clkin = '1' then
clk_div <= clk_div + 1;
end if;
end process P1;
P2:process(clk1)
begin
if clk1'event and clk1 = '1' then
temp <= not temp;
end if;
douta <= temp;
end process P2;
end Behavioral;
Program 6:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity dacramp is
Port ( clkin : in std_logic;
douta : out std_logic_vector(7 downto 0));
end dacramp;
P1:process(clkin)
begin
if clkin'event and clkin = '1' then
clk_div <= clk_div + 1;
end if;
end process P1;
entity dactri is
Port ( clkin : in std_logic;
douta : out std_logic_vector(7 downto 0));
end dactri;
X"60",X"70",X"80",X"90",X"A0",X"B0",
X"C0",X"D0",X"E0",X"F0",X"FF",X"F0",
X"E0",X"D0",X"C0",X"B0",X"A0",X"90",
X"80",X"70",X"60",X"50",X"40",X"30",
X"20",X"10",X"00");
begin
P1:process(clkin)
begin
if clkin'event and clkin = '1' then
clk_div <= clk_div + 1;
end if;
end process P1;
P2:process(clk1)
variable data_loc:integer range 0 to 32 :=0;
begin
if clk1'event and clk1 = '1' then
if data_loc = 32 then
data_loc := 0;
else
data_loc := data_loc + 1;
end if;
end if;
temp <= tri_array(data_loc);
end process P2;
end Behavioral;
Program 8:
entity dacsine is
Port ( clkin : in std_logic;
douta : out std_logic_vector(7 downto 0));
end dacsine;
begin
P1:process(clkin)
begin
if clkin'event and clkin = '1' then
clk_div <= clk_div + 1;
end if;
end process P1;
P2:process(clk1)
variable data_loc:integer range 0 to 255 :=0;
begin
if clk1'event and clk1 = '1' then
if data_loc = 255 then
data_loc := 0;
else
data_loc := data_loc + 1;
end if;
end if;
temp <= sine_array(data_loc);
end Behavioral;