Академический Документы
Профессиональный Документы
Культура Документы
Disear un contador sncrono JHONSON con dos entradas de control (A,B) que
realice la siguientes funciones:
Si A=0 y D=0 el contador esta inactivo
A=1 y D=0 el contador incrementa
A=0 y D=1 el contador decrementa
A=1 y D=1 carga en paralelo
a_2) Aplicacion y diseo de contadores sincronos
U3:B
10
11
2
3
U2:A
Q
2Y
U2:B
11
12
9
10
2X0
2X1
2X2
2X3
13
A
B
1E
2E
U3:A
Q
10
11
12
13
14
2
1
15
1X0
1X1
1X2
1X3
1Y
2X0
2X1
2X2
2X3
2Y
A
B
1E
2E
7474
U6
6
5
4
3
CLK
8
7474
74153
2
CLK
14
2
1
15
1Y
10
11
12
13
1X0
1X1
1X2
1X3
7474
U5
6
5
4
3
CLK
74153
7474
A
B
1E
2E
CLK
13
2Y
12
14
2
1
15
2X0
2X1
2X2
2X3
1Y
10
11
12
13
1X0
1X1
1X2
1X3
U4:A
1
0
U1
6
5
4
3
2
9
3
1
1
1
1
1
74153
CLK
QaQbQcQdQe
7474
CONTADOR JHONSON:
VHDL:
--Contador Jhonson
library IEEE;
use IEEE.std_logic_1164.all;
entity clock is
PORT( entrada : in std_logic;
reset : in std_logic;
salida : out std_logic);
end clock;
architecture Behavioral of clock is
signal temporal : std_logic;
signalcontador : integer range 0 to
6250000:=0;
begin
divisor_frecuencia:
process(reset,entrada)
begin
if (reset= '1') then
temporal<='0';
contador<= 0;
elsifrising_edge(entrada) then
if (contador=6250000) then
temporal<= not(temporal);
contador<= 0;
else
contador<= contador + 1;
end if;end if;end process;
salida<= temporal;
end Behavioral;
library IEEE;
use IEEE.std_logic_1164.all;
useIEEE.std_logic_unsigned.all;
entitycont is
port( --ckc: in std_logic;
counter: out
std_logic_vector(4 downto 0);
resete,e: in std_logic;
cinc_mhz: in std_logic;
D,U : out
std_logic_vector(6 downto 0));endcont;
architecture fun of cont is
component clock PORT( entrada : in
std_logic;
reset : in std_logic;
salida : out std_logic
);end component;
signal counter2,counter3 :
std_logic_vector(3 downto 0);
signalckc,cinco,res: std_logic;
begin
cinco<=cinc_mhz;
res<=resete;
u0: clockportmap(cinco,res,ckc);
process(ckc,resete,e)
begin
if(resete='1') then counter
<="00000";
elsif(ckc'event and ckc='1') then
if counter="00000" then
counter<="00001";
elsif counter="00001"
counter<="00011";
elsif counter="00011"
counter<="00111";
elsif counter="00111"
counter<="01111";
elsif counter="01111"
counter<="11111";
elsif counter="11111"
counter<="11110";
elsif counter="11110"
counter<="11100";
elsif counter="11100"
counter<="11000";
elsif counter="11000"
counter<="10000";
elsif counter="10000"
counter<="00000";
endprocess;endfun;
then
then
then
then
then
then
then
then
then
VHDL:
library IEEE;
use IEEE.std_logic_1164.all;
entity clock is
end clock;
architecture Behavioral of clock is
signal temporal : std_logic;
signalcontador : integer range 0 to
6250000:=0;
begin
divisor_frecuencia: process(reset,entrada)
begin
if (reset= '1') then
temporal<='0';
contador<= 0;
elsifrising_edge(entrada) then
if (contador=6250000) then
temporal<= not(temporal);
contador<= 0;
else
contador<= contador + 1;
endif;endif;end process;
salida<= temporal;
end Behavioral;
library IEEE;
use IEEE.std_logic_1164.all;
useIEEE.std_logic_unsigned.all;
entitycont is
port( --ckc: in std_logic;
counter,counterd: out
std_logic_vector(3 downto 0);
resete,e: in std_logic;
cinc_mhz: in std_logic;
D,U : out std_logic_vector(6
downto 0)); endcont;
architecture fun of cont is
component clock PORT(
entrada : in
std_logic;
reset : in std_logic;
salida : out std_logic
);end component;
component dec7_cat port( A: in
std_logic_vector(3 downto 0);
seg:
out std_logic_vector(6 downto 0));
end component;
signal counter2,counter3 :
std_logic_vector(3 downto 0);
signalckc,cinco,res: std_logic;
begin
cinco<=cinc_mhz;
res<=resete;
u0: clockportmap(cinco,res,ckc);
process(ckc,resete,e)
begin
if(resete='1') then
counter2<="0000";counter3<="0000";
elsif(e='1') then
counter3<=counter3+0;counter2<=count
er2+0;
elsif(ckc'event and ckc='1') then
if(counter2<"1001") then
counter2 <= counter2+1;
else counter2<="0000";
if(counter3<"1001") then
counter3<=counter3+1; else
counter3<="0000";
endif;endif;end if;
endprocess;endfun;
FOTO:
Contador de 0 a 99