1 / 32

Computer Programming Skills Revision Prepared by: Ghader Kurdi

Computer Programming Skills Revision Prepared by: Ghader Kurdi. Chapter 1 Number Systems. Contents. Number Systems Conversion Among Bases Binary Addition and Multiplication. Number Systems. Conversion Among Bases. Conversion Among Bases.

cayla
Télécharger la présentation

Computer Programming Skills Revision Prepared by: Ghader Kurdi

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Programming Skills Revision Prepared by: Ghader Kurdi

  2. Chapter 1Number Systems

  3. Contents • Number Systems • Conversion Among Bases • Binary Addition and Multiplication

  4. Number Systems

  5. Conversion Among Bases

  6. Conversion Among Bases • Divide the number by base and write the remainders. • Continue downwards, dividing each new quotient by base and writing the remainders. • Stop when the quotient is 0.

  7. Conversion Among Bases • Start at the right • Break the binary numeral into groups of three digits • Replace each 3-digits binary numeral with it’s 1-digit octal equivalent • Replace each octal digit with it’s 3-digits binary equivalent • Combine all binary equivalent into a single binary numeral. Binary Binary Octal Octal

  8. Conversion Among Bases • Start at the right • Break the binary numeral into groups of four digits • Replace each 4-digits binary numeral with it’s 1-digit hexadecimal equivalent • Replace each hexadecimal digit with it’s 4-digits binary equivalent • Combine all binary equivalent into a single binary numeral. Binary Binary hexadecimal hexadecimal

  9. Conversion Among Bases

  10. Binary Addition and Multiplication Binary addition To add 3 or more numbers: • Add the first two numbers. • Then, add the third number to the result and so on. Examples

  11. Binary Addition and Multiplication Binary Multiplication To multiply 3 or more numbers: • Multiply the first two numbers. • Then, multiply the result by the third number and so on. Example

  12. Chapter 2Digital Logic Design

  13. Digital Logic Design • Logic gates • Logic Functions • Derivation of logical expressions • sum-of-products (SOP) form • product-of-sums (POS) form • Logical Equivalence • Truth table method • Algebraic manipulation method • Logical Expression Simplification • Boolean Algebra • Karnaugh Map Method

  14. Logic gates • Logic gates • AND • OR • NOT • NAND • NOR • XOR • Precedence (NOT > AND > OR) • You must know: • The function and truth table of each gate • The graphical representation of each gate • The logical representation of each gate

  15. Logic Functions • Logical functions can be expressed in several ways: • Truth table • Logical expressions • Graphical form • You must know how to: • Use a graphical representation to derive a logical expression. • Use a graphical representation to derive a truth table. • Use a logical expression to derive a graphical representation. • Use a logical expression to derive a truth table. • Use a truth tables to derive a logical expression (SOP & POS)

  16. Derivation of logical expressions • An SOP expression  when two or more product terms are summed by Boolean addition. • In an SOP form, a single overbar cannot extend over more than one variable • Example • But not • An POS expression  When two or more sum terms are multiplied by Boolean multiplication. • In a POS form, a single overbar cannot extend over more than one variable • Example • But not

  17. Derivation of logical expressions To determine the SOP expression represented by a truth table. • Instructions: • Step 1: List the binary values of the input variables for which the output is 1. • Step 2: Convert each binary value to the corresponding product term by replacing: • each 1 with the corresponding variable, and • each 0 with the corresponding variable complement. • Example: 1010  To determine the POS expressionrepresented by a truth table. • Instructions: • Step 1: List the binary values of the input variables for which the output is 0. • Step 2: Convert each binary value to the corresponding product term by replacing: • each 1 with the corresponding variable complement, and • each 0 with the corresponding variable. • Example: 1001 

  18. Derivation of logical expressions from a Truth Table (example) • There are four 1s in the output and the corresponding binary value are 011, 100, 110, and 111. • There are four 0s in the output and the corresponding binary value are 000, 001, 010, and 101. POS SOP

  19. Converting SOP and POS Expressions to Truth Table Format • Recall the fact: • An SOP expression corresponds to 1 output. • Constructing a truth table: • Step 1: List all possible combinations of binary values of the variables in the expression. • Step 2:Place a 1 in the output column (X) for each binary value that makes the SOPexpression a 1 and place 0 for all the remaining binary values. • Recall the fact: • A POS expression correspondsto 0 output. • Constructing a truth table: • Step 1: List all possible combinations of binary values of the variables in the expression. • Step 2:Place a 0 in the output column (X) for each binary value that makes the POSexpression a 0 and place 1 for all the remaining binary values.

  20. Converting SOP Expressions to Truth Table Format (example) • Develop a truth table for the standard SOP expression

  21. Converting POS Expressions to Truth Table Format (example) • Develop a truth table for the standard SOP expression

  22. Implementation of SOP & POS • Implementation of an SOP • Implementation of a POS A A B B A A X B B A A B B

  23. Logical Equivalence • Truth table method • Derive the logical expression • Derive truth tables for each expression. • If both expressions yield the same output, they are equivalent. Otherwise, they are not. • Algebraic manipulation method • Derive the logical expressions • Simplify each expression using boolean laws. • If both expressions yield the same simplified expression, they are equivalent. Otherwise, they are not.

  24. Logical Expression Simplification Boolean Algebra • Need boolean identities (Laws) • Start with an expression and apply Boolean laws to derive the simplest (minimum) expression possible. Karnaugh Map Method • A K-map is a graphical method for simplifying Boolean expressions and, if properly used, will produce the simplest (minimum) expression possible. • The size of k-map depends on the number of variables.

  25. Simplification using Boolean Algebra

  26. Simplification using Boolean Algebra (cont.)

  27. Simplification using K-Map • The process of simplification (minimization): • Mapping the expression into k-map • Grouping the 1s • Determining the minimum SOP expression from the map

  28. Grouping the 1s (rules) • A group must contain either 1,2,4, or 8 cells (depending on number of variables in the expression) • Each cell in a group must be adjacent to one or more cells in that same group. • Always include the largest possible number of 1s in a group in accordance with rule 1. • Each 1 on the map must be included in at least one group. • The 1s already in a group can be included in another group as long as the overlapping groups include non common 1s.

  29. Cell Adjacency

  30. Simplification using K-Map(full example) The expression: 000 001 110 100 1 1 Practice: 1 1

  31. Simplification using K-Map(full example) 1 1 0 0 1 0 1 1

  32. اسأل الله لكم التوفيق والسداد أ. غدير كردي

More Related