首页 » 科学 » EDA第三次实验(VHDL)--时序电路设计_波形_引脚

EDA第三次实验(VHDL)--时序电路设计_波形_引脚

乖囧猫 2024-12-08 03:57:35 0

扫一扫用手机浏览

文章目录 [+]

实验任务一:分频器设计

【实验代码】

EDA第三次实验(VHDL)--时序电路设计_波形_引脚 科学

library ieee;

use ieee.std_logic_1164.all;

entity shiyan7 is

port (

clkin:in std_logic;

clkout:out std_logic);

end shiyan7;

architecture behave of shiyan7 is

signal data:integer range 0 to 10000;

signal i:integer range 0 to 5000;

signal Q:std_logic;

begin

process(clkin)

begin

if rising_edge(clkin)then

if(data=10000)then

data<=0;

Q<=NOT Q;

else

if(i=2000)then

i<=0;

data<=data+1;

else i<=i+1;

end if;

end if;

end if;

clkout<=Q;

end process;

end behave;

【引脚配置】

实验任务二:十进制计数器设计

【实验代码】

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_arith.all;

use ieee.std_logic_unsigned.all;

entity ex9 is

port(

reset:in std_logic;

clk:in bit;

dout2:out bit;

dout1:out std_logic_vector(6 downto 0));

end ex9;

architecture behave of ex9 is

signal count7:integer range 0 to 6;

signal clk1:bit;

begin

process(clk)

variable c:integer range 0 to 50000000;

begin

if(clk'event and clk='1') then

c:=c+1;

if(c<25000000)then clk1<='1';

else clk1<='0';

end if;

end if;

end process;

process(clk1,reset)

begin

if reset='1' then count7<=0;

elsif clk1'event and clk1='1' then

if count7<6 then

count7<=count7+1;

else count7<=0;

end if;

end if;

dout2<=clk1;

end process;

process(count7)

begin

case count7 is

when 0=>dout1<="1000000";

when 1=>dout1<="1100000";

when 2=>dout1<="1110000";

when 3=>dout1<="1110000";

when 4=>dout1<="1110000";

when 5=>dout1<="1110010";

when 6=>dout1<="1110010";

when others=>null;

end case;

end process;

end behave;

【仿真波形】

【引脚配置】

实验任务三:巴克码发生器和检测器

【实验代码】

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

use ieee.std_logic_arith.all;

entity barkker_2 is

port(clk:in std_logic;

bark:out std_logic_vector(6 downto 0);

tap_out:out std_logic);

end entity;

architecture behave of barkker_2 is

component barkker

port(clk_in:in std_logic;\out\:out std_logic_vector(3 downto 0);tap:out std_logic);

end component;

component led_7

port( b: in std_logic_vector(3 downto 0);led: out std_logic_vector(6 downto 0));

end component;

signal i:std_logic_vector(3 downto 0);

begin

u1:barkker port map (clk,i,tap_out);

u2:led_7 port map(i,bark);

end behave;

【仿真波形】

【引脚配置】

标签:

相关文章

语言一等公民,文化自信与全球影响力

语言作为人类文明的重要载体,是沟通思想、交流情感、传承文化的重要工具。在全球化的今天,我国语言——汉语,正以独特的魅力,逐渐成为世...

科学 2025-01-01 阅读0 评论0

语言之韵,从口头到文字的演变之路

语言是人类交流的桥梁,是文明进步的载体。从古至今,语言在不断发展变化,从口头语言到文字语言的演变,见证了人类智慧的升华。本文将从语...

科学 2025-01-01 阅读0 评论0