VHDL:按钮去抖动(或不去抖动,视情况而定)

2023-12-10

我已阅读其他帖子,但似乎无法修复我的。我是 VHDL 新手,所以我确信这是一个简单的修复。

简而言之,按钮没有防抖。代码编译和比特流程序。在测试台中,按下按钮可以工作,但输出 LED 不会改变。在板上,按下按钮会使随机 LED 亮起(我猜是因为弹跳)。根据原理图,输入将通过去抖器。

任何人都可以找出问题所在吗?任何其他提示和技巧总是值得赞赏:)

Thanks!

编辑1:添加上升沿(clk)。 另请注意,当我按下任一按钮时,按下按钮时所有 LED 都会亮起。

Schematic

按钮计数器.vhd

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity button_counter is
    port( clk : in std_logic;
         btnU : in std_logic;
         btnD : in std_logic;
          led : out std_logic_vector (15 downto 0));
end button_counter;

architecture behavioral of button_counter is

    component debouncer is
        port(    clk : in std_logic;
                 btn : in std_logic;
             btn_clr : out std_logic);
    end component;

    signal btnU_clr : std_logic;
    signal btnD_clr : std_logic;

    begin

    debouncer_btnU : debouncer port map (clk => clk, btn => btnU, btn_clr => btnU_clr);
    debouncer_btnD : debouncer port map (clk => clk, btn => btnD, btn_clr => btnD_clr);

    process(clk)
        variable count : integer := 0;
        begin
        if (rising_edge(clk)) then
            if(btnU_clr = '1') then count := count + 1;
            elsif(btnD_clr = '1') then count := count - 1;
            end if;
            led <= std_logic_vector(to_unsigned(count, led'length));
        end if;
    end process;

end behavioral;

反跳器.vhd

library IEEE;
    use IEEE.std_logic_1164.all;
    use IEEE.numeric_std.all;

entity debouncer is
    port(    clk : in std_logic;
             btn : in std_logic;
         btn_clr : out std_logic);
end debouncer;

architecture behavioural of debouncer is

    constant delay : integer := 650000; -- 6.5ms
    signal count : integer := 0;
    signal btn_tmp : std_logic := '0';

    begin

    process(clk)
    begin
        if rising_edge(clk) then
            if (btn /= btn_tmp) then
                btn_tmp <= btn;
                count <= 0;
            elsif (count = delay) then
                btn_clr <= btn_tmp;
            else
                count <= count + 1;
            end if;
        end if;
    end process;

end behavioural;

按钮_计数器_tb.vhd

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity button_counter_tb is
end button_counter_tb;

architecture behavioral of button_counter_tb is

signal clk_tb    : std_logic;
signal btnU_tb   : std_logic;
signal btnD_tb   : std_logic;
signal led_tb    : std_logic_vector (15 downto 0);

component button_counter
port(clk    : in std_logic; 
     btnU   : in std_logic;
     btnD   : in std_logic;
     led    : out std_logic_vector (15 downto 0));
end component;

begin

UUT: button_counter port map (clk => clk_tb, btnU => btnU_tb, btnD => btnD_tb, led => led_tb);

process
begin

btnU_tb <= '0';
btnD_tb <= '0'; 

wait for 100ns;
btnU_tb <= '1';

wait for 100ns;
btnU_tb <= '0';

wait for 100ns;
btnU_tb <= '1';

wait for 100ns;
btnD_tb <= '1';

wait for 100ns;
btnU_tb <= '0';

wait for 100ns;
btnD_tb <= '0';

end process;

end behavioral;

代码更新后,仍然存在几个问题:

  1. 测试台中未生成时钟

  2. 测试台中的刺激(按下按钮)时机不充分

  3. 去抖动器不会产生enable对于单个时钟

为了方便模拟用于设计验证您的设计已被修改以允许较慢的时钟(看来您实际上使用的是 100 MHz 时钟)。这个想法是减少计算要求和显示波形存储。

前两点在测试平台中得到解决:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity button_counter_tb is
end entity button_counter_tb;

architecture behavioral of button_counter_tb is
    -- NOTE: suffix _tb has been removed, it's annoying to type over and over
    signal clk:   std_logic := '0';  -- ADDED default value '0'
    signal btnU:  std_logic;
    signal btnD:  std_logic;
    signal led:   std_logic_vector (15 downto 0);

    component button_counter
        generic (                       -- ADDED generic
            CLKP:   time := 10 ns;
            DEBT:   time := 6.5 ms      -- debounce time supports different 
        );                              -- mechanical buttons/switches
        port (
            clk:    in  std_logic; 
            btnU:   in  std_logic;
            btnD:   in  std_logic;
            led:    out std_logic_vector (15 downto 0)
        );
    end component;

    constant CLKP:  time := 12.5 us; -- ADDED  just long enough to show debounce
    constant DEBT:  time := 6.5 ms;  -- ADDED
begin

CLOCK:  -- ADDED clock process
    process
    begin
        wait for CLKP/2;
        clk <= not clk;
        if now > 2 sec then    -- stop simulation
            wait;
        end if;
    end process;

UUT: 
    button_counter 
        generic map (           -- ADDED generic map
            CLKP => CLKP,
            DEBT => DEBT
        )
        port map (
            clk => clk,
            btnU => btnU,
            btnD => btnD,
            led => led
        );

-- STIMULI:
--     process
--     begin
--         btnU_tb <= '0';
--         btnD_tb <= '0';
--         wait for 100 ns;
--         btnU_tb <= '1';
--         wait for 100 ns;
--         btnU_tb <= '0';
--         wait for 100 ns;
--         btnU_tb <= '1';
--         wait for 100 ns;
--         btnD_tb <= '1';
--         wait for 100 ns;
--         btnU_tb <= '0';
--         wait for 100 ns;
--         btnD_tb <= '0';
--         wait;  -- ADDED            -- stops simulation
--     end process;
UP_BUTTON:
    process
    begin
        btnU <= '0';
        wait for 2 ms;
        btnU <= '1';   -- first button press
        wait for 0.5 ms;
        btnU <= '0';
        wait for 0.25 ms;
        btnU <= '1';
        wait for 7 ms;
        btnU <= '0';
        wait for 100 us;
        btnU <= '1';
        wait for 20 us;
        btnU <= '0';
        wait for 200 ms;
        btnU <= '1';   -- second button press
        wait for 20 us;
        btnU <= '0';
        wait for 20 us;
        btnU <= '1';
        wait for 6.6 ms;
        btnU <= '0';
        wait for 250 ms;
        btnU <= '1';    -- third button press
        wait for 20 us;
        btnU <= '0';
        wait for 20 us;
        btnU <= '1';
        wait for 6.6 ms;
        btnU <= '0';
        wait for 200 ms;
        btnU <= '1';   -- second button press
        wait for 20 us;
        btnU <= '0';
        wait for 20 us;
        btnU <= '1';
        wait for 6.6 ms;
        btnU <= '0';
        wait for 50 us;
        btnU <= '1';
        wait for 1 ms;
        btnU <= '0';
        wait;
    end process;
DOWN_BUTTON:
    process
    begin
        btnD <= '0';
        wait for 800 ms;
        btnD <= '1';   -- first button press
        wait for 0.5 ms;
        btnD <= '0';
        wait for 0.25 ms;
        btnD <= '1';
        wait for 0.5 ms;
        btnD <= '0';
        wait for 1 ms;
        btnD <= '1';
        wait for 7 ms;
        btnD <= '0';
        wait for 100 us;
        btnD <= '1';
        wait for 20 us;
        btnD <= '0';
        wait for 200 ms;
        btnD <= '1';   -- second button press
        wait for 20 us;
        btnD <= '0';
        wait for 20 us;
        btnD <= '1';
        wait for 6.6 ms;
        btnD <= '0';
        wait for 250 ms;
        wait;
    end process;
end architecture behavioral;

The _tb信号名称的后缀已被删除(重复输入很痛苦)。

已选择时钟周期,其反弹周期与时钟周期的比率保证允许下降“反弹”。刺激按钮按下可以被扩展,模拟在这里是任意的。

请注意,按钮按下值保证跨越一个或多个时钟间隔。 这些应该容忍通过修改来改变时钟周期CLKP.

可以修改去抖间隔DEBT以反映不同开关或按钮的使用,包括严重老化的薄膜开关。去抖间隔是特定开关或按钮的机械特性的结果。传递这些通用常量可以实现一定程度的平台独立性。

第三点通过对去抖动器的更改来解决:

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;

entity debouncer is
    generic (                       -- ADDED GENERICS to speed up simulation
        CLKP:   time := 10 ns;
        DEBT:   time := 6.5 ms
    );
    port (
        clk:        in  std_logic;
        btn:        in  std_logic;
        btn_clr:    out std_logic
    );
end entity debouncer;

architecture behavioural of debouncer is
    -- constant delay: integer := 650000; -- 6.5ms
    constant DELAY: integer := DEBT/CLKP;
    signal count:   integer := 0;
    signal b_enab:  std_logic := '0';  -- RENAMED, WAS btn_tmp

    signal btnd0:   std_logic;      -- ADDED for clock domain crossing
    signal btnd1:   std_logic;      -- DITTO

    begin

CLK_DOMAIN_CROSS:    -- ADDED process
    process (clk)
    begin
        if rising_edge(clk) then
            btnd0 <= btn;
            btnd1 <= btnd0;
        end if;
    end process;

DEBOUNCE_COUNTER:    -- ADDED LABEL
    process (clk)
    begin
        if rising_edge(clk) then
        --     if btn /= btn_tmp then           -- REWRITTEN
        --         btn_tmp <= btn;
        --         count <= 0;
        --     elsif count = DELAY then
        --         btn_clr <= btn_tmp;
        --     else
        --         count <= count + 1;
        --     end if;
            btn_clr <= '0';       -- btn_clr for only one clock, used as enable
            if  btnd1 = '0' then  -- test for btn inactive state
                count <= 0;
            elsif count < DELAY then  -- while btn remains in active state
                count <= count + 1;
            end if;
            if count = DELAY - 1 then  -- why btn_clr '1' or 1 clock
                btn_clr <= '1';
            end if;
        end if;
    end process;
end architecture behavioural;

防抖器已被修改为获取时钟域按钮值,该值用于重置和启用计数器count。输出btn_clrname 保持不变,并且仅对一个时钟有效,并且可以用作使能。

CLKP and DEBT一起使用可以在传递相同的仿真时间的同时实现更快的仿真执行。

请注意,按钮输入的活动状态是硬编码的。这些将连接到可以指定输入极性的设备引脚。

对 Button_counter 的修改传递通用常量CLKP and DEBT给去抖动器:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity button_counter is
    generic (
        CLKP:   time := 10 ns;   -- GENERIC CONSTANTS for faster simulation
        DEBT:   time := 6.5 ms   -- supports diffeent switches/buttons
    );
    port (
        clk:    in  std_logic;
        btnU:   in  std_logic;
        btnD:   in  std_logic;
        led:    out std_logic_vector (15 downto 0)
    );
end entity button_counter;

architecture behavioral of button_counter is
    component debouncer is
        generic (
            CLKP:   time := 10 ns;
            DEBT:   time := 6.5 ms
        );
        port (
            clk:        in  std_logic;
            btn:        in  std_logic;
            btn_clr:    out std_logic
        );
    end component;

    signal btnU_clr:  std_logic;
    signal btnD_clr:  std_logic;
begin

debouncer_btnU:
    debouncer
        generic map (
            CLKP => CLKP,
            DEBT => DEBT
        )
        port map (
            clk => clk,
            btn => btnU,
            btn_clr => btnU_clr
        );
debouncer_btnD:
    debouncer
    generic map (
        CLKP => CLKP,
        DEBT => DEBT
    )
        port map (
            clk => clk,
            btn => btnD,
            btn_clr => btnD_clr
        );

    process (clk)
        variable count:  integer := 0;
        begin
        if rising_edge(clk) then
            if btnU_clr = '1' then 
                count := count + 1;
            elsif btnD_clr = '1'then
                count := count - 1;
            end if;
            led <= std_logic_vector(to_unsigned(count, led'length));
        end if;
    end process;

end architecture behavioral;

And when simulated we now see the LEDs count up and down: button_counter_tb

运行测试台并显示各种波形将允许“放大”以显示两个去抖器中的毛刺处理。

zoom in

通过设计层次结构传递时钟周期和去抖间隔的修改并不是严格必要的。它们有助于模拟,此处用于设计验证。 (测试台中显示的刺激并未彻底验证设计)。

通过使用通用默认值(使用 100MHz 时钟),设计在目标平台中实现时很有可能发挥作用。 (在去抖器中选择按钮输入的活动极性以支持原始实现。如果您怀疑按钮在获得增量或减量时弹跳,则可以增加 DEBT 值。)

如果特定的综合工具无法处理类型的值time作为通用常量传递,您可以转换各种声明CLKP and DEBT输入integer或者直接传递最大计数。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

VHDL:按钮去抖动(或不去抖动,视情况而定) 的相关文章

  • 如何从 JavaScript 中的去抖函数返回值? [复制]

    这个问题在这里已经有答案了 我有这样的代码 var originalFunction function return some value var debouncedFunction debounce originalFunction 30
  • Linux驱动程序DMA传输到PC作为主机的PCIe卡

    我正在开发一个 DMA 例程 将数据从 PC 传输到 PCIe 卡上的 FPGA 我阅读了 DMA API txt 和 LDD3 ch 15 详细信息 但是 我不知道如何从 PC 到 PCIe 卡上的一致 iomem 块进行 DMA 传输
  • 将整数转换为 std_logic

    假设你有一个循环 for i in 1 downto 0 loop for j in 1 downto 0 loop tS0 lt i 但我需要将整数 这是自然的 转换为 std logic tS0被声明为 std logic 我只做了一位
  • 是否可以使用循环创建同一组件的多个实例?

    我有一个组件 Component CAU is port CLK in std logic RESET in std logic START in std logic V DIRECTION in vector 3d P ORIGIN in
  • 您可以使用类 C 语言对 FPGA 进行编程吗? [关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 在大学里 我用类似 C 的语言编写了 FPGA 不过 我也知道人们通常使用 Verilog 或 VHD
  • 敏感列表中的哪个信号触发该过程

    在VHDL中 当模拟测试平台时 我有一个过程和一个敏感度列表 是否可以查看敏感列表中的哪个信号触发了该过程 我知道这可能取决于工具 我正在使用 Xilinx ISE 模拟器是否提供此信息 您可以使用 transaction属性结合 even
  • VHDL - 分配默认值

    我有以下架构 architecture datapath of DE2 TOP is begin U1 entity work lab1 port map error on this line clock gt clock 50 key g
  • FPGA 有哪些实际应用?

    我对我的程序为一个小型七段显示器提供动力感到非常兴奋 但是当我向不在现场的人展示它时 他们总是说 那么你能用它做什么 我永远无法给他们一个简洁的答案 谁能帮我吗 第一 它们不需要具有易失性存储器 事实上 大厂商 Xilinx Altera
  • verilog $readmemh 对于 50x50 像素 RGB 图像花费太多时间

    我正在尝试编译用于 FPGA 编程的 verilog 代码 我将在其中实现 VGA 应用程序 我使用 QuartusII 和 Altera 我正在尝试正确使用 readmemh 来逐像素获取图片 现在 我已经使用 matlab 将图片转换为
  • 赋值语句中的“others=>'0'”是什么意思?

    cmd register process rst n clk begin if rst n 0 then cmd r lt others gt 0 elsif clk event and clk 1 then cmd r lt end if
  • 在VHDL中将8位二进制数转换为BCD

    该算法众所周知 您进行 8 次左移 并在每次移位后检查个位 数十位或数百位 每个 4 位 如果它们超过 4 个 则将 3 个添加到该组中 依此类推 这是一个基于流程的解决方案 但不起作用 它会编译 但输出不是我想要的 有什么想法可能是什么问
  • VHDL 中的进程是可重入的吗?

    一个进程是否可以连续运行两次或多次VHDL 如果在进程的顺序执行未完成的情况下发生另一个事件 在敏感信号列表上 会发生什么 有可能还是我的VHDL流程中的模型完全错误 进程运行时不会发生任何事件 当进程被事件唤醒时 它会运行到完成 结束进程
  • Angular 2 - 消除 keyUp 事件的抖动

    如何消除在 keyUp 事件上调用的函数 这是我的代码 我的功能 private handleSearch searchTextValue string skip number void this searchTextValue searc
  • 如何从 Spartan 6 写入 Nexys 3 FPGA 板上的 Micron 外部蜂窝 RAM?

    我到处都查过了 数据表 Xilinx 网站 digilent 等等 但什么也没找到 我能够使用 Adept 工具来验证我的蜂窝 RAM 是否正常运行 但我找不到任何库存 VHDL 代码作为控制器来写入数据和从中读取数据 帮助 找到了此链接
  • Simulink/HDL Coder 中的反馈循环

    我有一个 Simulink HDL 编码器系统 请参见下图 我有 3 个输出和 3 个输入 我希望我的系统运行 10 次 每次迭代后 它应该选择输出并将它们用作输入 我怎样才能做到这一点 使用存储器和每个信号的初始值块构建一个循环 内存块允
  • VHDL (Xilinx) 中的错误:无法链接设计

    为什么我在 VHDL 中遇到错误 另外 有时 无法执行流程 因为之前的流程失败了 非常感谢 永久解决方案1 在win 10上 找出 installation directory Xilinx 14 x ISE DS ISE gnu MinG
  • 32x8 寄存器文件 VHDL 测试台

    我已经用 vhdl 编写了该电路的汇编代码 我想用测试台来模拟它 RegWrite 1 位输入 时钟 写寄存器个数 3位输入 写地址 写入数据 32 位输入 数据输入 读取 寄存器编号 A 3 位输入 读取地址 读取寄存器编号 B 3 位输
  • VHDL:如何声明可变宽度通用[重复]

    这个问题在这里已经有答案了 我想创建一个 VHDL 实体 其中一个泛型可以更改另一个泛型的宽度 entity lfsr n is generic WIDTH integer 32 counter width POLYNOMIAL std l
  • VHDL 中奇怪的 XNOR 行为

    导致问题的代码看起来像正常的 xnor 操作 如下所示 S 1 lt L 16 xnor L 26 该行会导致以下错误 ncvhdl p E EXPSMI HDL aes sbox enc depth16 vhd 169 14 expect
  • 为什么上升沿优于下降沿

    触发器 寄存器 通常由上升沿或下降沿触发 但大多数情况下 您会在代码中看到使用上升沿触发的 if 子句 事实上 我从未见过有下降沿的代码 这是为什么 是因为程序员自然而然地使用上升沿 因为他们习惯了 还是因为某些物理 模拟定律 事实 上升沿

随机推荐

  • 如何实现在更改时自动更新的可变 PickleTypes

    SQLAlchemy 提供PickleType和优惠突变追踪对于任何可变的类型 如字典 SQLAlchemy 文档提到这是实现可变的方法PickleType但它没有具体说明如何进行 Note 我想在中存储一个字典PickleType 你如何
  • 何时使用 HtmlControls 与 WebControls

    我喜欢 HtmlControls 因为没有 HTML 魔法 asp 源代码看起来与客户端看到的类似 我无法否认 GridView Repeater CheckBoxLists 等的实用性 因此当我需要这些功能时我会使用它们 另外 混合和匹配
  • 使用 intptr_t 而不是 void*?

    使用是一个好主意吗intptr t作为通用存储 保存指针和整数值 而不是void 如下所示 http www crystalspace3d org docs online manual Api1 005f0 64 002dBit Porta
  • 如何使用 pyinstaller 将多个 python 文件编译为单个 .exe 文件

    我已经在 python 中创建了一个 GUI 使用 Tkinter 并且使用 os system python file py 从 GUI 单击按钮即可运行 python 文件 我想使用 pyinstaller 将所有这些 python 文
  • 在 KUbuntu 22.04 上的 Visual Studio Code 中点击快速修复键盘快捷键会生成“e”

    在我的 KUbuntu 22 04 中 当我按下键盘快捷键进行快速修复时 即ctrl 在应用程序中 它产生一个小 e 而不是做任何它期望做的事情 我在网上搜索了这个问题 只找到了这个link 但是 它没有给出解决此问题的任何指导 有人遇到过
  • 安全性:tcl 中的会话标识符未更新

    我正在开发开源应用程序 项目 开放 在扫描过程中我发现了以下漏洞 Medium Session Identifier Not Updated Issue 13800882 Severity Medium URL https
  • 如何在 mysql 查询的“IN”子句中使用 PHP 中的值数组?

    get all id s of ur friend that has installed your application friend pics facebook gt api array method gt fql query quer
  • Next.js getServerSideProps 始终未定义

    我已经开始使用新的 Next 应用程序 并尽可能使用功能组件而不是基于类的组件 继文档 我设置了以下内容但没有运气 import React from react import GetServerSideProps InferGetServ
  • ui grid 将更新的单元格数据保存到数据库

    我正在研究 ui 网格编辑单元格功能 我需要使用 REST API 将编辑后的单元格值更新到数据库 另外 我如何获取控制器中选择的行列表 我的工作代码 var app angular module app ngTouch ui grid u
  • 使用JNA加载多个依赖库

    JNA中有没有办法用Java加载多个依赖库 我通常使用Native loadLibrary 加载一个 DLL 但我猜它不会以这种方式工作 因为我将此函数调用分配给实例成员 假设我有图书馆foo和图书馆bar bar依赖于foo 它也依赖于b
  • 多数独人工智能方法

    我正在概念化一个求解器的变体sudoku called 多重数独 其中多个板重叠 如下所示 如果我正确理解游戏 那么您必须以这样的方式解决每个网格 即任何两个或多个网格之间的重叠都是每个网格解决方案的一部分 我不确定我应该如何思考这个问题
  • 为什么 IntelliJ 的 Java 编辑器中添加灰色的 var:colon

    我安装了IntelliJ 2016 3 2 构建 IC 163 10154 41 建于2016年12月21日 灰色的 var colon 会自动添加到 Java 编辑器中调用方方法的参数前面 如下所示 添加灰色的 a b 为什么会发生这种情
  • 通过 Cordova config.xml 将条目添加到 iOS .plist 文件

    我是 Cordova CLI 的新手 我需要通过 Cordova 以编程方式执行以下步骤 在项目 plist中添加一个新行 在新行中输入以下值 Key GD库模式Type 字符串 默认 Value GD企业模拟 我想我需要在项目根目录下的
  • flink 中的 Kafka 消费者

    我正在使用 kafka 和 apache flink 我正在尝试使用 apache flink 中的 kafka 主题的记录 采用 avro 格式 下面是我正在尝试使用的代码片段 使用自定义反序列化器对主题中的 avro 记录进行反序列化
  • CSS :focus 在 iOS 中不起作用

    我有一个盒子 里面有一张图片 在悬停 聚焦时 我希望颜色叠加和标题淡入其上 除了 iOS 设备外 它几乎可以在所有浏览器和设备上完美运行 我同时使用 hover 和 focus 伪类来适应各种设备 但它似乎对 iOS 没有帮助 当您将鼠标悬
  • Firebase 消息传递主题超出配额

    我在尝试发送推送时收到错误 超出主题配额 我认为 Firebase 云消息传递没有限制 我做错了什么 据我所知 没有任何限制 一次可以达到1000 但如果你已经结束了 那么火力点将需要更多时间才能发送给每个人 即使你使用自己的服务器发送推送
  • Android Studio 的 git commit 没有看到我修改的文件

    我更熟悉在命令行 尤其是 MacOS 上使用 git 但是 我有时会尝试使用 Android Studio VCS 提交 因为它有时使用起来稍快一些 我今天遇到的奇怪问题是Android的Studio git commit 看不到我的4个修
  • 如何在 javascript/es6 中导入两个同名的类?

    我的文件中有这两个导入语句 import Data from component Data js import Data from actions Data js 这两个文件都包含一个名为Data 我如何指定哪个是哪个 如何避免名字冲突 想
  • 3D 最小二乘平面

    给定一组 3D 数据点 计算 x y z 空间中的最小二乘平面的算法是什么 换句话说 如果我有一堆点 例如 1 2 3 4 5 6 7 8 9 等 那么如何计算最佳拟合平面 f x y ax by c 从一组 3D 点中获取 a b 和 c
  • VHDL:按钮去抖动(或不去抖动,视情况而定)

    我已阅读其他帖子 但似乎无法修复我的 我是 VHDL 新手 所以我确信这是一个简单的修复 简而言之 按钮没有防抖 代码编译和比特流程序 在测试台中 按下按钮可以工作 但输出 LED 不会改变 在板上 按下按钮会使随机 LED 亮起 我猜是因