diff --git a/src/main/java/de/neemann/digital/core/flipflops/FlipflopRS.java b/src/main/java/de/neemann/digital/core/flipflops/FlipflopRS.java index 5675183dc..7bceaa0c1 100644 --- a/src/main/java/de/neemann/digital/core/flipflops/FlipflopRS.java +++ b/src/main/java/de/neemann/digital/core/flipflops/FlipflopRS.java @@ -23,6 +23,7 @@ public class FlipflopRS extends Node implements Element { = new ElementTypeDescription("RS_FF", FlipflopRS.class, input("S"), input("C"), input("R")) .addAttribute(Keys.ROTATE) .addAttribute(Keys.LABEL) + .addAttribute(Keys.DEFAULT) .addAttribute(Keys.INVERTERCONFIG) .addAttribute(Keys.VALUE_IS_PROBE); @@ -48,6 +49,11 @@ public class FlipflopRS extends Node implements Element { this.qn = new ObservableValue("\u00ACQ", 1).setPinDescription(DESCRIPTION); isProbe = attributes.get(Keys.VALUE_IS_PROBE); label = attributes.getCleanLabel(); + + int def = attributes.get(Keys.DEFAULT); + out = def > 0; + q.setBool(out); + qn.setBool(!out); } @Override diff --git a/src/main/java/de/neemann/digital/core/flipflops/FlipflopT.java b/src/main/java/de/neemann/digital/core/flipflops/FlipflopT.java index 64a24a2a2..a47dc8c97 100644 --- a/src/main/java/de/neemann/digital/core/flipflops/FlipflopT.java +++ b/src/main/java/de/neemann/digital/core/flipflops/FlipflopT.java @@ -23,6 +23,7 @@ public class FlipflopT extends Node implements Element { = new ElementTypeDescription("T_FF", FlipflopT.class, input("C")) .addAttribute(Keys.ROTATE) .addAttribute(Keys.LABEL) + .addAttribute(Keys.DEFAULT) .addAttribute(Keys.INVERTERCONFIG) .addAttribute(Keys.VALUE_IS_PROBE); @@ -46,6 +47,11 @@ public class FlipflopT extends Node implements Element { this.qn = new ObservableValue("\u00ACQ", 1).setPinDescription(DESCRIPTION); isProbe = attributes.get(Keys.VALUE_IS_PROBE); label = attributes.getCleanLabel(); + + int def = attributes.get(Keys.DEFAULT); + out = def > 0; + q.setBool(out); + qn.setBool(!out); } @Override