Need help with simple coding

Discussion in 'Programming General' started by legendisborn, Jul 18, 2012.

Need help with simple coding
  1. Unread #1 - Jul 18, 2012 at 1:22 AM
  2. legendisborn
    Joined:
    Jul 2, 2010
    Posts:
    205
    Referrals:
    0
    Sythe Gold:
    0

    legendisborn Active Member
    Banned

    Need help with simple coding

    Hi, i recently got this as an assigment but i cant compile to make it work. Hope you guys can help me out. THANKS !

    The question
    Write a description of a counter that can count up on the negative clock edge. When counting up, the counter counts in binary from 2 to 7 and repeats. When resetting the counter with a LOW signal at the reset input, the counter’s output value is 2. An Led is lit when the output reaches a value of 7

    What i done so far

    library ieee;
    use ieee.std_logic_1164.all;
    use iee.numeric_std.all;

    entity counter_up is

    port (clk, reset_bar : in std_logic;
    led_out : out std_logic;
    q : out std_logic_vector ( 3 downto 0);

    end counter_up;

    architecture flow of counter_up is

    signal count_up : unsigned ( 3 downto 0);

    begin
    process ( clk, reset_bar)
    begin
    if ( reset_bar ='0') then
    count_sig <="0010";

    elsif falling_edge (clk) then
    if (count_sig =7 ) then
    count_sig <= "0010";
    (led_out = '1')
    count_sig <="0111";


    else
    count_sig<= count_sign +1;


    end if;
    end if;

    end process;

    q<= std_logic_vector (count_sig);

    end flow;



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

    My lect told me something wrong with this but he does not want to tell where when wrong. I will be grateful if you guys fix this for me. Thanks
     
< [Source] Easy Icon Extractor | What language would it be best to write this in? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site