Skip to content

Commit 91ed4e1

Browse files
authored
Merge pull request #32 from EdNutting/master
Fix clock output enable bit. Fix register control input pull value.
2 parents 29e50ab + 97c31f8 commit 91ed4e1

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

build.sh

100644100755
File mode changed.

src/com/modsim/modules/Clock.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,22 @@ public void propagate() {
9595

9696
// Phase 1
9797
BinData p1 = new BinData();
98-
p1.setBit(0, (step == 1) ? 1 : 0);
98+
p1.setBooleanBit(0, step == 1);
9999
phase1.setEnabled(step == 1);
100100

101101
// Phase 2
102102
BinData p2 = new BinData();
103-
p2.setBit(0, (step == 3) ? 1 : 0);
103+
p2.setBooleanBit(0, step == 3);
104104
phase2.setEnabled(step == 3);
105105

106106
// Reset signal
107107
p2.setBooleanBit(1, sendReset);
108108
p1.setBooleanBit(1, sendReset);
109109

110+
// Enable signal
111+
p2.setBooleanBit(2, true);
112+
p1.setBooleanBit(2, true);
113+
110114
// Set the outputs
111115
outputs.get(0).setVal(p1);
112116
outputs.get(1).setVal(p2);

src/com/modsim/modules/Register.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class Register extends BaseModule {
3535
h = 50;
3636

3737
dataIn = addInput("Data in", 0, Port.DATA);
38-
controlIn = addInput("Control in", 0, Port.CLOCK, new BinData(0, 1, 0, 0));
38+
controlIn = addInput("Control in", 0, Port.CLOCK, new BinData(0, 1, 0, 1));
3939

4040
dataOut = addOutput("Data out", 0, Port.DATA);
4141
controlOut = addOutput("Control out", 0, Port.CLOCK);

0 commit comments

Comments
 (0)