EveryCircuit
Contact
Reviews
Home
592azy2circuitdude
modified 2 years ago

Numerically Controlled Oscillator

13
3
571
05:29:06
A Numerically Controlled Oscillator (NCO) is a key component to many Digital Signal Processing (DSP) systems. Here's a small one I hope you enjoy. Just hit the up/down button on the left to increase/decrease the frequency. There are 7 settings. 0Hz 75Hz 150Hz 25Hz 100Hz 175Hz 50Hz 125Hz Frequency resolution of 25Hz N = 8 output bits (1 byte) (phase resolution) W = 3 frequency control word (phase step) bits Fclk = 6.4kHz F = 2แต‚ ร— Fclk / 2แดบ Blue waveform: Output Green waveform: First 4 bits Orange waveform: Clock An NCO is an oscillator that is completely controlled by digital logic. It works by recursively adding digital numbers using binary adders in a feedback loop. This is called a phase accumulator. Think of "phase" as the stored digital number, which can represent the actual phase (time component) of a signal. Normally, it is paired with some kind of Phase to Amplitude converter (PAC). In my AWG circuit, I do just that: https://everycircuit.com/circuit/6214446053326848 The phase accumulator consists of 2 parts: phase register and frequency control register. The phase register (the right 2 counters) stores the current binary number (i.e., phase). This stored number is added with the phase step binary number stored in the frequency control register (left counter). The result is re-stored in the phase register. The phase step is sometimes called the "tuning word," and it determines the amount added to the current phase and thus controls the frequency. The adders for each bit are in the center (center logic gates). Here's a sample of what happens Phase register Freq. Register 00000000. 100. Add 4 00000100. 100. Add 4 00001000. 100. Add 4 00001100. 100. Add 4 00010000. 101. Add 5 00010101. 101. Add 5 00011010. 101. Etc.... Do you see how the phase increases faster when it's added by a larger phase step? This skip counting action is how the frequency goes higher or lower. These digital numbers can represent address (like on a look-up table (LUT) for DDS), or they can be displayed on 7-segment displays, or sent directly to a DAC for a variable sawtooth wave signal (which is what I did). That's a lot of info! Comment below with questions...
published 2 years ago
roops1967
1 year ago
Thanks ๐Ÿ™ this is wonderful stuff! DSP's had been a exotic mystery to me, never had the chance to touch, so any info and circuits like this is greatly appreciated. We don't hear much about them anymore, is that because they've been absorbed into modern CPU's? You've had a lot of experience working with them?
592azy2circuitdude
1 year ago
Perhaps I will explore this topic some more. I'm more of a freelancer when it comes to electronics, so I know something about DSP, but not really a lot of experience. You're correct that most DSP stuff is now handled in software (i.e., CPU). I think the main places DSP circuits are still used are high precision systems, like Function Generators or Digital Radios
roops1967
1 year ago
What I remember reading somewhere DSP runs secondary code for free in parallel with the main code if crafted carefully, very specialised ALU like instructions not general purpose, on streaming data maybe SIMD hardware. This piqued my interest but then were pre-internet days so couldn't get hold of anymore info, but now you've triggered that interest again ๐Ÿ˜€ so thanks! I'm like you but with less experience than you by the sound of it

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy