8.1 Using the Program Description Language and Flowcharts

Program description language (PDL) is free-format English-like text, which describes the flow of control and data in a program. PDL is not a programming language, but a collection of keywords that enable a programmer to describe the operation of a program in a stepwise and logical manner. In this section we will look at the basic PDL statements and their flowchart equivalents. The superiority of the PDL over flowcharts will become obvious when we have to develop medium to large programs.

8.1.1 BEGIN – END

Every PDL program description should start with a BEGIN and end with an END statement. The keywords in a PDL description should be highlighted to make the reading easier. The program statements should be indented and described between the PDL keywords. An example is shown in Figure 8.1, together with the equivalent flow diagram.

Figure 8.1 BEGIN – END statement and equivalent flowchart

img

8.1.2 Sequencing

For normal sequencing, the program statements should be written in English text and describe the operations performed. An example is shown in Figure 8.2, together with the equivalent flowchart.

Figure 8.2 Sequencing and equivalent flowchart

img

8.1.3 IF – THEN – ELSE – ENDIF

The IF, THEN, ELSE and ENDIF should be used to conditionally ...

Get Using LEDs, LCDs and GLCDs in Microcontroller Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.