

|
This article is about the term counter used in electronics and computing. For other meanings of counter, see counter (disambiguation)
In general, a counter is a device which stores (and sometimes displays) the number of times a particular event or process has occurred often in relationship to a clock signal. In practice, there are two types of counters:
Contents |
In electronics, counters can be implemented quite easily using register-type circuits such as the flip-flop, and a wide variety of designs exist, e.g:
Each is useful for different applications. Usually, counter circuits are digital in nature, and count in binary, or sometimes binary coded decimal. Many types of counter circuit are available as digital building blocks, for example a number of chips in the 4000 series implement different counters.
The simplest counter circuit is a single D-type flip flop, with its D (data) input fed from its own inverted output. This circuit can store one bit, and hence can count from zero to one before it overflows. By cascading a series of D-type flip flops, a ripple counter is formed, which can count to 2n-1 where n is the number of bits (flip flop stages) in the counter. Ripple counters suffer from unstable outputs as the overflows "ripple" from stage to stage, but they do find frequent application as dividers for clock signals, where the instantaneous count is unimportant, but the division ratio overall is. (To clarify this, a 1-bit counter is exactly equivalent to a divide by two circuit - the output frequency is exactly half that of the input when fed with a regular train of clock pulses).
Where a stable count value is important across several bits, which is the case in most counter systems, synchronous counters are used. These also use flip-flops, either the D-type or the more complex J-K type, but here, each stage is clocked simultaneously by a common clock signal. Logic gates between each stage of the circuit control data flow from stage to stage so that the desired count behaviour is realised. Synchronous counters can be designed to count up or down, or both according to a direction input, and may be presettable via a set of parallel "jam" inputs. Most types of hardware-based counter are of this type.
Decade counters are a kind of counter that counts in tens rather than having a binary representation. Each output will go high in turn, starting over after ten outputs have occurred. This type of circuit finds applications in multiplexers and demultiplexers, or wherever a scanning type of behaviour is useful. Similar counters with different numbers of outputs are also common.
A Johnson counter is a special case of shift register, where the output from the last stage is inverted and fed back as input to the first stage. A pattern of bits equal in length to the shift register thus circulates indefinitely. These counters are sometimes called "walking ring" counters, and find specialist applications, including those similar to the decade counter, digital to analogue conversion, etc.
See also: Frequency counter
In computability theory, a counter is considered a type of memory. A counter stores a single natural number (initially zero) and can be arbitrarily-many digits long. A counter is usually considered in conjunction with a finite state machine (FSM), which can perform the following operations on the counter:
The following machines are listed in order of power, with each one being strictly more powerful than the one below it:
For the first and last, it doesn't matter whether the FSM is deterministic or non-deterministic (see determinism). They have equivalent power. The first two and the last one are levels of the Chomsky hierarchy.
The first machine, an FSM plus two counters, is equivalent in power to a Turing machine. This equivalence can be shown in three steps. First, a Turing machine can be simulated by two stacks. Then, a stack can be simulated by two counters. Finally, four counters can be simulated by two counters.
A Turing machine consists of an FSM and an infinite tape, initially filled with zeros, upon which the machine can write ones and zeros. At any time, the read/write head of the machine points to one cell on the tape. This tape can be conceptually cut in half at that point. Each half of the tape can be treated as a stack, where the top is the cell nearest the read/write head, and the bottom is some distance away from the head, with all zeros on the tape beyond the bottom. Accordingly, a Turing machine can be simulated by an FSM plus two stacks. Moving the head left or right is equivalent to popping a bit from one stack and pushing it onto the other. Writing is equivalent to changing the bit before pushing it.
A stack containing zeros and ones can be simulated by two counters, when the bits on the stack are thought of as representing a binary number, with the top being the least significant bit. Pushing a zero onto the stack is equivalent to doubling the number. Pushing a one is equivalent to doubling and adding 1. Popping is equivalent to dividing by 2, where the remainder is the bit that was popped. Two counters can simulate this stack, in which one of the counters holds a number whose binary representation represents the bits on the stack, and the other counter is used as a scratchpad. To double the number in the first counter, the FSM can initialize the second counter to zero, then repeatedly decrement the first counter once and increment the second counter twice. This continues until the first counter reaches zero. At that point, the second counter will hold the doubled number. Halving is performed by decrementing one counter twice and increment the other once, and repeating until the first counter reaches zero. The remainder can be determined by whether it reached zero after an even or an odd number of tries.
As before, one of the counters is used as scratchpad. The other, real counter holds an integer whose prime factorization is 2a3b5c7d. The exponents a, b, c, and d can be thought of as four virtual counters that are being simulated. If the real counter is set to zero then incremented once, that is equivalent to setting all the virtual counters to zero. If the real counter is doubled, that is equivalent to incrementing a, and if it's halved, that's equivalent to decrementing a. By a similar procedure, it can be multiplied or divided by 3, which is equivalent to incrementing or decrementing b. Similarly, c and d can be incremented or decremented. To check if a virtual counter such as c is equal to zero, just divide the real counter by 5, see what the remainder is, then multiply by 5 and add back the remainder. That leaves the real counter unchanged. The remainder will have been nonzero if and only if c was zero.
As a result, an FSM with two counters can simulate four counters, which are in turn simulating two stacks, which are simulating a Turing machine. Therefore, an FSM plus two counters is at least as powerful as a Turing machine. A Turing machine can easily simulate an FSM with two counters, therefore the two machines have equivalent power.
Tracker is the generic term for a class of software music sequencers which, in their purest form, allow the user to arrange sound samples stepwise on a timeline across several monophonic channels. A tracker's interface is primarily numeric; notes are entered via the keyboard, while length, parameters, effects and so forth are entered in hexadecimal. A complete song consists of several small multi-channel patterns chained together via a master list.
Contents |
The term tracker derives from Ultimate Soundtracker, the first of its type, written by Karsten Obarski and released in 1987 for the Commodore Amiga, although the general concept of step-sequencing samples numerically can be traced back to the Fairlight CMI sampling workstation of the late 1970s, and it is interesting to compare the work of The Art of Noise or the Pet Shop Boys with early tracker music. A tracker song, when saved to disk, typically incorporates all the sequencing data plus samples, and thus during the format's heyday it became almost a sport to create long, complex .mod (or .sng) files which were nonetheless smaller than 880 kB. Typically the composer would incorporate his or her assumed name into the list of samples.
Curiously, most early tracker musicians appeared to be from the UK and the Nordic nations, probably because the tracker was heavily related to the Demo scene, which grew rapidly in Scandinavian countries. For example, one of the most influential PC trackers, ScreamTracker was originally developed by Future Crew for use in their own demos.
The edit window of a tracker resembles a player piano scroll, moving from the bottom of the screen upwards. The first trackers allowed for only four channels of 8-bit music, although as the notes were samples this limitation was less important than those of synthesising music chips, such as Commodore's SID or General Instrument's venerable AY-3-8912 and Yamaha's compatible YM2149, as the user could sample chords, for example, and play them back on a single channel, a process which became a cliche in early pop-rave chart tunes; rapid chordal stabs, often of fifths, were the hallmark of Altern-8 and other transient techno phenomena. Later tracker software, most famously OctaMED, allowed for eight channels of music or more, whilst special hardware could allow for 16-bit playback.
Karsten Obarski's original Ultimate Soundtracker, often just called Soundtracker, was originally an internal development tool for EAS (a German Software Company) which goes some way towards explaining its programmer-friendly interface. The company eventually released it as a commercial product. Soundtracker itself was never a very big success, as it was technically very limited and user-unfriendly, but soon illegally cracked and improved versions such as MasterSoundtracker, ProTracker and NoiseTracker became extremely popular. The machines on which tracker software ran were not expensive, particularly in the UK and some other European countries, where the Amiga and Atari ST were the default home computer choice during the six or so years spanning the dawn of the 1990s. Thus, tracker music became something of an underground punk phenomenon, especially as so much contemporary chart music was then sample-based dance music, a genre which was relatively simple to produce with step-based sequencing. Tracker music was a fantastic training ground for a generation of electronic dance musicians, many of whom saved up for an Akai sampler, a multi-effects unit, a mixer and a microphone, thence to storm the charts.
There was a downside to all this, however, in that 'tracker music' became something of a term of derision for stereotypically ravey, computer-game-style pop tunes, whilst the difficulty involved in adding 'swing' to a mechanistic sequencing style resulted in much 4/4 music based around strict four-bar sections, often using similar samples (being instrumental, tuneful tracker music required distinctive lead voices, of which chimes, pitch-bent guitar tones and rave piano were overused).
Over the 1990s, tracker musicians gravitated to the PC. Tracker music lives today. Computer games still use it, notably the Unreal series and its descendants such as Deus Ex. However, the easy availability of software samplers and sequencers, and the advent of the MP3 format has caused most professional musicians to adopt other music software. Nonetheless, tracker software still exists and, in some cases, is still being developed as of 2005. The original Tracker series (Sound/Noise/Pro Tracker) started on the Amiga still lives on the PC with ProTracker version 5 under development since 2004. Buzz, ModPlug Tracker, MadTracker, Renoise, Skale, CheeseTracker, BeRoTracker and others offer features undreamed-of back in the day (hi-quality output, automation, VST support, internal DSP's and multi-effects, multi I/O cards support etc.). Tracker files have also become popular in the Game Boy Advance community; unlike the original Game Boy, the Game Boy Advance has the processing power to support tracker music, and the quality is vastly superior to the built-in tone generators, while still taking up little space compared to MP3s or other forms of higher-quality audio.