50 %
50 %
Information about LOGIC DESIGN

Published on March 6, 2009

Author: ankush85

Source: authorstream.com

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

Add a comment

Related presentations

Related pages

Logic Design

Welcome. Logic Design Inc. (LDI) provides fully integrated technical learning solutions ranging from electronics to robotics, utilizing simulation software ...
Read more

Logic synthesis - Wikipedia, the free encyclopedia

History of logic synthesis. The roots of logic synthesis can be traced to the treatment of logic by George Boole (1815 to 1864), in what is now termed ...
Read more

Category:Logic design - Wikipedia, the free encyclopedia

Pages in category "Logic design" The following 7 pages are in this category, out of 7 total. This list may not reflect recent changes . ...
Read more

Logic Designs Digital Agency - Web Design and Development ...

best web design and development company in Egypt, e Marketing, Mobile Application for all OS , eCommerce, Web hosting, Domain names
Read more

Logic Design Inc. » Company

Company Press Releases | Career Opportunities. Founded in 1996, Logic Design Inc. (LDI) is a privately-held corporation headquartered in Toronto, Canada.
Read more

Logic Design | Agence de design global spécialisée dans ...

Logic design drew upon the source of Vittel to create a new brand and packaging design, based on the theme of vitality. The essence of the brand expresses ...
Read more

Patrick Funke: Webdesign und Grafikdesign aus Garching

Design is not just what it looks like and feels like. Design is how it works. - Steve Jobs. Bei der Gestaltung einer neuen Webseite geht es nicht nur darum ...
Read more


fpga-logic-design.....ist ein Ingenieurbüro, welches sich schwerpunktmässig mit Auftragsentwicklungen rund um die Themen FPGA, DSP und ...
Read more

logic design | computer technology | Britannica.com

Logic design, logic circuit Encyclopædia Britannica, Inc. Basic organization of the circuitry of a digital computer. All digital computers are based on a ...
Read more

Digital Logic Design - Computer Architecture Research ...

A.F. Kana Digital Logic Design. Page 2 Data Representation and Number system Numeric systems
Read more