-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[logisim-cdm-emulator] Generalize and refactor utility classes
+ Generalize `ProcessorComponentData` + Reimplement `ProcessorClockState`
- Loading branch information
1 parent
1579dc0
commit 9c32e27
Showing
6 changed files
with
58 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
logisim/logisim-cdm-emulator/src/main/java/org/cdm/logisim/emulator/ProcessorClockState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.cdm.logisim.emulator; | ||
|
||
import com.cburch.logisim.data.Value; | ||
|
||
public class ProcessorClockState { | ||
private Value lastClock = Value.FALSE; | ||
private Value currentClock = Value.FALSE; | ||
|
||
public void update(Value newClock) { | ||
lastClock = currentClock; | ||
currentClock = newClock; | ||
} | ||
|
||
public boolean isClockRising() { | ||
return lastClock.equals(Value.FALSE) && currentClock.equals(Value.TRUE); | ||
} | ||
|
||
public boolean isClockFalling() { | ||
return lastClock.equals(Value.TRUE) && currentClock.equals(Value.FALSE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 0 additions & 62 deletions
62
...ogisim-cdm-emulator/src/main/java/org/cdm/logisim/emulator/cdm16/ProcessorClockState.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters