LOGIC DESIGN

Information about LOGIC DESIGN

Published on March 6, 2009

Author: ankush85

Source: authorstream.com

Content

LOGIC DESIGN : LOGIC DESIGN 3. ALGORITHM : 3. ALGORITHM To write the logic and method(s) to solve the problem in the procedural steps is called Algorithm. Algorithm in a step by step procedure to solve a given problem. Important characteristics of algorithms :- i. Algorithm are well defined. ii. Algorithm produce a result. iii. Algorithm halt in a finite amount of time. Slide 3: Advantages of Algorithms : i) Algorithms are independent of any computer language. ii) Algorithms are easy iii) To debug, since every step has got its own logical sequence. iv) Algorithms can be easily converted into flowcharts and then into computer programs. Slide 4: Example : To give 5 grace marks in a paper Steps : Record NAME,ROLL NUMBER, MARKS Add 5 to MARKS AND ASSIGN TO NEW- MARKS (NEW-MARKS = MARKS+5) Display NAME,ROLL NUMBER, MARKS, NEW-MARKS Stop FLOW CHARTS : FLOW CHARTS A program flowchart pictures the sequence of instructions for solving a particular problem. It gives a pictorial representation of data processing procedure. Slide 6: Advantages of Program flowchart :- i) It is usually much easier to draw a flowchart of a problem and then to write program directly. Flow-charts are an important aid in the development of the algorithm itself. Easier to understand than a program itself. Independent of any particular programming languages. It saves the time in writing the program. It saves the computer times also. Slide 8: Example – 1 : To compute the average of three numbers. Algorithm : 1. INPUT A, B, C 2. D = (A+B+C) / 3 3. OUTPUT D 4. STOP Flow-Chart : : Flow-Chart : START INPUT A,B,C D = (A+B+C)/3 OUTPUT D STOP Example - 2 : Example - 2 To find the biggest of the two numbers Algorithm : INPUT A,B IF A > B THEN OUTPUT A ELSE OUTPUT B 3. STOP Flow-chart : Flow-chart YES NO START INPUT A,B OUTPUT - A OUTPUT - B A>B STOP Example – 3 Flow-chart – (A) : Example – 3 Flow-chart – (A) Flow-chart (B) : Flow-chart (B) START Slide 14: Example – 4 BONUS – Calculation : BONUS= 8% of SALARY Employees SALARY is given Algorithm :- Procedural Steps Step 1 :- Obtain employee’s SALARY  Step 2 :- Calculate BONUS = 8% * SALARY  Step 3 :- Record SALARY, BONUS  Step 4 :- STOP Slide 16: Example – 5 : BONUS = 8% of SALARY If YEAR ? 10, additional BONUS Rs. 50/- Algorithm :- Step 1 :- SALARY, YEAR Step 2 :- Calculate BONUS BONUS = 0.08 * SALARY Step 3 :- Check YEAR If YEAR ? 10 then BONUS = BONUS + 50 Step 4 :- OUTPUT SALARY, YEAR, BONUS Step 5 :- STOP Flow-chart : Flow-chart Slide 18: Example – 6 : If SALARY ? 10,000 then BONUS = 8 % of SALARY else BONUS = 300 Flow-chart : Flow-chart Slide 20: Example – 7 : SUM = 1+2+3+……… +20 Algorithm :- SUM = 0 K = 1 IF K > 20 THEN GO TO STEP 7 SUM = SUM + K K = K+1 GOTO STEP 3 OUTPUT SUM STOP Flow-chart : Flow-chart Example – 8 : Sum of odd numbers up-to NS1 = 1+3+5+7+ ……… + N Flow-chart : Example – 8 : Sum of odd numbers up-to NS1 = 1+3+5+7+ ……… + N Flow-chart Example – 9 : To find the largest among the give 100 numbersA(1), A(2), A(3) ……………………… A(100) Flow-Chart : Example – 9 : To find the largest among the give 100 numbersA(1), A(2), A(3) ……………………… A(100) Flow-Chart Example – 10 : Control by Trailer Record Flow-Chart : Example – 10 : Control by Trailer Record Flow-Chart Example – 11 : End of File. Flow-Chart : Example – 11 : End of File. Flow-Chart Example – 12 : By Tailor Record Flow-Chart : Example – 12 : By Tailor Record Flow-Chart Slide 27: Pseudo Codes :- It is combination of English phrases and programming constructs such as LET READ / WRITE IF – THEN – ELSE ETC. Slide 28: Pseudo Code specifics the steps required to accomplish task. The main purpose of a Pseudo Code is to define the procedural logic of a algorithm in a simple, easy – to –understand manner. The main advantage of Pseudo Code is that, because it is very English-like. You can share it with the non-programming user. Once you have understanding the purpose of the routine stated Pseudo Code, translating the Pseudo Code into actual program code is pretty simple. Slide 29: Examples – 1 IF SIDE A = SIDE B THEN SQUARE ELSE RECTANGLE Slide 30: Example – 2 BEGIN READ NUMBER1, NUMBER2 SUM = NUMBER1 + NUMBER2 WRITE SUM STOP END Decision Tables : Decision Tables Decision tables are a precise, yet compact way to model complicated logic. Decision tables, like if-then-else and switch-case statements, associate conditions with actions to perform. But unlike the control structures found in traditional programming languages, decision tables can associate many independent conditions with several actions in an elegant way. Decision tables are typically divided into four quadrants, as given below : Slide 32: Condition Stub : Which comprehensively lists the conditions. Action Stub : Which lists the action to be taken along the various program branches. Condition entries : Which lists in its various columns the possible permutations of answer to the questions in condition stub. Action entries : Which lists, it its columns corresponding to the condition entries the action contingent upon the set of answers to the questions of that columns. Slide 33: Example – A computer file has : Customer Name Type I & II Bill Number Bill Date Amount Date of payment Slide 34: Customer Type Type – I Type – II Payment < 30 days 10% Discount 12 ½ % Discount ? 30 and < 45 days 0% Discount 0% Discount and and Surcharge Surcharge 3. ? 45 days 10% Surcharge 12 ½ % Surcharge Decision Table : Decision Table Slide 36: THANKS

