77范文网 - 专业文章范例文档资料分享平台

数字逻辑第四章课后答案(4)

来源:网络收集 时间:2018-12-27 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

盛建伦:《数字逻辑与VHDL逻辑设计》习题解答

1 1 0 0

1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 0 0 1 1 0 0 0

1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1

根据系统框图写VHDL程序的Entity,用行为描述的方法,根据真值表写VHDL程序的Architecture。

VHDL程序如下: --Gray code to Binary code library ieee;

use ieee.std_logic_1164.all; entity gray2binary is

port( grayin : in std_logic_vector(3 downto 0); binaryout : out std_logic_vector(3 downto 0)); end gray2binary;

architecture behave of gray2binary is begin

with grayin select

binaryout <= \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ end behave;

4 - 16

盛建伦:《数字逻辑与VHDL逻辑设计》习题解答

4-22

用VHDL设计一个代码转换逻辑电路。把4位二进制代码转换成7段字符显示代码。能显示数字0~9和字母A,b,C,d,E,F。

解:电路的输入是4位代码,输出是7位代码。用D3~D0作为输入信号名,用Ya~Yg作为输出信号名,分别对应a、b、c、d、e、f、g这7个段。

系统框图 ……

列出代码转换逻辑的真值表。

表4.12 代码转换逻辑电路的真值表

D3 D2 D1 D0 Ya Yb Yc Yd Ye Yf Yg 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1

根据系统框图设计VHDL程序的entity,用行为描述的方法,根据真值表设

4 - 17

Ya Yb Yc Yd Ye Yf Yg 代码转换电路 D3 D2 D1 D0 … 显示字符 0 1 2 3 4 5 6 7 8 9 A b C d E F 字形 1 1 1 1 1 1 0 0 1 1 0 0 0 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 0 1 1 0 0 1 1 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 0 0 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 盛建伦:《数字逻辑与VHDL逻辑设计》习题解答

计VHDL程序的architecture。

library ieee;

use ieee.std_logic_1164.all; entity bcd2seg7 is

port( bcdin : in std_logic_vector(3 downto 0); segout : out std_logic_vector(6 downto 0)); end bcd2seg7;

architecture behav of bcd2seg7 is begin

with bcdin select

segout <= \ --display\ \ \ \

\ \ \

\ --display\ \

\ --display\ \ --display\ \ --display\ \ --display\ \ --display\ \ --display\ \ --display\ \end behave;

4-22 (有没有简单方法呢?)

用VHDL设计一个代码转换逻辑电路。把7位的ASCII码转换成7段字符显示代码。能显示数字0~9,字母A,b,C,d,E,F,H,L,o,P,U,等。

解:

ASCII码 7段字符显示代码 Yg 字形 0 字符 A6 A5 A4 A3 A2 A1 A0 Ya Yb Yc Yd Ye Yf 0 0 1 1 0 0 0 0 1 1 1 1 1 1 4 - 18

盛建伦:《数字逻辑与VHDL逻辑设计》习题解答

1 2 3 4 5 6 7 8 9 A b C d E F H L o P U

0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 0 4-23 用VHDL设计一个16位全加器。 解:

4-24

用VHDL设计一个8位数值比较器。 解:

4-25 用VHDL设计一个四位超前进位加法器。 解:

4 - 19

盛建伦:《数字逻辑与VHDL逻辑设计》习题解答

-- 4-Bit carry-look-ahead Full Adder library ieee;

use ieee.std_logic_1164.all; entity FULL_ADDER1 is

port ( A, B : in bit_vector(3 downto 0); Cin : in bit;

S : out bit_vector(3 downto 0); Cout : out BIT); end FULL_ADDER1; --

architecture FULL_ADDERp of FULL_ADDER1 is signal sA,sB,sS : bit_vector(3 downto 0); signal sCin , sCout : bit ; signal sC : bit_vector(3 downto 0) ; signal sT : bit_vector(3 downto 0) ; signal sG : bit_vector(3 downto 0) ; begin sA <= A ; sB <= B ; sCin <= Cin ;

sT(0) <= sA(0) xor sB(0) ; --P0 sG(0) <= sA(0) and sB(0) ; --G0 sT(1) <= sA(1) xor sB(1) ; --P1 sG(1) <= sA(1) and sB(1) ; --G1 sT(2) <= sA(2) xor sB(2) ; --P2 sG(2) <= sA(2) and sB(2) ; --G2 sT(3) <= sA(3) xor sB(3) ; --P3

sG(3) <= sA(3) and sB(3) ; --G3 --

sC(0)<=sG(0) or (sT(0) And sCin) ; --C0

sC(1)<=sG(1) or (sT(1) and (sG(0) or (sT(0) and sCin))); --C1

sC(2)<=sG(2) or (sT(2) and (sG(1) or (sT(1) and (sG(0) or (sT(0) and sCin))))); --C2 sC(3)<=sG(3) or (sT(3) and (sG(2) or (sT(2) and (sG(1) or (sT(1) and (sG(0) or (sT(0) and sCin))))))); --C3

--

sS(0) <= sT(0) xor sCin ; --S0 sS(1) <= sT(1) xor sC(0) ; --S1 sS(2) <= sT(2) xor sC(1) ; --S2

4 - 20

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库数字逻辑第四章课后答案(4)在线全文阅读。

数字逻辑第四章课后答案(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/395044.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: