- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
SHIFTLNE.VHD
上传用户:dgjihui88
上传日期:2013-07-23
资源大小:43k
文件大小:1k
源码类别:
VHDL/FPGA/Verilog
开发平台:
MultiPlatform
- --shiftlne.vhd n-bitright-to-left shift register
- --with parallel load and enable
- library ieee ;
- use ieee.std_logic_1164.all ;
- entity shiftlne is
- generic ( n : integer := 7 ) ;
- port(
- r : in std_logic_vector(n-1 downto 0) ;--register input
- l : in std_logic ;--load
- e : in std_logic ;--enable
- w : in std_logic ;--series input
- clock : in std_logic ;--clock
- q : buffer std_logic_vector(n-1 downto 0) ) ;--register output
- end shiftlne ;
- architecture behavior of shiftlne is
- begin
- process
- begin
- wait until clock'event and clock = '1' ;
- if e = '1' then
- if l = '1' then
- q <= r ;--parallel load
- else
- q(0) <= w ;--series input to lowest bit
- genbits: for i in 1 to n-1 loop
- q(i) <= q(i-1) ;--shift low bit to high bit
- end loop ;
- end if ;
- end if ;
- end process ;
- end behavior ;