need vhdl code for 0-99 bcd counter 7-seg display code

Status
Not open for further replies.

tubreh

Newbie level 2
Joined
Jul 28, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
hi all
i need vhdl code for 0-99 bcd counter 7-seg display code Changed by pressing the Button
tanx
 

Well, think about the basics. What do you need?
1. A 'ones' counter. Incremented at a clock. Ranging from 0..9
2. A 'tens' counter. Incremented when the 'ones' counter becomes 0. Ranging from 0..9
3. A 'translator' that converts the 'ones/'tens' value into a corresponding 7-segment code.

All these should be really straight-forward to think of. Very basic stuff.
To give you an idea, here is some pseudo code (unchecked):

Code:
process (clk)
if rising_edge(clk) then
  if ones = 9 then
    ones = 0;
    if tens = 9 then
      tens = 0;
    else
      tens <= tens + 1;
    end if;
  else
    ones <= ones + 1;
  end if;
end if;
end process;

with ones select
  7seg_lsb <= ".." when 0,
                   ".." when 1,
                   ....;

with tens select
  7seg_msb <= ".." when 0,
                   ".." when 1,
                   ....;
 

tnx all
:wink::wink:
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…