4位除法器vhdl程序

来源:本站
导读:目前正在解读《4位除法器vhdl程序》的相关信息,《4位除法器vhdl程序》是由用户自行发布的知识型内容!下面请观看由(电工技术网 - www.9ddd.net)用户发布《4位除法器vhdl程序》的详细说明。
简介:VHDL全名Very-High-Speed Integrated Circuit Hardware Description Language,诞生于1982年。1987年底,VHDL被IEEE和美国国防部确认为标准硬件描述语言 。 VHDL和Verilog作为IEEE的工业标准硬件描述语言,得到众多EDA公司支持,在电子工程领域,已成为事实上的通用硬件描述语言。

4位除法器,vhdl

--

--

--------------------------------------------------------------------------------/

-- DESCRIPTION : Signed pider

-- A (A) input width : 4

-- B (B) input width : 4

-- Q (data_out) output width : 4

-- DIV_BY_0 (DIVz) output active : high

-- Download from : http://www.pld.com.cn

--------------------------------------------------------------------------------/

library IEEE;

use IEEE.std_logic_1164.all;

use IEEE.std_logic_unsigned.all;

entity fpp is

port (

DIVz: out STD_LOGIC;

A: in STD_LOGIC_VECTOR (3 downto 0);

B: in STD_LOGIC_VECTOR (3 downto 0);

data_out: out STD_LOGIC_VECTOR (3 downto 0)

);

end fpp;

architecture fpp_arch of fpp is

signal REMAINDERS0 : STD_LOGIC_VECTOR (5 downto 0);

signal REMAINDERS1 : STD_LOGIC_VECTOR (5 downto 0);

signal REMAINDERS2 : STD_LOGIC_VECTOR (5 downto 0);

signal REMAINDERS3 : STD_LOGIC_VECTOR (5 downto 0);

signal DIVISORS0 : STD_LOGIC_VECTOR (5 downto 0);

signal DIVISORS1 : STD_LOGIC_VECTOR (5 downto 0);

signal DIVISORS2 : STD_LOGIC_VECTOR (5 downto 0);

signal DIVISORS3 : STD_LOGIC_VECTOR (5 downto 0);

signal Q_TEMP : STD_LOGIC_VECTOR (3 downto 0);

signal Z0 : STD_LOGIC_VECTOR (2 downto 0);

signal Z1 : STD_LOGIC_VECTOR (2 downto 0);

signal ZERO : STD_LOGIC;

begin

Z0 <= (others => '0');

Z1 <= (others => '0');

DIVISORS0 <= Z0 & B(2 downto 0);

REMAINDERS3 <= Z1 & A(2 downto 0);

DIVISORS1 <= DIVISORS0(4 downto 0) & '0';

DIVISORS2 <= DIVISORS1(4 downto 0) & '0';

DIVISORS3 <= DIVISORS2(4 downto 0) & '0';

Q_TEMP(0) <= '1' when (REMAINDERS1 >= DIVISORS0) else '0';

Q_TEMP(1) <= '1' when (REMAINDERS2 >= DIVISORS1) else '0';

Q_TEMP(2) <= '1' when (REMAINDERS3 >= DIVISORS2) else '0';

Q_TEMP(3) <= A(3) xor B(3);

REMAINDERS2 <= REMAINDERS3 - DIVISORS2 when Q_TEMP(2) = '1' else REMAINDERS3;

REMAINDERS1 <= REMAINDERS2 - DIVISORS1 when Q_TEMP(1) = '1' else REMAINDERS2;

REMAINDERS0 <= REMAINDERS1 - DIVISORS0 when Q_TEMP(0) = '1' else REMAINDERS1;

ZERO <= '1' when B(2 downto 0) = Z1 else '0';

DIVz <= '1' when ZERO = '1' else '0';

data_out <= (others => '0') when ZERO = '1' else Q_TEMP;

end fpp_arch;

提醒:《4位除法器vhdl程序》最后刷新时间 2024-03-14 01:16:11,本站为公益型个人网站,仅供个人学习和记录信息,不进行任何商业性质的盈利。如果内容、图片资源失效或内容涉及侵权,请反馈至,我们会及时处理。本站只保证内容的可读性,无法保证真实性,《4位除法器vhdl程序》该内容的真实性请自行鉴别。