serial to parallel shift register

Status
Not open for further replies.

lahrach

Full Member level 3
Joined
Feb 6, 2009
Messages
170
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,285
I need a vhdl code of serial to parallel shift register

best regards
 

Try this. (Not tested) :!:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;


entity SerialParallel is
Port (
DATA : in STD_LOGIC;
CLK : in STD_LOGIC;
STRB : int STD_LOGIC;
DATAOUT : out STD_LOGIC_VECTOR(7 downto 0);
);
end SerialParallel;

architecture Behavioral of SerialParallel is

signal pre_latch : std_logic_vector(7 downto 0);


begin

process (CLK) begin
if CLK'event and CLK='1' then
pre_latch(pre_latch'high downto 1)=pre_latch(pre_latch'high-1 downto 1);
pre_latch(0)=DATA;
end if;
end process;

process (STRB) begin
if STRB'event and STRB='1' then
DATAOUT(pre_latch'high downto 0)<=pre_latch(pre_latch'high downto 0);
end if;
end process;

end Behavioral;:!::!::!:
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…