Magitech Signal Generator

A signal generator is a simple system that is able to deliver an alternating signal.

The signal have a frequency determined principally by the max clock rate of any soul device in the game (by default it is 10Hz).

## Clock Generator

The simplest signal generator is a clock generator.
The output will alternate between LOW (0) and HIGH (>0).

A clock generator have the following properties:

* Period
* Duty Cycle
* Phase

### Clock Example 1

Period=2, Duty\_Cycle=50%, Phase=180°
The output signal will be 0\_1\_0\_1\_...

### Clock Example 2

Period=4, Duty\_Cycle=25%, Phase=90°
The output signal will be 0\_1\_0\_0\_0\_1\_...

## Signal Generator

A signal generator is more complex because it can output a sequence of digital values.

You can do a simple and compact signal generator with a Magitech Counter and a clock generator, but the speed will be limited to 5Hz because you can't do a signal generator with a period of 1.

The fastest solution is to design yourself a custom circuit to generate the wanted sequence.

### Fast Even Sequence Generator

This kind of circuit is very useful to read the content of 8-byte ROMs.

You can copy the circuit with the following code to import it in building mode:

```
CENTeNrtkLENwkAMRb99vhRZgSUoYTGEoKBgCibIABQUjMAaDIEEyuHvHBKhghIpl/jp2/524SWApsZ
+JUApTS+lbN5VL3d5xUerlNzLY1QtVBO+xwlY++UV5ompY8uMOVlTqxGpn32sdojp6Zy/3/4CCsecny
vGv/4L8M0gOCiQhASOTgmt0jlz6KRXks42J1YspsxIiYq4R5CGbsyaUuccG+hszbuCbDf67cxubM6xT
cOv6NyjsVnDP7wnevA9tQ==

```

Just place datablocks with the desired value before placing the counters, it's more compact than using the Max input.

More information about counters here.

On this example, Counters values are 7 and Modulo value is 6. The sequence generated is 0 to 7.

### Fast Uneven Sequence Generator

The only problem is that the sequence is uneven, so it's rarely useful.

```
CENTeNrtkrENAjEMRb99CdRsci0MRgcnxBRMcAtQwQAswhChIfzvQ0IgKKBDuiT+evp2UjieA2gYU8Z
2bcDVtGtdfcJCKG8LLs9uBUb5RhbAkj/gxA5IhIToqMe+Y3qgv2JcG5v5S+dPEKBu0KIlKP7yHKA1gz
U752TkInUxBsXeOS0TseWoSaHNWVkL33spfc7jkJVvZr0cVlLzMV7TugFeSzOv

```

On this example, Counters values are 4 and Modulo value is 5. The sequence generated is 0 to 4.

### Fast 0-7 Sequence Generator

Here a circuit to output a sequence from 0 to 7 with the higher frequency possible.

It requires a 8-to-3 and a DAC.

It is also possible to generate the appropriate inputs for the DAC without a 8-to-3 but it will be less compact.

Note: this design is less compact than the "Fast Uneven Sequence Generator", the circuit is here for reference.

Now you can connect the output to a 8-byte ROM reader to generate any wanted signal (limited to a period of 8).

```
CENTeNrtUctNBTEM9C/eZN9SEBVQ0ePXAhVQwYobEoILV+oiZGYXECe4cHuRMrIn9niSnIvIYex5bL9
Tkd4P79r78d+ijugEv8GjyDq+A6v3ZgMuEU0mIciufmTXyPIzG5WxnYp8ddYtQ37c895v977eb3a9b6
3TP/wRnrdvuhD3e5PFY+AcRE+gAJfijMGn+cv4DgMvSfQKNB1YdcQ2zfJqKsWo2dYR5wQFDcbg5wJGg
mgC5VLA54acmOA9GpRDqIAp6bqii5WaiHVo2lngdMyHw6D/gt4WrDT6LOQb1KQVMuhyp77TT9MHKBhv
ilvXRM1S4Uoq/StdyabA3knfUI/TrMoazpX2hFcC72V7W/KlspK9SX6iq6TPqJyOKfOMeg3nRK4PVgr
2uQ==

```

Here a practical example of a simple 0-7 signal generator used to display a loading animation:

```
CENTeNrtVLtOG0EUvTM7s7se45X8wBgTIxeW6y0o4EeokYBfSAlKDT+QJkUUCYkGSynzC/mASGlcpE5
SISTQDvecNQgJIeHSkmd2js+eOb5z587YByIy1pHp+H1jRGIcVybGI7BmZf5qj7H7tlQZ9PsX40En+k
vFWKwZwdbwfhiJfOWRfQIUVtBIYjxhpcEc2AbYqYgVx6EylOzlXIxhMfWsHr8OvC78kvBF5JCndCmCW
38m8s/cKqmeyHk9sS7WkjAT+YmLeTmdxLPpZBIrwLm+xelKPrPpL+znQspSr4nCRynrrj/xJy3KSj6z
xVnJvm5jr9Tbv1/qzd9b3f2gHUqW/NH/x469BppvVqzzn63k3inKFpTg6fFGlbDtVclH1BN6MujyAXp
wCRXq3gKdciMJeaJxjPS5Vkpnaq+AdQTqjkpG/4D5JPUs+ZCYMma/ztZcKe8yK4/M7SZz2yaOqO8QO8
xwSOxxrS49OaMNqWzS2acn9awAlR6VHfoH5AP6e8whgzM0asTeG43kzuoHK5YD0xw78jl27RrgaYBzI
/Bbgc4A3easf4DTN81c4xjzXdfa1XVtszDANrBoQylaTnOQFrKSppsrFnRaRt6lv2XoscDE/1c0/oei
ZW3r9gjigXwB

```