projects
/
Mograsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b1e7855
)
Cleanup
author
Fabian Stemmler
<stemmler@in.tum.de>
Mon, 20 May 2019 13:05:26 +0000
(15:05 +0200)
committer
Fabian Stemmler
<stemmler@in.tum.de>
Mon, 20 May 2019 13:05:26 +0000
(15:05 +0200)
era.mi/src/era/mi/logic/wires/Wire.java
patch
|
blob
|
history
diff --git
a/era.mi/src/era/mi/logic/wires/Wire.java
b/era.mi/src/era/mi/logic/wires/Wire.java
index
d85fc20
..
4c24571
100644
(file)
--- a/
era.mi/src/era/mi/logic/wires/Wire.java
+++ b/
era.mi/src/era/mi/logic/wires/Wire.java
@@
-60,12
+60,7
@@
public class Wire
Bit[] bits = input.getInputValues();
for (int i = 0; i < length; i++)
{
Bit[] bits = input.getInputValues();
for (int i = 0; i < length; i++)
{
- if (Bit.Z.equals(bits[i]) || newValues[i].equals(bits[i]))
- continue;
- else if (Bit.Z.equals(newValues[i]))
- newValues[i] = bits[i];
- else
- newValues[i] = Bit.X;
+ newValues[i] = newValues[i].combineWith(bits[i]);
}
}
}
}
@@
-247,12
+242,10
@@
public class Wire
*/
public void feedSignals(Bit... newValues)
{
*/
public void feedSignals(Bit... newValues)
{
- if (newValues.length == length)
- {
- feedSignals(0, newValues);
- } else
+ if (newValues.length != length)
throw new IllegalArgumentException(
String.format("Attempted to input %d bits instead of %d bits.", newValues.length, length));
throw new IllegalArgumentException(
String.format("Attempted to input %d bits instead of %d bits.", newValues.length, length));
+ feedSignals(0, newValues);
}
/**
}
/**