OpenCores
URL https://opencores.org/ocsvn/generic_booth_multipler/generic_booth_multipler/trunk

Subversion Repositories generic_booth_multipler

[/] [generic_booth_multipler/] [trunk/] [rtl/] [modules/] [00.COUNTER.vhd] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alimpk
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.std_logic_unsigned.all;
4
 
5
entity counter is
6 6 alimpk
  generic(
7
                size : integer:= 4
8
        );
9 2 alimpk
        port(
10
    clock : in  std_logic;
11
                reset : in      std_logic;
12 6 alimpk
                value : out     std_logic_vector(size-1 downto 0));
13 2 alimpk
end counter;
14
 
15
architecture behavioral of counter is
16
 
17
        signal internal_value : std_logic_vector(value'range):= (others => '0');
18
 
19
begin
20
 
21
  counter_proc:
22
  process(clock)
23
  begin
24
    if (rising_edge(clock)) then
25
      if (reset = '1') then
26
        internal_value <= (others => '0');
27
      else
28
        internal_value <= internal_value + '1';
29
      end if;
30
   end if;
31
   end process;
32
 
33
  value <= internal_value;
34
 
35
end;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.