mình đang làm đồ án thiết kế đồng hồ số hiển thị quét trên xilin xc2c256.nhờ các bạn xem core lập trình này của mình một cái .Mình chạy thử mô phỏng trên ct phần mềm xilinx rồi nhưng bị lỗi không biết sửa thế nào nữa
core VHDL :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use ieee.numeric_bit.all;
package ctc is
type so_09 is range 0 to 9;
type so_17 is range 0 to 17;
type phut_giay is range 0 to 59;
type type_data_seg7 is array (6 downto 0) of bit ;
type type_ctrl_seg7 is array (5 downto 0) of bit;
function ctc_data_seg7 (v_data :so_09)return type_data_seg7;
function ctc_ctrl_seg7(vao:so_17)return type_ctrl_seg7;
end package ctc;
package body ctc is
function ctc_data_seg7(v_data:so_09) return type_data_seg7 is
begin
case(v_data) is --abcdefg
when 0 => return "0000001";
when 1 => return "1001111";
when 2 => return "0010010";
when 3 => return "0000110";
when 4 => return "1001100";
when 5 => return "0100100";
when 6 => return "0100000";
when 7 => return "0001111";
when 8 => return "0000000";
when 9 => return "0000100";
when others => return "1111111";
end case;
end function ctc_data_seg7;
function ctc_ctrl_seg7(vao:so_17)return type_ctrl_seg7 is
begin
case(vao) is
when 0 => return "111111";
when 1 => return "000001";
when 2 => return "000010";
when 3 => return "000100";
when 4 => return "001000";
when 5 => return "010000";
when 6 => return "100000";
when others =>return "000000";
end case;
end function ctc_ctrl_seg7;
end package body ctc;
--------- khoi tao xung chuan 1hz----------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use ieee.numeric_bit.all;
use work.ctc.all;
entity dh_so is
port (rst:in bit;
clk:in bit;
pb_menu:in bit;
pb_tru:in bit;
pb_cong:in bit;
pb_ok: in bit;
out_clk: out bit;
spk : out bit;
data_seg7:out type_data_seg7;
ctrl_seg7:out type_ctrl_seg7);
end dh_so;
architecture dong_ho_so of dh_so is
constant max_dem:integer :=250;
constant tg_quet_led:integer:=1842;
signal clk_giay:bit:='0';
signal clk_quet:bit:='0';
signal dieukhien_seg7:so_17:=0;
signal cong_tru:bit :='1';
signal co_cong_tru:bit:='0';
signal tg:so_09;
signal dv_giay:so_09:=0;
signal c_giay:so_09:=0;
signal dv_phut:so_09:=0;
signal c_phut : so_09:=0;
signal dv_gio:so_09:=0;
signal c_gio:so_09:=0;
signal dv_thu : so_09:=2;
signal on_chuong: bit :='0';
--su dung cho quet led-------------------
begin
xung_quet_led: process(rst,clk)
variable dem_quet:integer:=0;
begin--clk dau vao la 1,842mhz
if (rst='0') then dem_quet:=0;
clk_quet<='0';
elsif(clk'event and clk='1') then
if (dem_quet=tg_quet_led) then
clk_quet<=not clk_quet;
dem_quet:=0;
else
dem_quet:=dem_quet +1;
end if;
end if;
end process xung_quet_led;
---su dung dem giay------------
xung_chuan_giayrocess(rst,clk_quet)
variable dem_giay:integer:=0;
begin ---clk dau vao la 1,842Mhz
if (rst='0') then dem_giay:=0;clk_giay<='0';
elsif(clk_quet'event and clk_quet='1') then
if (dem_giay = max_dem)then
clk_giay<=not clk_giay;
dem_giay:=0;
else
dem_giay:=dem_giay+1;
end if;
end if;
end process xung_chuan_giay;
out_clk<=clk_giay;
--khoi hien thi ra led 7 thanh ---------------------
khoi_hien_thirocess(rst,clk_quet,dv_giay,c_giay,dv_phut,c_phut, dv_gio,c_gio,dieukhien_seg7)
variable dem_ht:so_17:=0;
begin
if (rst='0')then
ctrl_seg7<=ctc_ctrl_seg7(17);
dem_ht:=1;
elsif(clk_quet'event and clk_quet='1')then
if(dem_ht=16)then
dem_ht:=1;
else
dem_ht:=dem_ht+1;
end if;
case (dem_ht) is
when 1 => ctrl_seg7<=ctc_ctrl_seg7(1) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(dv_giay);
when 2 => ctrl_seg7<=ctc_ctrl_seg7(2) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(c_giay);
when 3 => ctrl_seg7<=ctc_ctrl_seg7(3) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(dv_phut);
when 4 => ctrl_seg7<=ctc_ctrl_seg7(4) and ctc_ctrl_seg7(dieukhien_seg7); data_seg7 <= ctc_data_seg7(c_phut);
when 5 => ctrl_seg7<=ctc_ctrl_seg7(5) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(dv_gio);
when 6 => ctrl_seg7<=ctc_ctrl_seg7(6) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(c_gio);
when others => ctrl_seg7<=ctc_ctrl_seg7(17);
end case;
end if;
end process khoi_hien_thi;
-- khoi phim nhan-----------------
khoi_phim_menu_okrocess
begin
if((rst='0')or(pb_ok='0')) then
dieukhien_seg7 <=0;
elsif (pb_menu='0') then
if (dieukhien_seg7 = 6) then dieukhien_seg7<=1;
else
dieukhien_seg7 <= dieukhien_seg7+ 1;
end if;
end if;
wait until pb_menu ='1';
end process khoi_phim_menu_ok;
cong_tru <=pb_tru and pb_cong;
khoi_phim_cong_trurocess
begin
co_cong_tru <='0';
case (dieukhien_seg7) is
when 1 =>tg <=dv_giay;
if (pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong='0')then
if(tg <9)then tg<=tg+1;
end if;
end if;
when 2 => tg <=c_giay;
if(pb_tru ='0')then
if(tg >0)then tg<=tg-1;
end if;
elsif(pb_cong ='0')then
if(tg <5)then tg <=tg+1;
end if;
end if;
when 3 =>tg <=dv_phut;
if(pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong ='0')then
if(tg <9)then tg<=tg+1;
end if;
end if;
when 4 =>tg <=c_phut;
if(pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong='0')then
if(tg <5)then tg <=tg+1;
end if;
end if;
when 5 =>tg <=dv_gio;
if(pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong='0')then
if(tg <9)then tg <=tg+1;
end if;
end if;
when 6 =>tg <=c_gio;
if(pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong='0')then
if(tg <2)then tg<=tg+1;
end if;
end if;
when others => null;
end case;
co_cong_tru <='1';
wait until cong_tru='1';
end process khoi_phim_cong_tru;
--khoi thuc hien dem gio, phut, giay
--suon am cua ban phim, suon duong cua clk_giay
khoi_dong_horocess(rst,clk_giay,dieukhien_seg7,tg,co_cong_tru)
begin
if(rst='0')then
dv_giay <=0;c_giay <=0;
dv_phut <=0;c_phut <=0;
dv_gio <=0;c_gio <=0;
elsif(dieukhien_seg7 /=0 and co_cong_tru='1')then
case (dieukhien_seg7)is
when 1 => dv_giay <=tg;
when 2 => c_giay <=tg;
when 3 => dv_phut <=tg;
when 4 =>c_phut <=tg;
when 5 =>dv_gio <=tg;
when 6 =>c_gio <=tg;
when others =>null;
end case;
elsif(clk_giay'event and clk_giay='1')then --clk =1;
if(dv_giay=9)then dv_giay <=0;
if(c_giay=5)then c_giay <=0;
if(dv_phut=9)then dv_phut <=0;
if(c_phut=5)then c_phut <=0;
if(((dv_gio=3)and(c_gio=2))or((dv_gio=9)and(c_gio/=2)))then dv_gio <=0;
if(c_gio=2)then c_gio <=0;
if(dv_thu=8)then dv_thu <=2;
else dv_thu<=dv_thu+1;
end if;
else c_gio<=c_gio+1;
end if;
else dv_gio <=dv_gio+1;
end if;
else c_phut <=c_phut+1;
end if;
else dv_phut <=dv_phut+1;
end if;
else c_giay <=c_giay+1;
end if;
else dv_giay <=dv_giay+1;end if;
end if;
end process khoi_dong_ho;
--khoi bao chuong -------------------------
bao_chuongrocess(c_gio,dv_gio,c_phut,dv_phut,dv_thu)
begin
if(dv_thu/=8)then
if((c_gio=0)and(dv_gio=6)and(c_phut=3)and(dv_phut= 0))then on_chuong <='1';
--6h30
elsif((c_gio=0)and(dv_gio=7)and(c_phut=1)and(dv_ph ut=5))then on_chuong <='1';
--7h15
elsif((c_gio=0)and(dv_gio=7)and(c_phut=2)and(dv_ph ut=0))then on_chuong <='1';
--7h20
elsif((c_gio=0)and(dv_gio=8)and(c_phut=0)and(dv_ph ut=5))then on_chuong <='1';
--8h05
elsif((c_gio=0)and(dv_gio=8)and(c_phut=1)and(dv_ph ut=5))then on_chuong <='1';
--8h15
elsif((c_gio=0)and(dv_gio=9)and(c_phut=0)and(dv_ph ut=0))then on_chuong <='1';
--9h00
elsif((c_gio=0)and(dv_gio=9)and(c_phut=0)and(dv_ph ut=5))then on_chuong <='1';
--9h05
elsif((c_gio=0)and(dv_gio=9)and(c_phut=5)and(dv_ph ut=0))then on_chuong <='1';
--9h50
elsif((c_gio=0)and(dv_gio=9)and(c_phut=5)and(dv_ph ut=5))then on_chuong <='1';
--9h55
elsif((c_gio=1)and(dv_gio=0)and(c_phut=4)and(dv_ph ut=0))then on_chuong <='1';
--10h40
elsif((c_gio=1)and(dv_gio=0)and(c_phut=4)and(dv_ph ut=5))then on_chuong <='1';
--10h45
elsif((c_gio=1)and(dv_gio=1)and(c_phut=3)and(dv_ph ut=0))then on_chuong <='1';
--11h30
--chieu
elsif((c_gio=1)and(dv_gio=3)and(c_phut=0)and(dv_ph ut=0))then on_chuong <='1';
--13h00
elsif((c_gio=1)and(dv_gio=3)and(c_phut=4)and(dv_ph ut=5))then on_chuong <='1';
--13h45
elsif((c_gio=1)and(dv_gio=3)and(c_phut=5)and(dv_ph ut=0))then on_chuong <='1';
--13h50
elsif((c_gio=1)and(dv_gio=4)and(c_phut=3)and(dv_ph ut=5))then on_chuong <='1';
--14h35
elsif((c_gio=1)and(dv_gio=4)and(c_phut=4)and(dv_ph ut=5))then on_chuong <='1';
--14h45
elsif((c_gio=1)and(dv_gio=5)and(c_phut=3)and(dv_ph ut=0))then on_chuong <='1';
--15h30
elsif((c_gio=1)and(dv_gio=5)and(c_phut=3)and(dv_ph ut=5))then on_chuong <='1';
--15h35
elsif((c_gio=1)and(dv_gio=6)and(c_phut=2)and(dv_ph ut=0))then on_chuong <='1';
--16h20
elsif((c_gio=1)and(dv_gio=6)and(c_phut=2)and(dv_ph ut=5))then on_chuong <='1';
--16h20
elsif((c_gio=1)and(dv_gio=7)and(c_phut=1)and(dv_ph ut=0))then on_chuong <='1';
--17h10
elsif((c_gio=1)and(dv_gio=7)and(c_phut=1)and(dv_ph ut=5))then on_chuong <='1';
--17h15
elsif((c_gio=1)and(dv_gio=8)and(c_phut=0)and(dv_ph ut=0))then on_chuong <='1';
--18h00
else on_chuong <='0';
end if;
end if;
end process bao_chuong;
spk <=on_chuong and clk_quet;
end dong_ho_so;
đây là khai báo kiểu chân
NET "clk" LOC = "p38" ;
NET "ctrl_seg7<0>" LOC = "p116" ;
NET "ctrl_seg7<1>" LOC = "p114" ;
NET "ctrl_seg7<2>" LOC = "p112" ;
NET "ctrl_seg7<3>" LOC = "p110" ;
NET "ctrl_seg7<4>" LOC = "p106" ;
NET "ctrl_seg7<5>" LOC = "p104" ;
NET "data_seg7<0>" LOC = "p118" ;
NET "data_seg7<1>" LOC = "p120" ;
NET "data_seg7<2>" LOC = "p124" ;
NET "data_seg7<3>" LOC = "p126" ;
NET "data_seg7<4>" LOC = "p129" ;
NET "data_seg7<5>" LOC = "p131" ;
NET "data_seg7<6>" LOC = "p133" ;
NET "out_clk" LOC = "p140" ;
NET "pb_cong" LOC = "p137" ;
NET "pb_menu" LOC = "p142" ;
NET "pb_ok" LOC = "p102" ;
NET "pb_tru" LOC = "p139" ;
NET "rst" LOC = "p92" ;
NET "spk" LOC = "p138" ;
Mong các bạn giúp đở .mình cảm ơn !
core VHDL :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use ieee.numeric_bit.all;
package ctc is
type so_09 is range 0 to 9;
type so_17 is range 0 to 17;
type phut_giay is range 0 to 59;
type type_data_seg7 is array (6 downto 0) of bit ;
type type_ctrl_seg7 is array (5 downto 0) of bit;
function ctc_data_seg7 (v_data :so_09)return type_data_seg7;
function ctc_ctrl_seg7(vao:so_17)return type_ctrl_seg7;
end package ctc;
package body ctc is
function ctc_data_seg7(v_data:so_09) return type_data_seg7 is
begin
case(v_data) is --abcdefg
when 0 => return "0000001";
when 1 => return "1001111";
when 2 => return "0010010";
when 3 => return "0000110";
when 4 => return "1001100";
when 5 => return "0100100";
when 6 => return "0100000";
when 7 => return "0001111";
when 8 => return "0000000";
when 9 => return "0000100";
when others => return "1111111";
end case;
end function ctc_data_seg7;
function ctc_ctrl_seg7(vao:so_17)return type_ctrl_seg7 is
begin
case(vao) is
when 0 => return "111111";
when 1 => return "000001";
when 2 => return "000010";
when 3 => return "000100";
when 4 => return "001000";
when 5 => return "010000";
when 6 => return "100000";
when others =>return "000000";
end case;
end function ctc_ctrl_seg7;
end package body ctc;
--------- khoi tao xung chuan 1hz----------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use ieee.numeric_bit.all;
use work.ctc.all;
entity dh_so is
port (rst:in bit;
clk:in bit;
pb_menu:in bit;
pb_tru:in bit;
pb_cong:in bit;
pb_ok: in bit;
out_clk: out bit;
spk : out bit;
data_seg7:out type_data_seg7;
ctrl_seg7:out type_ctrl_seg7);
end dh_so;
architecture dong_ho_so of dh_so is
constant max_dem:integer :=250;
constant tg_quet_led:integer:=1842;
signal clk_giay:bit:='0';
signal clk_quet:bit:='0';
signal dieukhien_seg7:so_17:=0;
signal cong_tru:bit :='1';
signal co_cong_tru:bit:='0';
signal tg:so_09;
signal dv_giay:so_09:=0;
signal c_giay:so_09:=0;
signal dv_phut:so_09:=0;
signal c_phut : so_09:=0;
signal dv_gio:so_09:=0;
signal c_gio:so_09:=0;
signal dv_thu : so_09:=2;
signal on_chuong: bit :='0';
--su dung cho quet led-------------------
begin
xung_quet_led: process(rst,clk)
variable dem_quet:integer:=0;
begin--clk dau vao la 1,842mhz
if (rst='0') then dem_quet:=0;
clk_quet<='0';
elsif(clk'event and clk='1') then
if (dem_quet=tg_quet_led) then
clk_quet<=not clk_quet;
dem_quet:=0;
else
dem_quet:=dem_quet +1;
end if;
end if;
end process xung_quet_led;
---su dung dem giay------------
xung_chuan_giayrocess(rst,clk_quet)
variable dem_giay:integer:=0;
begin ---clk dau vao la 1,842Mhz
if (rst='0') then dem_giay:=0;clk_giay<='0';
elsif(clk_quet'event and clk_quet='1') then
if (dem_giay = max_dem)then
clk_giay<=not clk_giay;
dem_giay:=0;
else
dem_giay:=dem_giay+1;
end if;
end if;
end process xung_chuan_giay;
out_clk<=clk_giay;
--khoi hien thi ra led 7 thanh ---------------------
khoi_hien_thirocess(rst,clk_quet,dv_giay,c_giay,dv_phut,c_phut, dv_gio,c_gio,dieukhien_seg7)
variable dem_ht:so_17:=0;
begin
if (rst='0')then
ctrl_seg7<=ctc_ctrl_seg7(17);
dem_ht:=1;
elsif(clk_quet'event and clk_quet='1')then
if(dem_ht=16)then
dem_ht:=1;
else
dem_ht:=dem_ht+1;
end if;
case (dem_ht) is
when 1 => ctrl_seg7<=ctc_ctrl_seg7(1) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(dv_giay);
when 2 => ctrl_seg7<=ctc_ctrl_seg7(2) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(c_giay);
when 3 => ctrl_seg7<=ctc_ctrl_seg7(3) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(dv_phut);
when 4 => ctrl_seg7<=ctc_ctrl_seg7(4) and ctc_ctrl_seg7(dieukhien_seg7); data_seg7 <= ctc_data_seg7(c_phut);
when 5 => ctrl_seg7<=ctc_ctrl_seg7(5) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(dv_gio);
when 6 => ctrl_seg7<=ctc_ctrl_seg7(6) and ctc_ctrl_seg7(dieukhien_seg7);
data_seg7 <= ctc_data_seg7(c_gio);
when others => ctrl_seg7<=ctc_ctrl_seg7(17);
end case;
end if;
end process khoi_hien_thi;
-- khoi phim nhan-----------------
khoi_phim_menu_okrocess
begin
if((rst='0')or(pb_ok='0')) then
dieukhien_seg7 <=0;
elsif (pb_menu='0') then
if (dieukhien_seg7 = 6) then dieukhien_seg7<=1;
else
dieukhien_seg7 <= dieukhien_seg7+ 1;
end if;
end if;
wait until pb_menu ='1';
end process khoi_phim_menu_ok;
cong_tru <=pb_tru and pb_cong;
khoi_phim_cong_trurocess
begin
co_cong_tru <='0';
case (dieukhien_seg7) is
when 1 =>tg <=dv_giay;
if (pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong='0')then
if(tg <9)then tg<=tg+1;
end if;
end if;
when 2 => tg <=c_giay;
if(pb_tru ='0')then
if(tg >0)then tg<=tg-1;
end if;
elsif(pb_cong ='0')then
if(tg <5)then tg <=tg+1;
end if;
end if;
when 3 =>tg <=dv_phut;
if(pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong ='0')then
if(tg <9)then tg<=tg+1;
end if;
end if;
when 4 =>tg <=c_phut;
if(pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong='0')then
if(tg <5)then tg <=tg+1;
end if;
end if;
when 5 =>tg <=dv_gio;
if(pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong='0')then
if(tg <9)then tg <=tg+1;
end if;
end if;
when 6 =>tg <=c_gio;
if(pb_tru='0')then
if(tg >0)then tg <=tg-1;
end if;
elsif(pb_cong='0')then
if(tg <2)then tg<=tg+1;
end if;
end if;
when others => null;
end case;
co_cong_tru <='1';
wait until cong_tru='1';
end process khoi_phim_cong_tru;
--khoi thuc hien dem gio, phut, giay
--suon am cua ban phim, suon duong cua clk_giay
khoi_dong_horocess(rst,clk_giay,dieukhien_seg7,tg,co_cong_tru)
begin
if(rst='0')then
dv_giay <=0;c_giay <=0;
dv_phut <=0;c_phut <=0;
dv_gio <=0;c_gio <=0;
elsif(dieukhien_seg7 /=0 and co_cong_tru='1')then
case (dieukhien_seg7)is
when 1 => dv_giay <=tg;
when 2 => c_giay <=tg;
when 3 => dv_phut <=tg;
when 4 =>c_phut <=tg;
when 5 =>dv_gio <=tg;
when 6 =>c_gio <=tg;
when others =>null;
end case;
elsif(clk_giay'event and clk_giay='1')then --clk =1;
if(dv_giay=9)then dv_giay <=0;
if(c_giay=5)then c_giay <=0;
if(dv_phut=9)then dv_phut <=0;
if(c_phut=5)then c_phut <=0;
if(((dv_gio=3)and(c_gio=2))or((dv_gio=9)and(c_gio/=2)))then dv_gio <=0;
if(c_gio=2)then c_gio <=0;
if(dv_thu=8)then dv_thu <=2;
else dv_thu<=dv_thu+1;
end if;
else c_gio<=c_gio+1;
end if;
else dv_gio <=dv_gio+1;
end if;
else c_phut <=c_phut+1;
end if;
else dv_phut <=dv_phut+1;
end if;
else c_giay <=c_giay+1;
end if;
else dv_giay <=dv_giay+1;end if;
end if;
end process khoi_dong_ho;
--khoi bao chuong -------------------------
bao_chuongrocess(c_gio,dv_gio,c_phut,dv_phut,dv_thu)
begin
if(dv_thu/=8)then
if((c_gio=0)and(dv_gio=6)and(c_phut=3)and(dv_phut= 0))then on_chuong <='1';
--6h30
elsif((c_gio=0)and(dv_gio=7)and(c_phut=1)and(dv_ph ut=5))then on_chuong <='1';
--7h15
elsif((c_gio=0)and(dv_gio=7)and(c_phut=2)and(dv_ph ut=0))then on_chuong <='1';
--7h20
elsif((c_gio=0)and(dv_gio=8)and(c_phut=0)and(dv_ph ut=5))then on_chuong <='1';
--8h05
elsif((c_gio=0)and(dv_gio=8)and(c_phut=1)and(dv_ph ut=5))then on_chuong <='1';
--8h15
elsif((c_gio=0)and(dv_gio=9)and(c_phut=0)and(dv_ph ut=0))then on_chuong <='1';
--9h00
elsif((c_gio=0)and(dv_gio=9)and(c_phut=0)and(dv_ph ut=5))then on_chuong <='1';
--9h05
elsif((c_gio=0)and(dv_gio=9)and(c_phut=5)and(dv_ph ut=0))then on_chuong <='1';
--9h50
elsif((c_gio=0)and(dv_gio=9)and(c_phut=5)and(dv_ph ut=5))then on_chuong <='1';
--9h55
elsif((c_gio=1)and(dv_gio=0)and(c_phut=4)and(dv_ph ut=0))then on_chuong <='1';
--10h40
elsif((c_gio=1)and(dv_gio=0)and(c_phut=4)and(dv_ph ut=5))then on_chuong <='1';
--10h45
elsif((c_gio=1)and(dv_gio=1)and(c_phut=3)and(dv_ph ut=0))then on_chuong <='1';
--11h30
--chieu
elsif((c_gio=1)and(dv_gio=3)and(c_phut=0)and(dv_ph ut=0))then on_chuong <='1';
--13h00
elsif((c_gio=1)and(dv_gio=3)and(c_phut=4)and(dv_ph ut=5))then on_chuong <='1';
--13h45
elsif((c_gio=1)and(dv_gio=3)and(c_phut=5)and(dv_ph ut=0))then on_chuong <='1';
--13h50
elsif((c_gio=1)and(dv_gio=4)and(c_phut=3)and(dv_ph ut=5))then on_chuong <='1';
--14h35
elsif((c_gio=1)and(dv_gio=4)and(c_phut=4)and(dv_ph ut=5))then on_chuong <='1';
--14h45
elsif((c_gio=1)and(dv_gio=5)and(c_phut=3)and(dv_ph ut=0))then on_chuong <='1';
--15h30
elsif((c_gio=1)and(dv_gio=5)and(c_phut=3)and(dv_ph ut=5))then on_chuong <='1';
--15h35
elsif((c_gio=1)and(dv_gio=6)and(c_phut=2)and(dv_ph ut=0))then on_chuong <='1';
--16h20
elsif((c_gio=1)and(dv_gio=6)and(c_phut=2)and(dv_ph ut=5))then on_chuong <='1';
--16h20
elsif((c_gio=1)and(dv_gio=7)and(c_phut=1)and(dv_ph ut=0))then on_chuong <='1';
--17h10
elsif((c_gio=1)and(dv_gio=7)and(c_phut=1)and(dv_ph ut=5))then on_chuong <='1';
--17h15
elsif((c_gio=1)and(dv_gio=8)and(c_phut=0)and(dv_ph ut=0))then on_chuong <='1';
--18h00
else on_chuong <='0';
end if;
end if;
end process bao_chuong;
spk <=on_chuong and clk_quet;
end dong_ho_so;
đây là khai báo kiểu chân
NET "clk" LOC = "p38" ;
NET "ctrl_seg7<0>" LOC = "p116" ;
NET "ctrl_seg7<1>" LOC = "p114" ;
NET "ctrl_seg7<2>" LOC = "p112" ;
NET "ctrl_seg7<3>" LOC = "p110" ;
NET "ctrl_seg7<4>" LOC = "p106" ;
NET "ctrl_seg7<5>" LOC = "p104" ;
NET "data_seg7<0>" LOC = "p118" ;
NET "data_seg7<1>" LOC = "p120" ;
NET "data_seg7<2>" LOC = "p124" ;
NET "data_seg7<3>" LOC = "p126" ;
NET "data_seg7<4>" LOC = "p129" ;
NET "data_seg7<5>" LOC = "p131" ;
NET "data_seg7<6>" LOC = "p133" ;
NET "out_clk" LOC = "p140" ;
NET "pb_cong" LOC = "p137" ;
NET "pb_menu" LOC = "p142" ;
NET "pb_ok" LOC = "p102" ;
NET "pb_tru" LOC = "p139" ;
NET "rst" LOC = "p92" ;
NET "spk" LOC = "p138" ;
Mong các bạn giúp đở .mình cảm ơn !
Comment