Ingeniería eléctrica
Utilice System Modeler para construir y estudiar circuitos eléctricos, electrónica de potencia y maquinaria eléctrica. Combine componentes eléctricos y mecánicos para crear modelos de sistemas completos. Realice tareas de análisis y mida el rendimiento.
Binary Counter
Counters are used in a variety of digital applications as a way of counting events. In this example, we have constructed a simple 4-bit asynchronous up-counter using the Digital library, which is a part of the Modelica Standard Library.
Para ejecutar este ejemplo necesitará
Las versiones más recientes de System Modeler y Mathematica.
Por favor haga una selección:
Obtener unaprueba gratuita Continuar
con la descarga
Counter Model
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. The model in this example consists of a 4-bit asynchronous up-counter that is fed with a clock pulse of 1 Hz. Below, you can see a diagram of the model.
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. The JK flip-flop is considered to be the most universal flip-flop design and can be used as different kinds of flip-flops just by adjusting how the input to the J and K terminals is done. In this example, the flip-flops are used with a toggling function, which means that the output is changed for each completed clock cycle. This is accomplished by feeding ones into both the J and K pins of the flip-flops. By putting only zeros on all the J and K terminals, the output will never change, regardless of the input. This makes it suitable to connect all the J and K terminals as an enable signal for the circuit.
The counter in this example is a 4-bit asynchronous counter based on JK flip-flops. The flip-flops are connected with both their J and K terminals to the enable pin, putting them in "toggle mode". The flip-flop to the left, producing the Q0 signal, will change its output state for each falling edge of the clock signal, for example, a CPU clock. Since the output toggles for each falling edge of the clock, the clock toggles twice for each toggle of the output.
Wolfram System Modeler
Probar
Comprar
System Modeler está disponible en inglés
y japonés
para Windows, macOS y Linux »
¿Preguntas? ¿Comentarios? Contacte a un experto de Wolfram »