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

Subversion Repositories modbus

[/] [modbus/] [trunk/] [enlace/] [shift9_r.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 guanucolui
--------------------------------------------------------------------------------
2
-- Company: University of Vigo
3
-- Engineer:  L. Jacobo Alvarez Ruiz de Ojeda
4
--
5
-- Create Date:    10:00:00 10/18/06
6
-- Design Name:    
7
-- Module Name:    shift9_R - Behavioral
8
-- Project Name:   
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description: 9 bits shift register with serial in and parallel out, shift_enable control signal
12
-- and right shifting.
13
--
14
-- Dependencies:
15
-- 
16
-- Revision:
17
-- Revision 0.01 - File Created
18
-- Additional Comments:
19
-- 
20
--------------------------------------------------------------------------------
21
library IEEE;
22
use IEEE.STD_LOGIC_1164.ALL;
23
use IEEE.STD_LOGIC_ARITH.ALL;
24
use IEEE.STD_LOGIC_UNSIGNED.ALL;
25
 
26
---- Uncomment the following library declaration if instantiating
27
---- any Xilinx primitives in this code.
28
--library UNISIM;
29
--use UNISIM.VComponents.all;
30
 
31
entity shift9_r is
32
    Port ( clk : in std_logic;
33
           reset : in std_logic;
34
           msb_in : in std_logic;
35
           shift_enable : in std_logic;
36
           q_shift : out std_logic_vector(8 downto 0));
37
end shift9_r;
38
 
39
architecture Behavioral of shift9_r is
40
 
41
signal q_shift_aux: std_logic_vector (8 downto 0);
42
 
43
begin
44
 
45
-- Signal assignment
46
q_shift <= q_shift_aux;
47
 
48
process (clk, reset, msb_in, shift_enable, q_shift_aux)
49
begin
50
   if reset ='1' then
51
      q_shift_aux <= "000000000";
52
   elsif clk'event and clk='1' then
53
                if shift_enable = '1' then
54
                        q_shift_aux <= msb_in & q_shift_aux (8 downto 1);
55
      end if;
56
   end if;
57
end process;
58
 
59
end Behavioral;

powered by: WebSVN 2.1.0

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