PLD Unit 1.1
PLD Unit 1.1
Credit: 02
Course Objectives:
Course Outcomes
Perquisite : Nil
Understanding the Computer System
Computer systems
Software Hardware
System Application
Software Software
Understanding the Computer System
Assembly Language
Assembler Object Code (LLL)
Code (HLL)
Understanding the Computer System
problem Solving
If any of these six steps are not completed well, the results may be less than desired.
Types of problems
1. .
2. Plan the logic.
1. Success of any program depends on this step
2. Plan of what steps to include and how to order them
3. Flowcharts and pseudocode
4. No concern for syntax of any language
5. Figuring out what sequence of events will lead from the available input to the
desired output.
6. Process of walking through a program’s logic on paper (Hand Run)
Understanding the Program Development Cycle
1. .
2. .
3. Code the program.
1. Write the source code for a program
2. Choice of programming language
3. Syntax of a language
Understanding the Program Development Cycle
1. .
2. .
3. .
4. Use software (a compiler or interpreter) to translate the program into machine
language.
1. .
2. .
3. .
4. .
5. Test the program.
6. 1. A program that is free of syntax errors is not necessarily free of logical errors.
(2*a)
1. .
2. .
3. .
4. .
5. .
6. Put the program into production.
7. Maintain the program: Changes as and when needed in the program
Planning a Program
1. Pseudo-Code
• Pseudocode is an English-like representation of the logical steps it takes to
solve a problem.
• Pseudo is a prefix that means false
• To code a program means to put it in a programming language
• Pseudocode simply means false code, or sentences that appear to have
been written in a computer programming language but do not necessarily
follow all the syntax rules of any specific language.
Pseudocode Standards
• Programs begin with start and end with stop; these two words are always
aligned.
• Whenever a module name is used, it is followed by a set of parentheses.
• Modules begin with the module name and end with return. The module name
and return are always aligned.
• Each program statement performs one action—for example, input, processing,
or output.
• Program statements are indented a few spaces more than start or the module
name.
• Each program statement appears on a single line if possible. When this is not
possible, continuation lines are indented.
• Program statements begin with lowercase letters.
• No punctuation is used to end statements.
Flowcharts
• Game problem: Mad Libs is a children’s game in which players provide a few
words that are then incorporated into a silly story. The game helps children
understand different parts of speech because they are asked to provide specific
types of words. For example, you might ask a child for a noun, another noun, an
adjective, and a past-tense verb. The child might reply with such answers as table,
book, silly, and studied. The newly created Mad Lib might be:
Mary had a little table
Its book was silly as snow
And everywhere that Mary studied
The table was sure to go.
Create the logic for a Mad Lib program that accepts five words from input, then
creates and displays a short story or nursery rhyme that uses them.
Understanding User Environments
• Game problem: Mad Libs is a children’s game in which players provide a few
words that are then incorporated into a silly story. The game helps children
understand different parts of speech because they are asked to provide specific
types of words.
Inputs are : a noun, another noun, an adjective, and a past-tense verb.
The child might reply with such answers as table, book, silly, and studied.
The newly created Mad Lib might be: