StarMade Logic - 4 Digit 7 Segment Stopwatch

    Joined
    Aug 25, 2013
    Messages
    180
    Reaction score
    43
    I built a 4 digit 7 segment stopwatch using logic gates (about 250 gates). It counts minutes and seconds. It can be paused and reset.
    The circuit is fairly simple. It uses 2 4 bit timers and 2 3 bit timers. Each timer drives a 7 segment decoder. When each decoder gets to its last digit, it sends a reset pulse to its timer and sends a clock pulse to the next timer in the chain.
    It seems to work quite reliably, but it will bug out if the sector unloads while it's still running.

    The 4 digits in the front are made from plex doors with ice crystal behind. I initially used plex lights but they don't have enough contrast to read from a distance. I can easily read this from across my workshop (about half a sector).
    Front.jpg

    Inside are 4 timers and 7 segment decoders.
    Inside_1.jpg Inside_2.jpg

    This is the control panel for it. There is a reset button and a run/stop button. The set gates are exposed to allow each digit to be manually set.
    Controls.jpg

    I have attached the blueprint file for those who want to see how it works. I will make a video later if anyone is interested.
     

    Attachments

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    You need 7 bits for minutes and 7 for seconds --linked-to-> ( (unset -> or -> not), set -> and -> per Door )
    => 3*14, => 42 logic blocks for decoding two 7 bit values for doors.

    Why did you not use just one timer and binary adders?


    (bit & prevOverflow) | overflow -> overflow
    (bit | (prevOverflow & ~overflow) ) -> bit

    overflow == [[ ( (input | output) & timer -> output) | timer ]] == prevOverflow
    bit == [[ (input | output) & notReset -> output]] == bit

    seconds == 60 => overflow to minutes == 1 & reset seconds

    you need about 2+2 or|and per overflow+bit(reset-able) and 2 or, 2 and, 1 not for the adder element == (*14 bits), roughly 130 blocks (first and last of seconds&minutes are a bit different)


    You may be able to do the same circuit with about 200 blocks. Connections between logic blocks don't have mass or resource cost :D

    But compared to the (7*3*4) * (Plex- Lights+Doors) = 168 blocks + countless hulls, these 50 blocks difference are negligible.

    Also I see this nice blinking : *insert thumbs up "smiley" here*
     
    Last edited:
    Joined
    Aug 25, 2013
    Messages
    180
    Reaction score
    43
    Why did you not use just one timer and binary adders?
    I would have built it on a breadboard mostly using some counter ICs and seven segment decoder ICs, so that's how I thought to build it in the game as well. It needed a couple tweaks to get around some starmade logic bugs though.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Yay BUGS !!! Call Batman (bats eat some bugs) :)

    You need elements like (input --one-way-> or <-two-way-> output) for being able to set it to 1, not 0 and (input --one-way-> and <-two-way-> output) for being able to reset without setting it.
    The combination of clock being able to reset and circuit being able to set should be sufficient for circuits with 1-second-per-update.

    Logic groups should have an implicit detection of raising edges

    I think we need a tutorial about how blocks update.

    Update1 -> block1 (first receiver cause less blocks inbetween)
    Update1 -> not -> block2 (second receiver of update1)
    vs
    Update2 -> not -> block1 (first receiver because first output)
    Update2 -> block2 (second receiver of update2)
    ->
    block1 XOR block2 -> triggers 2* between raising/falling edge -> X
    block1 & block2 -> or <--> A
    ~(block1 | block2) -> or <--> NO​

    Will X be true or XOR waits for both inputs? Will A and NO be true?

    Personally I use the first variant, but I want to fix this issue with X (should fire only once) without creating more code iterations.
    • X=2*, A=1 on raising edge, NO=1 on falling edge.
    Second would be very unreliable.

    What bugs did you encounter?
     
    Last edited:

    Bench

    Creative Director
    Joined
    Jun 24, 2013
    Messages
    1,046
    Reaction score
    1,745
    • Schine
    • Wired for Logic
    • Legacy Citizen 6
    Nice, good to see people working at logic circuits. I have a similar countdown timer that uses shift register to cycle through outputs. Again always a problem when sector unloads though.
     
    Joined
    Aug 25, 2013
    Messages
    180
    Reaction score
    43
    What bugs did you encounter?
    Just some circuits not behaving like they do in real life. One of them is if you take out the delay block that goes to the reset line on any of the counters, it does not fully reset and the counter locks up.
     
    Joined
    Aug 5, 2013
    Messages
    405
    Reaction score
    140
    • Community Content - Bronze 1
    wow, nice:)
    the lightning sphere should have one of this