




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、. 专用集成电路实验报告13050z011305024237精品.刘德文精品.实验一 开发平台软件安装与认知实验实验内容1、 本实验以三线八线译码器(ls74138)为例,在xilinx ise 9.2软件平台上完成设计电路的vhdl文本输入、语法检查、编译、仿真、管脚分配和编程下载等操作。下载芯片选择xilinx公司的coolrunner ii系列xc2c256-7pq208作为目标仿真芯片。2、 用1中所设计的的三线八线译码器(ls74138)生成一个ls74138元件,在xilinx ise 9.2软件原理图设计平台上完成ls74138元件的调用,用原理图的方法设计三线八线译码器(ls7
2、4138),实现编译,仿真,管脚分配和编程下载等操作。源程序: library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;- uncomment the following lines to use the declarations that are- provided for instantiating xilinx primitive components.-library unisim;-use unisim.vcomponents.all;e
3、ntity ls74138 is精品. port ( g1 : in std_logic; g2 : in std_logic; inp : in std_logic_vector(2 downto 0); y : out std_logic_vector(7 downto 0);end ls74138;architecture behavioral of ls74138 isbeginprocess(g1,g2,inp)begin if(g1 and g2)=1) then case inp is when 000=yyyyyyyyy=00000000; end case; else y=0
4、0000000; end if;精品.end process;end behavioral;波形文件: 生成元器件及连接电路思考:有程序可以看出,定义了三个输入端,一个输出端。g1,g2为使能输入端,当全为一时,开始执行宽度为三的输入inp,并听过程序实现三八译码器的功能。通过实验,分别用了原理图和vhdl语言两种方式进行调试。两种方法各有优缺点。对于原理图而言,可以清晰直观的看出电路各部分的构造,但却只能在原有的基础上进行链接而无法随意修改元器件功能;vhdl语言则可以按照实际的需求进行编写程序,从而可以实现开发者想要实现的功能。精品.实验二 组合逻辑电路的vhdl语言实现实验内容:1.用v
5、hdl语言实现优先编码器的设计并实现功能仿真2.用vhdl语言实现四选一选择器的设计并实现功能仿真。1.优先编码器源程序library ieee;use ieee.std_logic_1164.all;entity priorityencoder is port (input:in std_logic_vector (7 downto 0); y:out std_logic_vector (2 downto 0);end priorityencoder;architecture rtl of priorityencoder isbegin process (input) begin if(in
6、put(0)=0) then y=111; elsif(input(1)=0) then y=110; elsif(input(2)=0) then精品. y=101; elsif(input(3)=0) then y=100; elsif(input(4)=0) then y=011; elsif(input(5)=0) then y=010; elsif(input(6)=0) then y=001; else y=000; end if; end process;end rtl;波形图原理图:精品.2. 四选一选择器源程序:library ieee;use ieee.std_logic_
7、1164.all;entity mux4 is port (input:in std_logic_vector (3 downto 0); a,b:in std_logic; y:out std_logic);end mux4;architecture rt1 of mux4 issignal se1:std_logic_vector (1 downto 0);begin se1=b&a; process (input,se1) begin if(se1=00)then y=input(0); elsif(se1=01)then y=input(1);精品. elsif(se1=10)then
8、 y=input(2); else y=input(3); end if; end process;end rt1;波形图原理图思考:1. 优先编码器:通过程序定义了一个八位的输入端和一个三位的输入端。首先是通过八位的 输入端的最低位开始判断,如果是0,则输出为:111;如果是1,则判断第 二位,以此类推,直到最后一位,如果都不满足,则输出:000。2.四选一选择器:一共有三个输入,其中一个是宽度为四的可供选择的输入端,将一个四位宽度的二进制码赋值给input端,通过a与b的输入选择input的输出。如ab为00时,则输出为:input(0),以此类推。精品.实验三 时序逻辑电路的vhdl语言
9、实验实验内容:(3选1)(1) 、设计一个60进制的计数器(2) 设计一带使能的同步复位清零的递增8位二进制计数器(3) 设计一带使能的异步清零复位的递增8位二进制计数器六十进制(异步清零)源程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity ycounter is port(clk,clear,enable:in std_logic; -ld:in std_logic; -d:in std_logic_vector(7 downto 0); qk:out std_logic_ve
10、ctor(7 downto 0);end ycounter;architecture a_ycounter of ycounter isbegin process (clk) variable cnt :std_logic_vector(7 downto 0); begin精品. if (clkevent and clk = 1) then if(clear = 0) then cnt := 00000000; -else -if(ld = 0) then - cnt := d; else if(enable = 1) then cnt := cnt + 00000001; if(cnt=00
11、111100)then cnt := 00000000; end if; end if; -end if; end if; end if; qk = cnt; end process;end a_ycounter;波形图:精品.六十进制(同步置数)源程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity ycounter is port(clk,clear,enable:in std_logic; ld:in std_logic; d:in std_logic_vector(7 dow
12、nto 0); qk:out std_logic_vector(7 downto 0);end ycounter;architecture a_ycounter of ycounter isbegin process (clk) variable cnt :std_logic_vector(7 downto 0); begin if (clkevent and clk = 1) then if(clear = 0) then cnt := 00000000;精品. else if(ld = 0) then cnt := d; else if(enable = 1) then cnt := cn
13、t + 00000001; if(cnt=00111011)then ld :=1; end if; end if; end if; end if; end if; qk = cnt; end process;end a_ycounter;波形图:精品.思考:六十进制计数器的实现,1)异步清零程序的实现:通过判断最后一个状态,因为该计数器位六十进制,所以最后一个状态为59,用二进制码表示为:00111011,即当计数器的状态为六十,即00111100状态时,计数器清零,输出00000000。2)同步置数程序的实现:当计数器达到状态,当计数器达到状态00111011时,ld被赋值为0,执行置数功
14、能,将d的值赋值给y,计数器从零开始计数。实验四 vhdl层次化设计方法实验实验内容: 设计一个8位移位寄存器。各个d触发器模块采用vhdl语言编写,分别用原理图、vhdl语言元件例化语句和生成语句的方法实现8位移位寄存器的设计。d触发器源程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;- uncomment the following lines to use the declarations that are- provided
15、for instantiating xilinx primitive components.-library unisim;精品.-use unisim.vcomponents.all;entity dchu is port ( clk : in std_logic; d : in std_logic; q : out std_logic; clear : in std_logic; q_n : out std_logic);end dchu;architecture beh of dchu issignal q1:std_logic;beginprocess (clear,clk,q1) b
16、egin if clear=0 then q1=0; elsif clkevent and clk=1then q1=d; end if;end process;q=q1;q_n=not q1; end beh;精品.波形图:d触发器:八位移位寄存器:八位移位寄存器原理图: 元件例化:library ieee;精品.use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;- uncomment the following lines to use the declarati
17、ons that are- provided for instantiating xilinx primitive components.-library unisim;-use unisim.vcomponents.all;entity shift_reg_8_com is port ( a,clk,rst : in std_logic; b: out std_logic);end shift_reg_8_com;architecture beh of shift_reg_8_com iscomponent dff1port ( d,clk,rst : in std_logic; q: ou
18、t std_logic);end component;signal q:std_logic_vector(8downto0);beginq(0)=a;d0:dff1 port map(q(0),clk,rst,q(1);d1:dff1 port map(q(1),clk,rst,q(2);d2:dff1 port map(q(2),clk,rst,q(3);精品.d3:dff1 port map(q(3),clk,rst,q(4);d4:dff1 port map(q(4),clk,rst,q(5);d5:dff1 port map(q(5),clk,rst,q(6);d6:dff1 port
19、 map(q(6),clk,rst,q(7);d7:dff1 port map(q(7),clk,rst,q(8);b=q(4);end str;生成语句:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;- uncomment the following lines to use the declarations that are- provided for instantiating xilinx primitive components.-library unisim;-use u
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年医用高频仪器设备项目发展计划
- 小学1-6年级奥数题及答案每日一练
- 2025年血橙提取物化妆品项目发展计划
- 2025年多功能抑尘车项目合作计划书
- 父亲的拥抱阅读答案 父亲让我抱抱你 答案
- 消防设施检测合同范本(2024版)
- 2025年绝缘材料:绝缘套管合作协议书
- 2025年全数字摄影测量系统合作协议书
- 教育法规执行中的挑战与对策
- 2025年PU系列水乳型聚氨酯皮革涂饰剂项目建议书
- 2024-2030年中国休闲素食行业市场深度分析及发展潜力预测报告
- 朝花夕拾考试题及答案
- 高中坚持议论文范文7篇
- 浙江省湖州市2024-2025学年高一下学期期末考试数学试卷
- 2025年村干部公务员试题及答案
- 煤矿采矿制图培训课件
- 羊水栓塞个案护理
- 2024年萍乡市县区事业单位引进人才笔试真题
- 2025-2030中国透明无色聚酰亚胺薄膜行业发展动态及应用趋势预测报告
- 2025中国白酒酒业市场中期研究报告
- 紧急疏散培训课件
评论
0/150
提交评论