Related presentations


Other presentations created by ankush85

Nanotechnology
03. 04. 2009
0 views

Nanotechnology

Human Resource Management System
06. 03. 2009
0 views

Human Resource Management System

Nanotechnology
27. 03. 2009
0 views

Nanotechnology

INTRODUCTION TO NANOTECHNOLOGY
20. 11. 2009
0 views

INTRODUCTION TO NANOTECHNOLOGY

Nanotechnology in Sports
22. 11. 2009
0 views

Nanotechnology in Sports

Computer Architecture
14. 07. 2009
0 views

Computer Architecture

HR
18. 03. 2009
0 views

HR

Hospital Management System
08. 04. 2009
0 views

Hospital Management System

Welcome to Visual Basic
06. 03. 2009
0 views

Welcome to Visual Basic

HTML
20. 04. 2009
0 views

HTML

Computer Languages
03. 06. 2013
0 views

Computer Languages

Taking Care of Computer
03. 06. 2013
0 views

Taking Care of Computer

Understanding Camera
16. 10. 2012
0 views

Understanding Camera

Photography Technical Terms
25. 09. 2012
0 views

Photography Technical Terms

Basics of Photography
25. 09. 2012
0 views

Basics of Photography

AIR MUSCLES
03. 01. 2012
0 views

AIR MUSCLES

Molecular Nanotechnology
24. 11. 2009
0 views

Molecular Nanotechnology

Nanotech Innovation
22. 11. 2009
0 views

Nanotech Innovation

FINANCIAL  MARKET
16. 05. 2009
0 views

FINANCIAL MARKET

Operating System
19. 04. 2009
0 views

Operating System

Management Control
10. 07. 2009
0 views

Management Control

Accounting Principles
01. 07. 2009
0 views

Accounting Principles

Balance Sheet
21. 07. 2009
0 views

Balance Sheet

Balance Sheet Auditing
01. 07. 2009
0 views

Balance Sheet Auditing

BRANCH AND BOUND
05. 03. 2009
0 views

BRANCH AND BOUND

THE  THREE  BRANCHES  OF GOVERNMENT
13. 06. 2009
0 views

THE THREE BRANCHES OF GOVERNMENT

Structure of Atom
11. 05. 2009
0 views

Structure of Atom

