Message Boards Message Boards

Binary Counter: new downloadable SystemModeler example

A new SystemModeler example has been added to the list of downloadable models available on the SystemModeler site, Binary Counter.

Counters can be used for a huge array of applications. They can, for example, be used to count pulses from a sensor attached to a wheel to count the number of revolutions, which in turn can be used to calculate the speed of the wheel. Counters also can be used as digital clocks for different purposes. Another typical use of a digital counter is in central processing units (CPUs), where a certain kind of counter (program counters, or PCs) is used as a way for the CPU to walk through program instructions, one by one, from a memory.

Flip-flops or latches are used as basic components in digital circuitry and work as a kind of memory that stores the state of one bit. By using multiple flip-flops, it is possible to construct digital state machines. A binary counter is basically a state machine that just cycles through its states for each cycle of a clock signal. A diagram of the counter component can be seen below.

Diagram view of the counter

The example utilizes a new feature in SystemModeler 4.3. Enumeration types, such as the logic levels in digital circuitry are now plotted using their discrete levels on the y-axis. This is apparent when plotting the internal states of the counter, for example:

Digital levels

This of course not limited to built-in enumerations. The following custom enumeration type:

Modelica code

Could look like this, when plotted in Simulation Center:

Temperature levels

For more information on what is new in SystemModeler 4.3, check out the What's New page.

POSTED BY: Patrik Ekenberg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract