projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fleshed out Am2900MicroInstructionDefinition
[Mograsim.git]
/
net.mograsim.logic.core
/
src
/
net
/
mograsim
/
logic
/
core
/
types
/
BitVector.java
diff --git
a/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java
b/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java
index
4d5f911
..
ee95756
100644
(file)
--- a/
net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java
+++ b/
net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java
@@
-491,4
+491,15
@@
public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
}
};
}
+
+ public BitVector reverse()
+ {
+ int length = length();
+ Bit[] other = new Bit[length];
+ for (int i = 0, j = length - 1; i < length; i++, j--)
+ {
+ other[i] = bits[j];
+ }
+ return new BitVector(other);
+ }
}