Generating sine waves with a GAL

INTRODUCTION

This is a simple approach using a GAL and an ADC to generate a sine wave. A simple State Machine is looping though 47 different states and outputting data words accordingly. In order to avoid unpredictable output sequences all states have to be unique. The requirement that each state has to be unique limits the number of states, as well as the logic resources of the GAL.

FEATURES

  • Output frequency range: 0 – 1MHz
  • 8 bit parallel output data
  • One GAL or ATF22V10

LET’S GET STARTED

Circuit Description

Connect the output data of the GAL to a TLC 7524, TLC7528 or R-2R DAC. Apply a clock signal (CLK) to pin 1 of the GAL. The output frequency of the ADC’s sine wave will be: f_sine=f_CLK/47

ABEL design

MODULE 

TITLE 'Sine generator'
"Yorck Thiele, December 2020

"47 8-bit DAC values
"fsine=CLK/47

DEVICE  'p22V10';


"INPUTS
CLK  PIN  1;

"OUTPUTS
Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7	PIN 15,16,17,18,19,20,21,22	ISTYPE 'reg';

DATA=[Q7, Q6, Q5, Q4, Q3, Q2, Q1, Q0];

EQUATIONS
@DCSET
DATA.clk=CLK;

TRUTH_TABLE ([DATA] :> [DATA])
[^h00]  :> [^h80];
[^h80]  :> [^h91];
[^h91]  :> [^hA2];
[^hA2]  :> [^hB2];
[^hB2]  :> [^hC1];
[^hC1]  :> [^hCF];
[^hCF]  :> [^hDB];
[^hDB]  :> [^hE6];
[^hE6]  :> [^hEF];
[^hEF]  :> [^hF6];
[^hF6]  :> [^hFC];
[^hFC]  :> [^hFE];
[^hFE]  :> [^hFF];
[^hFF]  :> [^hFD];
[^hFD]  :> [^hF9];
[^hF9]  :> [^hF3];
[^hF3]  :> [^hEB];
[^hEB]  :> [^hE1];
[^hE1]  :> [^hD5];
[^hD5]  :> [^hC8];
[^hC8]  :> [^hB9];
[^hB9]  :> [^hAA];
[^hAA]  :> [^h99];
[^h99]  :> [^h89];
[^h89]  :> [^h78];
[^h78]  :> [^h67];
[^h67]  :> [^h57];
[^h57]  :> [^h47];
[^h47]  :> [^h38];
[^h38]  :> [^h2B];
[^h2B]  :> [^h1F];
[^h1F]  :> [^h15];
[^h15]  :> [^h0D];
[^h0D]  :> [^h07];
[^h07]  :> [^h03];
[^h03]  :> [^h01];
[^h01]  :> [^h02];
[^h02]  :> [^h04];
[^h04]  :> [^h09];
[^h09]  :> [^h10];
[^h10]  :> [^h1A];
[^h1A]  :> [^h24];
[^h24]  :> [^h31];
[^h31]  :> [^h3F];
[^h3F]  :> [^h4E];
[^h4E]  :> [^h5E];
[^h5E]  :> [^h6F];
[^h6F]  :> [^h80];

END 

DOWNLOAD SECTION

Sine Generator