Compression Techniques
05. 03. 2009
0 views

Compression Techniques

DYNAMIC PROGRAMMING
06. 03. 2009
0 views

DYNAMIC PROGRAMMING

Quantum Mechanics
25. 08. 2009
0 views

Quantum Mechanics

Marketing Plan
19. 06. 2009
0 views

Marketing Plan

Book Keeping
24. 06. 2009
0 views

Book Keeping

DFDS
02. 10. 2008
0 views

DFDS

Semiconductors
25. 04. 2009
0 views

Semiconductors

Organic  Chemistry
28. 04. 2009
0 views

Organic Chemistry

Atoms Molecules and Ions
17. 06. 2009
0 views

Atoms Molecules and Ions

Covalent Bond
25. 04. 2009
0 views

Covalent Bond

Cost Accounting Standards
25. 06. 2009
0 views

Cost Accounting Standards

Crisis Management
19. 06. 2009
0 views

Crisis Management

Marketing
18. 03. 2009
0 views

Marketing

Business Strategy
27. 04. 2009
0 views

Business Strategy

Time Management
23. 03. 2009
0 views

Time Management

Networking Protocols
23. 05. 2009
0 views

Networking Protocols

Network Layer
23. 05. 2009
0 views

Network Layer

Final Accounts
24. 06. 2009
0 views

Final Accounts

ARTIFICIAL  INTELLIGENCE
03. 04. 2009
0 views

ARTIFICIAL INTELLIGENCE

Play with C
08. 04. 2009
0 views

Play with C

Software Development Cycle
23. 03. 2009
0 views

Software Development Cycle

THE GREEDY METHOD
06. 03. 2009
0 views

THE GREEDY METHOD

JOB SEQUENCING
06. 03. 2009
0 views

JOB SEQUENCING

Electricity and Magnetism
29. 04. 2009
0 views

Electricity and Magnetism

Optical Fiber
24. 05. 2009
0 views

Optical Fiber

Quality Assurance
06. 03. 2009
0 views

Quality Assurance

Object-oriented Design
11. 04. 2009
0 views

Object-oriented Design

A.R. Rahman
08. 03. 2009
0 views

A.R. Rahman

Hollywood Female Celebrities
13. 03. 2009
0 views

Hollywood Female Celebrities

Flow nets
04. 09. 2009
0 views

Flow nets

Energy and Nanotechnology
22. 11. 2009
0 views

Energy and Nanotechnology

VB-IDE
06. 03. 2009
0 views

VB-IDE

DLF IPL FINAL
25. 05. 2009
0 views

DLF IPL FINAL

MINIMUM SPANNING TREES
06. 03. 2009
0 views

MINIMUM SPANNING TREES

CPU Scheduling
05. 03. 2009
0 views

CPU Scheduling

Virtual Memory
05. 03. 2009
0 views

Virtual Memory

POK
09. 05. 2009
0 views

POK

2D Transformations
05. 03. 2009
0 views

2D Transformations

Greedy Algorithms
05. 03. 2009
0 views

Greedy Algorithms

BACKTRACKING
05. 03. 2009
0 views

BACKTRACKING

DIVIDE And CONQUER
06. 03. 2009
0 views

DIVIDE And CONQUER

ELEMENTARY DATA STRUCTURES
06. 03. 2009
0 views

ELEMENTARY DATA STRUCTURES

JPEG Compression
06. 03. 2009
0 views

JPEG Compression

Mpeg-compression
06. 03. 2009
0 views

Mpeg-compression

NP - HARD
06. 03. 2009
0 views

NP - HARD

TRAVELLING SALESPERSON PROBLEM
06. 03. 2009
0 views

TRAVELLING SALESPERSON PROBLEM

VBA Introduction
06. 03. 2009
0 views

VBA Introduction

Introduction to Java
09. 03. 2009
0 views

Introduction to Java

Java  Basics
09. 03. 2009
0 views

Java Basics

Heuristic Search
13. 03. 2009
0 views

Heuristic Search

HSM
19. 03. 2009
0 views

HSM

Tata's  Nano  Car
25. 03. 2009
0 views

Tata's Nano Car

Air Cranes
08. 04. 2009
0 views

Air Cranes

Newborn Care
10. 04. 2009
0 views

