Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PLEASE HELP!!!vhdl code 4 bit sync conter t flip flop structure

Status
Not open for further replies.

tonnes9

Newbie level 2
Joined
Apr 28, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
hello every1 i am kind of a newbie to vhdl design.how do i design a 4 bit synchronous counter which uses T type flip flop?the counter increments on each positive edge of the clock if enable signal is asserted.
the counter is reset to 0 by using reset signal.
it uses an AND gate,where Tn=Q0Q1.....Qn-1

since its a synch. counter does it matter i use a synchr. reset or asynchr. reset?pls help realy urgent!!!
 
Last edited:

synchronous counter has nothing to do with synchronous reset or async reset

Just google and you will find numerous examples.
 

thanx lucbra for d reply i jus got a code but i am not so sure if it a synch. or asynch counter could any1 help me verify?stating why it is for either case??thanx

LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_unsigned.all;

ENTITY sync_counter IS
port (clock, Resetn, E : IN STD_LOGIC;
Q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0));
END sync_counter;

ARCHITECTURE Behavior OF sync_counter IS
SIGNAL Count : STD_LOGIC_VECTOR (3 DOWNTO 0);
BEGIN
PROCESS (Clock, Resetn)
BEGIN
IF REsetn = '0' THEN
Count <= "0000" ;
ELSIF (Clock'EVENT AND Clock = '1')THEN
IF E = '1' THEN
Count <= Count + 1;
ELSE
Count <= Count;
END IF;
END IF;
END PROCESS;
Q <= Count;
END Behavior;
 

its a synchronous counter because all of the counting occurs on clock edges.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top