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

Subversion Repositories jart

[/] [jart/] [trunk/] [BLRT/] [scanFF.vhd] - Blame information for rev 75

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

Line No. Rev Author Line
1 12 jguarin200
-- Author : Julian Andres Guarin Reyes.
2
-- Project : JART, Just Another Ray Tracer.
3
-- email : jguarin2002 at gmail.com, j.guarin at javeriana.edu.co
4
 
5
-- This code was entirely written by Julian Andres Guarin Reyes.
6
-- The following code is licensed under GNU Public License
7
-- http://www.gnu.org/licenses/gpl-3.0.txt.
8
 
9
 -- This file is part of JART (Just Another Ray Tracer).
10
 
11
    -- JART (Just Another Ray Tracer) is free software: you can redistribute it and/or modify
12
    -- it under the terms of the GNU General Public License as published by
13
    -- the Free Software Foundation, either version 3 of the License, or
14
    -- (at your option) any later version.
15
 
16
    -- JART (Just Another Ray Tracer) is distributed in the hope that it will be useful,
17
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
    -- GNU General Public License for more details.
20
 
21
    -- You should have received a copy of the GNU General Public License
22
    -- along with JART (Just Another Ray Tracer).  If not, see <http://www.gnu.org/licenses/>.
23
 
24
-- A scan flipflop hdl code. Note the logic function q <= (s0 and s ) or (s1 and ~s) its a mux with s as selector and s0 and s1 as selectable inputs.
25
library ieee;
26
use ieee.std_logic_1164.all;
27
 
28
 
29
entity scanFF is
30
        generic (       W       : integer := 8);
31 31 jguarin200
        port    (
32
                                clk,rst,ena,sel         : std_logic; -- The usual  control signals
33 12 jguarin200
 
34 31 jguarin200
                                d0,d1                           : std_logic_vector (W-1 downto 0);       -- The two operands.
35
                                q                                       : std_logic_vector (W-1 downto 0)        -- The selected data.
36
 
37 12 jguarin200
        );
38
end entity;
39
 
40
architecture rtl of scanFF is
41
begin
42
 
43 31 jguarin200
        dff_ena_sel : process (clk,rst,ena)
44
 
45
        begin
46 12 jguarin200
 
47 31 jguarin200
                if rst = '0' then
48
                        q <= '0' & (others => '1');
49
                elsif rising_edge (clk) and ena = '1' then
50
                        if sel='1' then
51
                                q <= d1;
52
                        else
53
                                q <= d0;
54 12 jguarin200
                        end if;
55 31 jguarin200
                end if;
56
        end process;
57
end rtl;
58 12 jguarin200
 
59 31 jguarin200
 
60
        end process;
61 12 jguarin200
 
62
end rtl;
63
 
64
 

powered by: WebSVN 2.1.0

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