Question about VHDL

Discussion in 'VHDL' started by laura_pretty05@yahoo.com.hk, Mar 7, 2006.

  1. Guest

    I have implemented a 8-bit synchronous counter by VHDL. The result is
    that the LED display show continuously running the count from 0 to
    F(in Hex). Now, I need to change the result which the LED display can
    count from 0 to 9 only. How can I change in the VHDL code? Can anyone
    answer me? Thanks a lot!!
    The following VHDL code are about 8-bit synchronous counter:
    Library IEEE;
    USE IEEE.std_logic_1164.all;
    USE IEEE.std_logic_arith.all;
    USE IEEE.std_logic_unsigned.all;

    ENTITY counter_eg IS
    PORT(
    PB1, clk_25MHz : IN std_logic;

    led0, led1, led2, led3, led4, led5, led6 : OUT std_logic);
    END counter_eg;


    ARCHITECTURE c OF counter_eg IS


    COMPONENT counter
    PORT(
    Clock, Reset : IN std_logic;
    count : OUT std_logic_vector(3 DOWNTO
    0));


    END COMPONENT;


    COMPONENT dec_7seg
    PORT(
    hex_digit : IN std_logic_vector(3
    DOWNTO 0);
    segment_a, segment_b, segment_c, segment_d,
    segment_e,
    segment_f, segment_g : OUT std_logic);
    END COMPONENT;


    COMPONENT clk_div
    PORT(
    clock_25MHz : IN std_logic;
    clock_1MHz : OUT std_logic;
    clock_100KHz : OUT std_logic;
    clock_10KHz : OUT std_logic;
    clock_1KHz : OUT std_logic;
    clock_100Hz : OUT std_logic;
    clock_10Hz : OUT std_logic;
    clock_1Hz : OUT
    std_logic);
    END COMPONENT;


    SIGNAL count : std_logic_vector(3 DOWNTO 0);
    SIGNAL clk_1KHz : std_logic;
    BEGIN
    c0: clk_div port map (clock_25MHz=> clk_25MHz,
    clock_1KHz=>clk_1KHz);
    c1: counter port map (clock=>clk_1KHz, reset=>PB1, count=>
    count);
    c2: dec_7seg port map (count, led0, led1, led2, led3, led4,
    led5,
    led6);


    END c;
     
    , Mar 7, 2006
    #1
    1. Advertising

  2. anupam Guest

    hi,

    Had it been your code ,you would have easily done that ....
    Change the counter to work from 0 to 9 or in the dec_7seg block ,put a
    contdition such that it doesn't work of 9 to F

    regards,
    Anupam Jain
     
    anupam, Mar 8, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    3
    Views:
    4,874
    walala
    Sep 18, 2003
  2. Replies:
    2
    Views:
    8,825
    Jim Lewis
    Mar 21, 2006
  3. dude

    VHDL 2002 vs VHDL 1993

    dude, Mar 23, 2006, in forum: VHDL
    Replies:
    1
    Views:
    1,341
    Nicolas Matringe
    Mar 23, 2006
  4. afd
    Replies:
    1
    Views:
    8,547
    Colin Paul Gloster
    Mar 23, 2007
  5. Kim Enkovaara
    Replies:
    9
    Views:
    2,039
    diogratia
    Oct 16, 2008
Loading...

Share This Page