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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [src/] [components/] [zerof.vhdl] - Blame information for rev 9

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 lcdsgmtr
-- Copyright 2015, Jürgen Defurne
2
--
3
-- This file is part of the Experimental Unstable CPU System.
4
--
5
-- The Experimental Unstable CPU System Is free software: you can redistribute
6
-- it and/or modify it under the terms of the GNU Lesser General Public License
7
-- as published by the Free Software Foundation, either version 3 of the
8
-- License, or (at your option) any later version.
9
--
10
-- The Experimental Unstable CPU System is distributed in the hope that it will
11
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
13
-- General Public License for more details.
14
--
15
-- You should have received a copy of the GNU Lesser General Public License
16
-- along with Experimental Unstable CPU System. If not, see
17
-- http://www.gnu.org/licenses/lgpl.txt.
18
 
19
 
20
LIBRARY IEEE;
21
USE IEEE.STD_LOGIC_1164.ALL;
22
USE IEEE.numeric_std.ALL;
23
 
24
ENTITY zerof IS
25
  GENERIC (
26
    w_data : NATURAL RANGE 1 TO 32 := 16);
27
  PORT (
28
    A     : IN  STD_LOGIC_VECTOR(w_data - 1 DOWNTO 0);
29
    zero  : OUT STD_LOGIC);
30
END ENTITY zerof;
31
 
32
ARCHITECTURE Behavioral OF zerof IS
33
 
34
BEGIN  -- Behavioral
35
 
36
  -- purpose: Check if A is zero or non zero
37
  -- type   : combinational
38
  -- inputs : A
39
  -- outputs: zero
40
  TESTZ : PROCESS (A)
41
  BEGIN  -- PROCESS TESTZ
42
 
43
    IF UNSIGNED(A) = to_unsigned(0,w_data) THEN
44
      zero  <= '1';
45
    ELSE
46
      zero  <= '0';
47
    END IF;
48
 
49
  END PROCESS TESTZ;
50
 
51
END Behavioral;

powered by: WebSVN 2.1.0

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