dOut currentState currentState process clk clrn begin if clrn then cur

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
dOut <= currentState;
s <= currentState( 3 );
process( clk, clrn ) begin
if( clrn = '0' ) then
currentState <= ( others => '0' );
elsif( clk'event and clk = '0' ) then
if( oen = '0' ) then
if( ld = '1' ) then
currentState <= dIn;
else
currentState( 0 ) <= ser;
for i in 3 downto 1 loop
currentState( i ) <= currentState( i - 1 );
end loop;
end if;
end if;
end if;
end process;