Newborn Care

Photosynthesis Process
10. 04. 2009
0 views

Photosynthesis Process

ActionScript
13. 04. 2009
0 views

ActionScript

Xml
15. 04. 2009
0 views

Xml

Snakes mis use
17. 04. 2009
0 views

Snakes mis use

Php Web Development
21. 04. 2009
0 views

Php Web Development

Cricket Intro
21. 04. 2009
0 views

Cricket Intro

Cricket Umpiring and Rules
21. 04. 2009
0 views

Cricket Umpiring and Rules

Arm and Forearm
23. 04. 2009
0 views

Arm and Forearm

Elements Ions Isotopes
25. 04. 2009
0 views

Elements Ions Isotopes

Chemical Bond
25. 04. 2009
0 views

Chemical Bond

Discovering Newtons Laws
29. 04. 2009
0 views

Discovering Newtons Laws

FreeFall
29. 04. 2009
0 views

FreeFall

Digital photography
26. 04. 2009
0 views

Digital photography

Health Effects of Alcohol
26. 04. 2009
0 views

Health Effects of Alcohol

Poetry Terminology
27. 04. 2009
0 views

Poetry Terminology

Indian Force
05. 05. 2009
0 views

Indian Force

Machine Intelligence
14. 05. 2009
0 views

Machine Intelligence

Data Link Layer
16. 05. 2009
0 views

Data Link Layer

Database Development Cycle
15. 05. 2009
0 views

Database Development Cycle

Queue
15. 05. 2009
0 views

Queue

Presentaion Skills
23. 04. 2009
0 views

Presentaion Skills

Network Layers
23. 05. 2009
0 views

Network Layers

Narmada Dam, India
23. 05. 2009
0 views

Narmada Dam, India

User Datagram Protocol
24. 05. 2009
0 views

User Datagram Protocol

Linear Momentum
28. 05. 2009
0 views

Linear Momentum

Stack and Queue
04. 06. 2009
0 views

Stack and Queue

Information Management
19. 06. 2009
0 views

Information Management

Role of Senior Management
19. 06. 2009
0 views

Role of Senior Management

Wake Up India
07. 06. 2009
0 views

Wake Up India

Adobe Flex 3.0
13. 06. 2009
0 views

Adobe Flex 3.0

Adobe Flex Presentation
13. 06. 2009
0 views

Adobe Flex Presentation

Introduction to Adobe Flex
13. 06. 2009
0 views

Introduction to Adobe Flex

Adobe Flash Media Server
13. 06. 2009
0 views

Adobe Flash Media Server

Dreamweaver
13. 06. 2009
0 views

Dreamweaver

Adobe Flash
13. 06. 2009
0 views

Adobe Flash

Flash CS4 Professional
13. 06. 2009
0 views

Flash CS4 Professional

Adobe Flash Lite
13. 06. 2009
0 views

Adobe Flash Lite

Digital Camera
13. 06. 2009
0 views

Digital Camera

Mozilla_Firefox
15. 06. 2009
0 views

Mozilla_Firefox

Managerial Accounting
27. 06. 2009
0 views

Managerial Accounting

Accounting  Information  System
01. 07. 2009
0 views

Accounting Information System

RETAILING AND MARKETING
06. 07. 2009
0 views

RETAILING AND MARKETING

ACCOUNTING IN BUSINESS
05. 07. 2009
0 views

ACCOUNTING IN BUSINESS

STRATEGIC RETAIL MANAGEMENT
05. 07. 2009
0 views

STRATEGIC RETAIL MANAGEMENT

Reiki
01. 08. 2009
0 views

Reiki

Using Buttons in PowerPoint
26. 04. 2009
0 views

Using Buttons in PowerPoint

Nanotechnology  for  Students
21. 08. 2009
0 views

Nanotechnology for Students

NANOSCIENCE
25. 08. 2009
0 views

NANOSCIENCE

Fundamentals of Nanoscience
27. 08. 2009
0 views

Fundamentals of Nanoscience

Nanoscience in Nature
27. 08. 2009
0 views

Nanoscience in Nature

Applied Mechanics
04. 09. 2009
0 views

Applied Mechanics

Accounts Payable Training
27. 06. 2009
0 views

Accounts Payable Training