成都信息工程学院数电复习.pptx
文本预览下载声明
数字电路与逻辑设计; 第二章;[题2-3] 将下列二进制数转换成八进制数和十六进制数;[题2-5] 将下列二进制数转换成八进制数和十进制数。;[题2-6] 将下列十进制数转换成8421BCD码、5421 BCD码和余三BCD码;表 四位二进制数与四位格雷码的对照关系;;;;;[题3-2]用真值表验证下列表达式;;[题3-5] 根据反演规则求出下列逻辑函数的反函数。 ;;[题3-3] 用逻辑代数的基本公式和定律将下列逻辑函数式化简为
最简与-或表达式。 ;(3);(10);;;;;;;;;重点:
数据选择器、译码器、移位寄存器、计数器和
触发器的书中源代码。
;1. 用VHDL语言描述3-8线译码器
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity decoder38 is
port(inp:in std_logic_vector(2 downto 0);
outp:out std_logic_vector(7 downto 0));
end entity decoder38;
architecture art4 of decoder38 is
begin
process(inp)
;begin
case inp is
when 000=outp=
when 001=outp=
when 010=outp=
when 011=outp=
when 100=outp=
when 101=outp=
when 110=outp=
when 111=outp=
when others=outp= xxxxxxxx;
end case;
end process;
end architecture art4;;2. 用VHDL语言描述7段显示译码器; when 0000 =led7 =0111111; --0
when 0001 =led7 =0000110; --1
when 0010 =led7 =1011011; --2
when 0011 =led7 =1001111; --3
when 0100 =led7 =1100110; --4
when 0101 =led7 =1101101; --5
when 0110 =led7 =1111101; --6“
when 0111 =led7 =0000111; --7
when 1000 =led7 =1111111; --8
when 1001 =led7 =1101111; --9
when others =led7 =0000000; --不显示
end case;
end process;
end behv;;3. 用VHDL语言描述4选1数据选择器
library ieee;
use ieee.std_logic_1164.all;
entity mux41 is
port (inp: in std_logic_vector(3 downto 0);
a,b:in std_logic;
y:out std_logic);
end entity mux41;
architecture art of mux41 is
signal sel:std_logic_vector(1 downto 0);
Begin
; sel=ba;
process(inp,sel) is
begin
if (sel=00) then y=inp(0);
elsif (sel=01) then y=inp(1);
elsif (sel=11) then y=inp(2);
else y=inp(3);
end if;
end process;
end architecture art;
;4. 边沿D触发器的HDL描述;Q=1
显示全部