📄 complementor.vhd
字号:
--------------------------------------------------------------------------------------------------------------------
--实验题号 : Ex2-3
--项目名称 : 补码器
--文件名 : Complementor.vhd
--作者 : 田甲
--班号. : 计45
--创建日期 : 2006-03-23
--目标芯片 : EP1C6Q240C8
--电路模式 : 模式1
--功能描述 : 本文件给出了补码器的结构描述,调用了4bit加法器,涉及port map等语法现象。
--------------------------------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity Complementor is
port(num: in std_logic_vector(3 downto 0);
numout: out std_logic_vector(3 downto 0));
end entity;
architecture Impl of Complementor is
component FourBitAdder
port(a, b: in std_logic_vector(3 downto 0);
s: out std_logic_vector(3 downto 0);
carry: out std_logic );
end component;
signal Inverse, one:std_logic_vector(3 downto 0);
begin
one(0)<='1';
one(1)<='0';
one(2)<='0';
one(3)<='0';
Inverse(0)<=not num(0);Inverse(1)<=not num(1);Inverse(2)<=not num(2);Inverse(3)<=not num(3);
u: FourBitAdder port map
(a=>Inverse, b=>one, s=>numout);
end architecture Impl;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -