aboutsummaryrefslogtreecommitdiffstats
path: root/examples/bincount.galscr
blob: 4a6cb85e19c89e8775e45cfeda6efedaa3dc4772 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Galemu signal generator script
# Binary counter

# Bitwidth of the counter
bitwidth = 4
# The output port for the LSB
lsbout = 0

reset()
count = 0
while True:
	for i in range(0, bitwidth):
		out(lsbout + i, (count & (1 << i)))
	if not breakpoint("increment"):
		msleep(200)
	count = (count + 1) & ((1 << bitwidth) - 1)
bues.ch cgit interface