eda-基于vhdl语言的经典电路设计内容摘要:

ignal dout :out std_logic_vector)。 end cspac。 package body cspac is procedure shift(signal din,s :in std_logic_vector。 signal dout :out std_logic_vector) is variable sc:integer。 begin sc:=conv_integer(s)。 for i in din39。 range loop if(sc+i=din39。 left) then dout(i)=din(sc+i)。 else dout(i)=din(sc+idin39。 left1)。 end if。 end loop。 end shift。 end cspac。 library ieee。 use。 use。 entity ex7_3_3 is port(din: in std_logic_vector(7 downto 0)。 s: in std_logic_vector(2 downto 0)。 clk,enb: in std_logic。 dout:out std_logic_vector(7 downto 0))。 end ex7_3_3。 architecture RTL of ex7_3_3 is begin process(clk) begin if(clk39。 event and clk=39。 139。 ) then if enb=39。 039。 then dout=din。 else shift(din,s,dout)。 end if。 end if。 end process。 end RTL。 触发器的设计 Library ieee。 use。 use。 entity d_ff is port(clk:in std_logic。 cz:in std_logic。 enb:in std_logic。 lc:in std_logic。 d:in std_logic。 q: out std_logic)。 end d_ff。 architecture behv of d_ff is begin process(clk,cz,enb,lc) begin if enb=39。 139。 then if cz=39。 139。 then q=39。 039。 elsif lc=39。 139。 then q=39。 139。 elsif clk39。 event and clk=39。 139。 then q=d。 end if。 end if。 end process。 end behv。 DE N AQP R EC L Rcl kqlcenbczco m b ~ 2dq ~ re g 0co m b ~ 1 寄存器的设计 library ieee。 use。 entity shfrt is port(clk,load:in std_logic。 din:in std_logic_vector(7 downto 0)。 qb:out std_logic)。 end shfrt。 architecture behav of shfrt is begin process (clk,load) variable reg8: std_logic_vector(7 downto 0)。 begin if clk39。 event and clk=39。 139。 then if load=39。 139。 then reg8 :=din。 else reg8(6 downto 0):=reg8(7 downto 1)。 end if。 end if。 qb=reg8(0)。 end process。 end behav。 D QP R EE N AC L RDE N AQP R EC L RSELD A T A AD A T A BO U T 0M U X 2 1re g 8 [ 6 . . 0 ]cl kl o a dqbd i n [ 7 . . 0 ]re g 8 ~ [ 6 . . 0 ]re g 8 [ 7 ] 6位七段 LED动态显示设计 library ieee。 use。 use。 entity display_6_led is port(clk:in std_logic。 num1:in std_logic_vector(3 downto 0)。 num2:in std_logic_vector(3 downto 0)。 num3:in std_logic_vector(3 downto 0)。 num4:in std_logic_vector(3 downto 0)。 num5:in std_logic_vector(3 downto 0)。 num6:in std_logic_vector(3 downto 0)。 led_a: out std_logic。 led_b: out std_logic。 led_c: out std_logic。 led_d: out std_logic。 led_e: out std_logic。 led_f: out std_logic。 led_g: out std_logic。 led_dp: out std_logic。 led_sa: out std_logic。 led_sb: out std_logic。 led_sc: out std_logic)。 end display_6_led。 architecture behav of display_6_led is signal q:std_logic_vector(5 downto 0)。 signal sel:std_logic_vector(2 downto 0)。 signal s:std_logic_vector(2 downto 0)。 signal num:std_logic_vector(3 downto 0)。 signal led:std_logic_vector(6 downto 0)。 begin s=q(5 downto 3)。 led_sa=sel(0)。 led_sb=sel(1)。 led_sc=sel(2)。 led_a=led(0)。 led_b=led(1)。 led_c=led(2)。 led_d=led(3)。 led_e=led(4)。 led_f=led(5)。 led_g=led(6)。 led_dp=39。 039。 process(clk) begin if(clk39。 event and clk=39。 139。 )then if(q=111111)then q=000000。 else q=q+39。 139。 end if。 end if。 end process。 process(num1,num2,num3,num4,num5,num6,sel,clk) begin if(clk39。 event and clk =39。 139。 )then if s=000 then num=num1。 sel=000。 elsif s=001 then num=num2。 sel=001。 elsif s=010 then num=num3。 sel=010。 elsif s=100 then num=num4。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。