Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| waveforms_-_rom_logic [2016/11/28 11:29] – [5. Example: Binary counter with Count Enable input.] Mircea Dabacan | waveforms_-_rom_logic [2022/10/04 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 49: | Line 49: | ||
| // | // | ||
| - | ===== 3. ROM logic User Interface in WaveForms | + | ===== 3. ROM logic User Interface in WaveForms ===== |
| In the Pattern Generator, click the green “plus” sign and select ROM logic, as shown below. | In the Pattern Generator, click the green “plus” sign and select ROM logic, as shown below. | ||
| Line 116: | Line 116: | ||
| ===== 5. Example: Binary counter with Count Enable input. ===== | ===== 5. Example: Binary counter with Count Enable input. ===== | ||
| - | In the figure below, DIO8 is renamed CE and is used as Count Enable. DIO7…DIO0 are renamed c7…c0 and are the state/ | + | In the figure below, DIO8 is renamed CE and is used as Count Enable. DIO7…DIO0 are renamed c7…c0 and are the state/ |
| Line 1 in the Truth Table (equivalent to 2< | Line 1 in the Truth Table (equivalent to 2< | ||
| Line 158: | Line 158: | ||
| // | // | ||
| - | A 5-bit counter is implemented in a ROM logic object, as below, on DIO9…DIO5, | + | A 5-bit counter is implemented in a ROM logic object, as below, on DIO9…DIO5, |
| {{: | {{: | ||
| Line 164: | Line 164: | ||
| // | // | ||
| - | A second ROM logic (sheet PWM in RomLogicTrouthTables.xls) compares DIO9…DIO5 = c4…c0 = “5BitCounter” with DIO4…DIO0 = s4…s0 = ”Sample”. DIO10 = CY = ”CarryOut” is High when “Sample” is higher. Notice again how higher order bits (later lines in the Truth Table) override the lower order bits (earlier lines in the Truth Table). | + | A second ROM logic (sheet PWM in {{: |
| {{: | {{: | ||
| Line 187: | Line 187: | ||
| // | // | ||
| - | Variable n-bit sample can be used as a modulator signal. For the second experiment, set a custom 5-bit Bus 1 in the Pattern Generator, to drive a sinus signal with 100 samples per period. Generate a .csv file, with 100 values of form (sheet SinusSamples in RomLogicTrouthTables.xls): | + | Variable n-bit sample can be used as a modulator signal. For the second experiment, set a custom 5-bit Bus 1 in the Pattern Generator, to drive a sinus signal with 100 samples per period. Generate a .csv file, with 100 values of form (sheet SinusSamples in {{: |
| $$sample_i=16+int(15*sin((2∙π∙i)/ | $$sample_i=16+int(15*sin((2∙π∙i)/ | ||
| Line 212: | Line 212: | ||
| ===== 7. Example: PDM modulator. ===== | ===== 7. Example: PDM modulator. ===== | ||
| - | In the figure below, an n-bit accumulator is used to add the sample value over and over. The Carry Out bit is the Pulse Density Modulated (PDM) signal. The accumulator is refreshed with fcnt frequency, while samples succeed with fsample | + | In the figure below, an n-bit accumulator is used to add the sample value over and over. The Carry Out bit is the Pulse Density Modulated (PDM) signal. The accumulator is refreshed with f< |
| {{: | {{: | ||
| Line 224: | Line 224: | ||
| // | // | ||
| - | A 5-bit PDM modulator is implemented in the PDM Accumulator ROM logic object, with DIO 9…DIO5 = a4…a0 as “Accumulator”, | + | A 5-bit PDM modulator is implemented in the PDM Accumulator ROM logic object, with DIO 9…DIO5 = a4…a0 as “Accumulator”, |
| {{: | {{: | ||
| Line 234: | Line 234: | ||
| $$(CY, | $$(CY, | ||
| - | To compare with PWM, similar examples are used. The same external RC filter, the clock frequency of the modulator, the sinus sample LUT and sample frequency are all the same as in the corresponding PWM experiments. | + | To compare with PWM, similar examples are used. The same external RC filter, the clock frequency of the modulator, the sinus Sample Memory |
| In the static experiment, the same duty factor is generated, with a much higher frequency, resulting in a much smaller ripple of the analog signal. | In the static experiment, the same duty factor is generated, with a much higher frequency, resulting in a much smaller ripple of the analog signal. | ||
| Line 244: | Line 244: | ||
| In the dynamic experiment, the same sinus custom Bus1 was used, as for the PWM. The average Duty Factor is again around 50%, the frequency is variable and the average frequency is much higher compared to PWM, for the same clock frequency. The ripple of the analog signal is also much smaller. | In the dynamic experiment, the same sinus custom Bus1 was used, as for the PWM. The average Duty Factor is again around 50%, the frequency is variable and the average frequency is much higher compared to PWM, for the same clock frequency. The ripple of the analog signal is also much smaller. | ||
| - | The lowest instantaneous frequency of the PDM signal happens when the sample value is either 1LSB or 2n-1LSB, and is the same as the constant frequency of the PWM signal. For all other values of the samples, the resulting instantaneous frequency is higher, up to half of the clock frequency, when the sample value is at half of the range. | + | The lowest instantaneous frequency of the PDM signal happens when the sample value is either 1LSB or 2< |
| Having both instances of the Pattern generator open, is very easy to run them alternatively for easy comparison on the scope instrument. Hitting Run on one instance automatically turns the other instance in Busy state. | Having both instances of the Pattern generator open, is very easy to run them alternatively for easy comparison on the scope instrument. Hitting Run on one instance automatically turns the other instance in Busy state. | ||

