

This add block will add up the previous value of the counter to the constant block placed previously to complete one iteration.For the time being select the add block from the math operation section of library browser as shown in the figure below, From this section we need an add blocks and the purpose of that blocks is also described.From the library browser select the math operation section as shown in the figure below, In order to design an algebraic loop for the implementation of the up counter we need an add block which will add 1 to the previous value after each iteration of the loop. If o set it to 2 the counter will change its value in steps of 2 as you will see shortly, once the model of the up counter is complete.


This block will be used as the size of the step of the counter i.e.From the library browser click on the commonly used blocks section as we have been doing in previous tutorials and then select the constant block from that section as shown in the figure below, In Simulink click on the library browser icon and open library browser as we have been doing in previous tutorials. I will now perform here a simple example which will help you understand the working of loops in simulink. Lets’ now move towards the programing part. In other programming languages the loops are named as for loop and while loop and at this stage of programming I assume that you are familiar with these loops.Įxplanation with a program: Designing an up counter with Simulink In order to make the loop error free we must provide a condition which will decide whether the loop will be continued or stopped. In Simulink there is no proper block to implement loops, however we can design our own loop in which the output is fed to the input with the delay in between to remove any ambiguity. At the end I gave a simple exercise to perform it on your own, this will help you strengthen your concepts regarding algebraic loops in Simulink.Īlgebraic loops mean to perform a certain task iteratively up to a certain number of times or un till a specific condition is fulfilled. A counters named as up counter is implemented on Simulink and its outputs is displayed. After simple implementation loops are implemented using examples of counter. After that loops are implemented on Simulink’s platform and their working is explained step by step. At the beginning you are provided with a brief introduction of loops, and where we can use them also a basic introduction of loops in other programming languages and their working principles. In this tutorial, I will explain you the working of conditional loops and how to implement them using Simulink.
