library ieee;
library altera;
use altera.altera_primitives_components.all;
use ieee.std_logic_1164.all;
entity qaz is
port( x,b,y,c,clk,clrn,prn:in std_logic;
a:out std_logic);
end qaz;
architecture a of qaz is
component jkff
port(
j,k,clk,clrn,prn:in std_logic;
q:out std_logic);
end component;
component CLOCK123
port( CLK:in std_logic;
CLKOUT:out std_logic);
end component;
signal S1:std_logic;
signal S2:std_logic;
signal clk123:std_logic;
begin
S1<=(x and b)or(not y and c);
S2<=(not b and y)or c;
w1:CLOCK123 port map(clk,clk123);
w2:jkff port map(S1,S2,clk123,clrn,prn,a);

end a;

 

-------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity CLOCK123 is
port( CLK:in std_logic;
CLKOUT:out std_logic);
end CLOCK123;
architecture a of CLOCK123 is
signal CNT:std_logic_vector(23 downto 0);
begin
process(CLK)
begin
if(CLK'EVENT AND CLK='1')then
if CNT=15999999 then CNT<=(others=>'0');
else CNT<=CNT+1;
end if;
end if;
CLKOUT<=CNT(23);
end process;
end a;
 

Posted by denisueng at 痞客邦 PIXNET Comments(2) Trackback(0) Hits(51)


open trackbacks list Trackbacks (0)

Comments (2)

Post Comment
  • 請點左7上方小9房2子看看唷

    歡迎大家來看看唷7
  • 請6點1左0上4方8小1房9子唷

    好東西只跟好朋友分享唷5

Comment Permissions: Allow commenting

Leave Comment

*Name/Nickname
E-mail
Personal Website
Comment Title
*Comment
* Private Comment