kmfc. 2023-04-11 11:20 采纳率: 66.7%
浏览 36
已结题

EDA技术全减器的VHDL描述

1.设计半减器,用例化语句将他们连接起来,图以上传。
2.设计全减器,以全减器为基本硬件,构成串行借位的8位减法器,用例化语句来完成设计

img

  • 写回答

2条回答 默认 最新

  • 「已注销」 2023-04-11 22:51
    关注

    以下内容部分参考ChatGPT模型:


    半减器的VHDL描述:

    library ieee;
    use ieee.std_logic_1164.all;
    
    entity half_subtractor is
        port (
            A : in std_logic;
            B : in std_logic;
            Diff : out std_logic;
            Borrow : out std_logic
        );
    end half_subtractor;
    
    architecture behavior of half_subtractor is
    begin
        Diff <= A xor B;
        Borrow <= not A and B;
    end behavior;
    

    全减器的VHDL描述:

    library ieee;
    use ieee.std_logic_1164.all;
    
    entity full_subtractor is
        port (
            A : in std_logic;
            B : in std_logic;
            Bin : in std_logic;
            Diff : out std_logic;
            Bout : out std_logic
        );
    end full_subtractor;
    
    architecture behavior of full_subtractor is
    begin
        process (A, B, Bin)
        begin
            Diff <= A xor B xor Bin;
            Bout <= (not A and B and Bin) or (A and not B and Bin) or (A and B and not Bin) or (not A and not B and Bin);
        end process;
    end behavior;
    

    串行借位的8位减法器的VHDL描述:

    library ieee;
    use ieee.std_logic_1164.all;
    
    entity subtractor is
        port (
            A : in std_logic_vector(7 downto 0);
            B : in std_logic_vector(7 downto 0);
            Cin : in std_logic;
            Difference : out std_logic_vector(7 downto 0);
            Cout : out std_logic
        );
    end subtractor;
    
    architecture behavior of subtractor is
        component full_subtractor is
            port (
                A : in std_logic;
                B : in std_logic;
                Bin : in std_logic;
                Diff : out std_logic;
                Bout : out std_logic
            );
        end component;
        
        signal D : std_logic_vector(7 downto 0);
        signal Bc : std_logic_vector(7 downto 0);
    begin
        D(0) <= A(0) xor B(0) xor Cin;
        Bc(0) <= (not A(0) and B(0) and Cin) or (A(0) and not B(0) and Cin) or (A(0) and B(0) and not Cin) or (not A(0) and not B(0) and Cin);
        
        subtractor_loop : for i in 1 to 7 generate
            Fs : full_subtractor port map (A(i), B(i), Bc(i-1), D(i), Bc(i));
        end generate;
        
        Difference <= D;
        Cout <= Bc(7);
    end behavior;
    

    如果我的建议对您有帮助、请点击采纳、祝您生活愉快

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 4月21日
  • 已采纳回答 4月13日
  • 创建了问题 4月11日

悬赏问题

  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持