简体   繁体   English

VHDL触发器复位不同于0

[英]VHDL flip-flop reset different than 0

is any possibility to reset flip-flop vector to different value than all 0? 是否有可能将触发器矢量重置为不同于全0的值? something like: 就像是:

PROCESS (clk)
    BEGIN
        IF RISING_EDGE(clk) THEN
            IF rst = '1' THEN
                ff <= INPUT_VALUE;
...

This don't survive synthesis. 这无法在综合中幸存下来。 I want to get the value to ff only when resetting, then I'm changing it - it works as a counter with first value set from input. 我只想在重置时将值设为ff,然后进行更改-它用作从输入中设置第一个值的计数器。

How about implementing a normal reset and then use load signal to set the counter to something else? 如何执行正常复位,然后使用负载信号将计数器设置为其他值呢? This to me would be the standard way. 对我而言,这将是标准方式。

The following is an amusing answer that would actually work: 以下是一个实际可行的有趣答案:

1) Determine the bit pattern of the value that it should be initialized to. 1)确定应初始化为该值的位模式。

2) For every bit that should be a 1, put a not gate on that line before and after the flip-flop. 2)对于应该为1的每一位,在触发器之前和之后在该行上放置一个非门。

Now the initial state after the reset pin is the state you want. 现在,复位引脚之后的初始状态就是您想要的状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM