In this post we learn how to build a simple yet accurate digital sine wave generator circuit, which is basically an oscillator circuit, enhanced to generate square waves through incrementing steps, which ultimately appears like a stepped sine waveform.

By Ron Mackenzy

The difference between analogue sine wave generator and digital sine wave generator is that, in analogue design mainly op amps are utilized to shape a smooth exponentially increasing pure sine waveform, while in a digital mode, the waveform is also exponentially increasing but it is with a staggered shape, or in a stepped manner.

### Advantage

The main advantage of digital sinewave compared to the analogue counterpart is that, analogue sine wave cannot be used to switch MOSFETs or power transistors for a given applications such as sine wave inverters, converters, motor control etc, while digital sine waveform becomes perfectly suitable for such applications, without causing heating up of the devices.

This is because, transistors do not "like" to conduct with analogue signals, or with smoothly rising/falling exponential waveforms, instead the internal characteristics of these devices allow them to be more suitable to logic waveforms, triggered with high and low logic signals.

## How the Circuit Works

The circuit is made up of a couple of stages, each of which might have several valuable applications by itself: an oscillator built using a set of EX(clusive) OR gates along with a divide-by-three circuit created through a pair of common flipflops.

The basic oscillator consists of a noninverting gate (N1) and an inverting gate (N2). If simply inverting gates was utilized, a minimum of about three might have been required for this oscillator, however, a non-inverting gate could be constructed through a couple of inverting gates hooked up in series.

The circuit functions like this: We will suppose that, at the start, the input of N1 (pin 2) is low. Therefore the output of N1 will be also low causing the output of N2 to be high.

Capacitor C1 will subsequently be charged through resistor R2. After a brief moment, the N1 input should go high through R1 and the entire process is going to be reversed. The divide-by-three section includes a couple of flip-flops that each divide by 2. Put simply, it would be anticipated that collectively these might divide by four.

Having said that, an additional EXOR gate (N3) can be seen incorporated between the output of FF2 and the input of FF1. This efficiently inverts the clock input signal whenever the output of FF2 flips its polarity. In case N3 hadn't been used the flipflop's output state wouldn't switch before the ongoing clock interval ended.

With the help of N3, the clock signal gets inverted and its positive-going edge activates the flipflop once every half time period. As a result, the dividing element in the process is three, never four. The sinewave signal is created by using a couple of resistors (R3 and R4).

As soon as the input on the two resistors is low (logic zero) no output voltage will be seen. Once the input to the two resistors becomes high (logic one) the output voltage turns high. If one of the inputs applied to the resistors is low while the other input is high, causes the output voltage to be either 1/4th or 3/4th of the supply (high) level.

### Waveform

Surely, the above situation could be confirmed through formulas, but a less complicated technique is to describe this by analyzing just one sinewave interval through a waveform diagram.

A small rectangle could be used at the center of the sinewave to symbolize a logic 1 level. A pair of additional rectangles of the identical dimension then can be sketched on each side of the first. The region within the sinewave of the final a couple of rectangles is going to be half that of the first. The digital simulation method produces a signal using the exact same regions like the above.

While building this particular digital sine wave generator circuit, it has to be taken into account that CMOS inputs must never be kept 'floating'.

This means that, pins 12 and 13 of the EXOR chip (N4) must be attached to ground (0V).

### Application Circuit

A stepped waveform can be very effectively used for making a sine wave inverter as shown in the following example:

## Your Comments are too Valuable! But please see that they are related to the above article, and are not off-topic!