《数字系统设计》总复习题

内容发布更新时间 : 2024/5/19 10:31:11星期一 下面是文章的全部内容请认真阅读。

architecture code4 of code4 is

signal ddd:std_logic_vector(3 downto 0);

signal q:std_logic_vector( downto 0); begin

ddd<= ; process(ddd) begin

if (ddd(0)='0') then q <= \elsif (ddd(1)='0') then q <= \elsif(ddd(2)='0') then q<=\else q <= \end if;

;

y1<=q(0); y0<=q(1); end code4;

(十一) 在下面横线上填上合适的语句,完成10位二进制加法器电路的设计。 library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_ .all; entity adder1 is

port(a,b:in std_logic_vector(9 downto 0); cout:out std_logic;

sum:out std_logic_vector(9 downto 0)); end;

architecture jg of adder1 is

signal atemp: std_logic_vector(10 downto 0); signal btemp: std_logic_vector(10 downto 0);

signal sumtemp: std_logic_vector( downto 0); begin

atemp<=’0’& a; btemp<=’0’& b; sumtemp<= ; sum<=sumtemp(9 downto 0); cout<= ; end jg;

(十二) 在下面横线上填上合适的语句,完成移位寄存器的设计。

说明:8位的移位寄存器,具有左移一位或右移一位、并行输入和同步复位的功能。 library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all;

entity shifter is

port(data :in std_logic_vector(7 downto 0); clk:in std_logic;

shiftleft,shiftright:in std_logic; reset:in std_logic;

mode:in std_logic_vector(1 downto 0);

qout:buffer std_logic_vector(7 downto 0)); end shifter;

architecture art of shifter is begin

process begin

(rising_edge(clk)); --等待上升沿 if reset='1' then qout<=\同步复位 else

case mode is

when \右移一位 when \左移一位

when \不移,并行输入 when others=>null; ; end if;

end process; end art;

(十三) 在下面横线上填上合适的语句,完成计数器的设计。

说明:设计一个带有异步复位和时钟使能的一位八进制加法计数器(带进位输出端)。 library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity cnt8 is

port (clk,rst,en : in std_logic;

cq : out std_logic_vector( downto 0); cout : out std_logic ); end cnt8;

architecture behav of cnt8 is begin

process(clk, rst, en)

cqi : std_logic_vector(2 downto 0); begin

if rst = '1' then cqi := “000”; clk'event and clk='1' then if en = '1' then

if cqi < \

else cqi := ; end if;

end if; end if;

if cqi = \ else cout <= '0';

end if;

cq <= cqi; end process; end behav;

(十四) 在下面横线上填上合适的语句,完成序列信号发生器的设计。

说明:已知发送信号为”10011010”,要求以由高到低的序列形式一位一位的发送,发送开始前及发送完为低电平。 library ieee;

use ieee.std_logic_1164.all; entity xulie is

port (res, clk: in std_logic; y: out std_logic ); end;

architecture arch of xulie is

signal reg:std_logic_vector(7 downto 0); begin

process(clk, res) begin

if(clk’event and clk=’1’) then if res=’1’ then

y<=’0’; reg<= ; --同步复位,并加载输入 else y<= ; --高位输出 reg<= ; --左移,低位补0 end if; end if;

end process; end;

(十五) 在下面横线上填上合适的语句,完成数据选择器的设计。

说明:采用元件例化的设计方法,先设计一个2选1多路选择器,再使用3个2选1多路选择器构成一个4选1多路选择器。

library ieee; --2选1多路选择器的描述 use ieee.std_logic_1164.all; entity mux21 is

port(a,b,sel : in std_logic; y : out std_logic); end mux21;

architecture art of mux21 is begin

y<=a when sel='0' else b; end ;

library ieee; --4选1多路选择器的描述 use ieee.std_logic_1164.all; entity mux41 is

port(a,b,c,d : in std_logic; s1,s2 : in std_logic;

y:out std_logic) ; end;

architecture art of mux41 is component mux41

port(a,b,sel : in std_logic; y : out std_logic); end component;

y1,y2:std_logic; begin

u1: mux21 port map(a,b,s1, ); u2: mux21 port map(c,d, ,y2); u2: mux21 port map(y1,y2, ,y); end ;

(十六) 在下面横线上填上合适的语句,完成8位奇偶校验电路的设计。 library ieee;

use ieee.std_logic_1164.all; entity pc is

port ( a : in std_logic_vector(7 downto 0); y : out std_logic ); end pc;

architecture a of pc is begin process(a).

variable tmp: std_logic; begin

tmp '0';

for i in 0 to 7 loop tmp:= ;

end loop; y<= ; end process; end;

(十七)在下面横线上填上合适的语句,完成一个逻辑电路的设计, 其布尔方程为y=(a+b)(c⊙d)+(b⊕f).

LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY comb IS

PORT(a, b,c,d,e,f,: IN std_logic; y: OUT std_logic); END comb;

ARCHITECTURE one OF comb IS BEGIN

y<=(a OR b) AND (c d) OR (b f); END ARCHITECTURE one;

(十八)在下面横线上填上合适的语句,完成一个带使能功能的二-十进制译码器的设计。 LIBRARY ieee;

USE ieee.std_logic_1164.ALL; ENTITY my2to10 IS

PORT (en: IN std_logic;

din: IN std_logic_vector( DOWNTO 0); pout: OUT std_logic_vector(9 DOWNTO 0) ); END;

ARCHITECTURE arch OF my2to10 IS BEGIN

PROCESS(en, din) BEGIN

IF en=’1’ THEN CASE din IS

WHEN \WHEN \WHEN \WHEN \WHEN \WHEN \WHEN \WHEN \WHEN \WHEN \WHEN OTHERS => pout<=\END CASE; END IF;

END PROCESS; END;

(十九)在下面横线上填上合适的语句,完成下降沿触发的d触发器的设计。

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4 ceshi