library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity DEM_NHIPHAN_4BIT is
Port ( R : in STD_LOGIC;
CLK : in STD_LOGIC;
Q : out STD_LOGIC_VECTOR (3 downto 0));
end DEM_NHIPHAN_4BIT;
architecture HANH of DEM_NHIPHAN_4BIT is
begin
PROCESS (CLK,R)
VARIABLE QTAM: STD_LOGIC_VECTOR(3 DOWNTO 0):="1111";
BEGIN
IF R='0' THEN QTAM:="0000";
ELSIF CLK='1' AND CLK'EVENT THEN
QTAM:=QTAM-1;
END IF;
Q <= QTAM;
END PROCESS;
end HANH;
// Chọn Clock : 10-160-...-160-80-40-20
0 nhận xét:
Đăng nhận xét