多用电路的设计与开发实验(国开实验2组合逻辑电路的设计)

实验2 组合逻辑电路的设计一、试验目的,接下来我们就来聊聊关于多用电路的设计与开发实验?以下内容大家不妨参考一二希望能帮到您!

多用电路的设计与开发实验(国开实验2组合逻辑电路的设计)

多用电路的设计与开发实验

实验2 组合逻辑电路的设计

一、试验目的

1、掌握组合逻辑电路的设计方法。

2、掌握组合逻辑电路的静态测试方法。

3、熟悉CPLD设计的过程,比较原理图输入和文本输入的优劣。

二、实验的硬件要求

1、输入:按键开关(常高)4个;拨码开关4位。

2、输出:LED灯。

3、主芯片:Altera EPM7128SLC84-15。

三、实验内容

1、设计一个四舍五入判别电路,其输入为8421BCD码,要求当输入大于或等于5时,判别电路输出为1,反之为0。

2、设计四个开关控制一盏灯的逻辑电路,要求改变任意开关的状态能够引起灯亮灭状态的改变。(即任一开关的合断改变原来灯亮灭的状态)

3、设计一个优先排队电路,其框图如下:

排队顺序:

A=1 最高优先级

B=1 次高优先级

C=1 最低优先级

要求输出端最多只能有一端为“1”,即只能是优先级较高的输入端所对应的输出端为“1”。

四、实验连线

1、四位拨码开关连D3、D2、D1、D0信号对应的管脚。

OUT输出信号管脚接LED灯。

2、四位按键开关分别连K1、K2、K3、K4信号对应的管脚。

OUT输出信号管脚接LED灯。

3、A、B、C信号对应管脚分别连三个按键开关。输出A_Out、B_Out、C_Out信号对应的管脚分别连三个LED灯。

(具体管脚参数由底层管脚编辑决定)

五、参考原理图

1、①原理图,如图2-1所示:

②VHDL硬件描述语言输入:

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_signed.all;

entity bcd_pjq is

port(din:in integer range 15 downto 0;

dout:out std_logic);

end;

architecture a of bcd_pjq is

begin

p1:process

begin

if din<5 then

dout<='0';

else

dout<='1';

end if;

end process p1;

end;

2、①原理图,如图2-2所示:

②VHDL硬件描述语言输入:

library ieee;

use ieee.std_logic_1164.all;

entity led_control is

port(k0,k1,k2,k3:in std_logic;

y:out std_logic);

end ;

architecture one of led_control is

signal dz:std_logic_vector(3 downto 0);

begin

dz<=k3&k2&k1&k0;

p1:process(dz)

begin

case dz is

when "0000"=>y<='0';

when "0001"=>y<='1';

when "0011"=>y<='0';

when "0010"=>y<='1';

when "0110"=>y<='0';

when "0111"=>y<='1';

when "0101"=>y<='0';

when "0100"=>y<='1';

when "1100"=>y<='0';

when "1101"=>y<='1';

when "1111"=>y<='0';

when "1110"=>y<='1';

when "1010"=>y<='0';

when "1011"=>y<='1';

when "1001"=>y<='0';

when "1000"=>y<='1';

when others=>y<='X';

end case;

end process p1;

end one;

3、①原理图,如图2-3所示:

②VHDL硬件描述语言输入:

library ieee;

use ieee.std_logic_1164.all;

entity queue_prior is

port(a,b,c:in std_logic;

aout,bout,cout:out std_logic);

end ;

architecture one of queue_prior is

begin

p1:process

begin

if a='1' then

aout<='1';

bout<='0';

cout<='0';

elsif b='1' then

aout<='0';

bout<='1';

cout<='0';

elsif c='1' then

aout<='0';

bout<='0';

cout<='1';

else

aout<='0';

bout<='0';

cout<='0';

end if;

end process p1;

end one;

六、实验报告要求

1、对于原理图设计要求有设计过程。

2、详细论述实验步骤。

3、写一些对比两种硬件设计输入法的优劣的心得。

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页