mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-19 01:44:44 -04:00
Fixes a bug that prevented the analysis of the BitExtender.
This commit is contained in:
parent
0c1714c38c
commit
249df37bd9
@ -48,12 +48,15 @@ public class BitExtender implements Element {
|
|||||||
final long signMask = Bits.signedFlagMask(inBits);
|
final long signMask = Bits.signedFlagMask(inBits);
|
||||||
final long extendMask = ~Bits.mask(inBits);
|
final long extendMask = ~Bits.mask(inBits);
|
||||||
|
|
||||||
in.addObserver(() -> {
|
in.addObserver(new NodeWithoutDelay(out) {
|
||||||
long inValue = in.getValue();
|
@Override
|
||||||
if ((inValue & signMask) == 0)
|
public void hasChanged() {
|
||||||
out.setValue(inValue);
|
long inValue = in.getValue();
|
||||||
else
|
if ((inValue & signMask) == 0)
|
||||||
out.setValue(inValue | extendMask);
|
out.setValue(inValue);
|
||||||
|
else
|
||||||
|
out.setValue(inValue | extendMask);
|
||||||
|
}
|
||||||
}).hasChanged();
|
}).hasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user