entity Main { in clk: bit, out LED1: bit, out LED2: bit, out LED3: bit, out LED4: bit, out LED5: bit, } impl Main { // With a 12Mhz clock, count off every .5 seconds of ticks. def mut index: uint{..6000000}; // Declare a state change every positive clock edge. on clk.posedge { if index == 6000000 - 1 { LED5 <= !LED5; index <= 0; } else { index <= index + 1; } } // Disable the other LEDs, as they otherwise would be // left floating and semi-lit. Because these definitions // are stateless (not mutable), we can declare them at the // top level. LED1 = 0; LED2 = 0; LED3 = 0; LED4 = 0; }