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

Subversion Repositories mkjpeg

[/] [mkjpeg/] [trunk/] [design/] [BufFifo/] [multiplier.vhd] - Blame information for rev 67

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 67 mikel262
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    12:18:01 03/12/2011 
6
-- Design Name: 
7
-- Module Name:    multiplier - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
use ieee.numeric_std.all;
23
use IEEE.STD_LOGIC_ARITH.ALL;
24
use IEEE.STD_LOGIC_UNSIGNED.ALL;
25
 
26
 
27
 
28
 
29
-- Uncomment the following library declaration if using
30
-- arithmetic functions with Signed or Unsigned values
31
--use IEEE.NUMERIC_STD.ALL;
32
 
33
-- Uncomment the following library declaration if instantiating
34
-- any Xilinx primitives in this code.
35
--library UNISIM;
36
--use UNISIM.VComponents.all;
37
 
38
entity multiplier is
39
        port (
40
                                CLK                : in  std_logic;
41
                                RST                : in  std_logic;
42
                                -- 
43
                                img_size_x         : in  std_logic_vector(15 downto 0);
44
                                img_size_y         : in  std_logic_vector(15 downto 0);
45
 
46
                                --
47
                                result                                  : out std_logic_vector(31 downto 0);
48
                                threshold                               : out std_logic_vector(31 downto 0)
49
                        );
50
end multiplier;
51
 
52
architecture Behavioral of multiplier is
53
 
54
signal prev_x : std_logic_vector(15 downto 0);
55
signal prev_y : std_logic_vector(15 downto 0);
56
 
57
begin
58
        process(CLK, RST)
59
        begin
60
                if (RST = '1') then
61
                        result <= x"00000000";
62
                        threshold <= x"00000000";
63
                        prev_x <= x"0000";
64
                        prev_y <= x"0000";
65
                elsif (CLK'event and CLK = '1') then
66
 
67
                        if (prev_x /= img_size_x or prev_y /= img_size_y) then
68
                                result <= img_size_x * img_size_y;
69
                                threshold <= img_size_x * x"0007";
70
                        end if;
71
 
72
                        prev_x <= img_size_x;
73
                        prev_y <= img_size_y;
74
 
75
                end if;
76
 
77
        end process;
78
 
79
end Behavioral;
80
 

powered by: WebSVN 2.1.0

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