|
|
| File Information |
| Description |
(Developed using R2007b)
Timers and counters are essential elements in hardware design. A timer can be used to measure elapsed time and a counter is used to count number of external events in hardware circuits.
This demo shows how to build timers and counters in Embedded MATLAB. The attached model contains implementations of the following counters.
Gray Counter
Johnson Counter
Mod-N Counter
Up Down Counter (With enable)
Preset Clear Counter
Call Count Detector
Gray Counter:
Gray code is a binary numeral system where two successive values differ in only one digit. Gray codes are widely used to facilitate error correction in digital communications such as digital terrestrial television and some cable TV systems. A 4bit gray code counter has the following binary sequence as its output.
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000
Johnson Counter:
A ring counter is a type of counter composed of a circular shift register.
The output of the last shift register is fed to the input of the first register.
A Johnson counter is also called as a walking ring counter wherein the output of the last shift register is inverted and fed back to the input of first shift register. A 4bit johnson counter has the following binary sequence as its output.
0000
0001
0011
0111
1111
1110
1100
1000
0000
Modulo N Counter:
The total number of stable states a counter has indicates its MODULUS. A Mod3 counter has the following binary sequence as its output.
000
001
010
011
100
101
110
111 |
| Required Products |
Simulink
Fixed-Point Toolbox
|
| MATLAB release |
MATLAB 7.4 (R2007a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (1) |
| 20 Jul 2008 |
murali raju
|
|
|
| Updates |
| 10 Sep 2007 |
minor edits to description |
| 14 Aug 2008 |
add to eML category |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com