Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
------------------------------------------------
ENTITY shiftreg4 IS
PORT ( P: IN STD_LOGIC_VECTOR (3 DOWNTO 0);
Clock:IN STD_LOGIC;
LOAD,I:IN STD_LOGIC;
Q:BUFFER IN STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END shiftreg4;
------------------------------------------------
ARCHITECTURE arch OF shiftreg4 IS
BEGIN
PROCESS
BEGIN
WAIT UNTIL Clock'event AND Clock='1';
IF LOAD='1' THEN
Q<=P;
ELSE
Q(0)<=Q(1);
Q(1)<=Q(2);
Q(2)<=Q(3);
Q(3)<=I;
END IF
END PROCESS;
END ARCH;
------------------------------------------------
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.