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 2

Go to most recent revision | 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
        port(
7
    clock : in  std_logic;
8
                reset : in      std_logic;
9
                value : out     std_logic_vector);
10
end counter;
11
 
12
architecture behavioral of counter is
13
 
14
        signal internal_value : std_logic_vector(value'range):= (others => '0');
15
 
16
begin
17
 
18
  counter_proc:
19
  process(clock)
20
  begin
21
    if (rising_edge(clock)) then
22
      if (reset = '1') then
23
        internal_value <= (others => '0');
24
      else
25
        internal_value <= internal_value + '1';
26
      end if;
27
   end if;
28
   end process;
29
 
30
  value <= internal_value;
31
 
32
end;

powered by: WebSVN 2.1.0

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