|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
VHDL流水灯设计
, l: c9 ]* ^) g9 ^9 `6 U; t$ w l# ~8 |
library ieee;- {$ V7 T4 ]% e9 L- ?
use ieee.std_logic_1164.all;
! J6 U- t3 k/ S5 H1 [) Y5 E3 Z) Ause ieee.std_logic_unsigned.all;% {0 b: C( s( r' B
use ieee.std_logic_arith.all;
1 n/ W3 l, j0 t# t" X1 P/ qentity liushui is5 E% o& d% L) V; [# h* ^
port(7 x* Z9 [! N# w: ?
clk:IN std_logic;
9 r, @* ^% I3 \, y) uclr:IN std_logic;
; Q# ~6 L% s$ s) N8 K* w4 d/ Sena:IN std_logic;
- m$ n% h" i# i! a; r# c( g" c$ Y; G5 wy ut std_logic_vector (7 downto 0) );+ I1 o( p1 S6 \0 o% `& C
end;) K& b$ l, r' k
architecture behave of liushui is
% t7 i! L& N9 d# e$ U# jbegin* f, N( ~2 G6 }8 s
signal y_out:std_logic_vector(7 downto 0); process(clk,clr,ena) if clr = '0' then y_out<= "00000001"; elsif clk'event and clk = '1' then if ena = '1' then y_out <= y_out<<1; end if; end if;end process; y <= y_out; end behave; | 6 j5 L B1 `8 i- b8 c+ I
( E2 Y7 E0 h: M0 R3 Q9 r& }0 e
+ I7 W; `# j+ Q7 `
. \* h6 i: x- |3 Y+ _: z+ x) G, p3 D9 L- g H6 e4 }& z9 L
9 [: |. t8 Q% H% w" n4 p" i& j
|
$ ? y5 d9 C7 x# W | : C9 Y9 E0 w Q( n+ @; ]
|
|