|
|
|
|
|
|
|
|
|
|
|
|
T Flip-Flop
|
|
|
|
|
|
|
|
|
|
|
|
Asynchronous reset T - FF
|
|
|
|
|
|
1 -------------------------------------------------------
2 -- Design Name : tff_async_reset
3 -- File Name : tff_async_reset.vhd
4 -- Function : T flip-flop async reset
5 -- Coder : Deepak Kumar Tala (Verilog)
6 -- Translator : Alexander H Pham (VHDL)
7 -------------------------------------------------------
8 library ieee;
9 use ieee.std_logic_1164.all;
10
11 entity tff_async_reset is
12 port (
13 data :in std_logic;-- Data input
14 clk :in std_logic;-- Clock input
15 reset :in std_logic;-- Reset input
16 q :out std_logic -- Q output
17
18 );
19 end entity;
20
21 architecture rtl of tff_async_reset is
22 signal t :std_logic;
23 begin
24 process (clk, reset) begin
25 if (reset = '0') then
26 t <= '0';
27 elsif (rising_edge(clk)) then
28 t <= not t;
29 end if;
30 end process;
31 q <= t;
32 end architecture;
You could download file vhdl_examples here
|
|
|
|
|
|
Synchronous reset T - FF
|
|
|
|
|
|
1 -------------------------------------------------------
2 -- Design Name : tff_sync_reset
3 -- File Name : tff_sync_reset.vhd
4 -- Function : T flip-flop sync reset
5 -- Coder : Deepak Kumar Tala (Verilog)
6 -- Translator : Alexander H Pham (VHDL)
7 -------------------------------------------------------
8 library ieee;
9 use ieee.std_logic_1164.all;
10
11 entity tff_sync_reset is
12 port (
13 data :in std_logic;-- Data input
14 clk :in std_logic;-- Clock input
15 reset :in std_logic;-- Reset input
16 q :out std_logic -- Q output
17
18 );
19 end entity;
20
21 architecture rtl of tff_sync_reset is
22 signal t :std_logic;
23 begin
24 process (clk) begin
25 if (rising_edge(clk)) then
26 if (reset = '0') then
27 t <= '0';
28 else
29 t <= not t;
30 end if;
31 end if;
32 end process;
33 q <= t;
34 end architecture;
You could download file vhdl_examples here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|