1 / 24

Data Manipulation

Data Manipulation. CSCI130 Instructor: Dr. Imad Rahal. Layered Architecture. 0. clock. 16-3000 MHz (~3.0 GHz). Overview of Computer Hardware. “necessary” components of a computer CPU , Main memory components needed for convenience computer won’t be very practical to use otherwise

devona
Download Presentation

Data Manipulation

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. Data Manipulation CSCI130 Instructor: Dr. Imad Rahal

  2. Layered Architecture

  3. 0 clock • 16-3000 MHz (~3.0 GHz)

  4. Overview of Computer Hardware • “necessary” components of a computer • CPU, Main memory • components needed for convenience • computer won’t be very practical to use otherwise • Secondary/Auxiliary storage, I/O devices • Main memory • Connects to the motherboard • Divided into two major parts

  5. Overview of Computer Hardware • RAM --- Random Access Memory • memory registers which store data before/after CPU processing • Available for users and programs so store data in and read data from • Volatile --- does not persist when no electric power is supplied to its circuits • ROM --- Read Only Memory • Permanent • Holds programs that are vital for the operation of the computer • As the name indicates, can be read but never altered • CPU • Central Processing Unit • Single silicon chip with circuits attached to it • Known as microprocessor • Sits on a circuit board known as the motherboard

  6. Data Manipulation • Computing an answer to an equation: • 5*3 + 62 – 7 • Assume our computer can’t directly multiply, subtract, or raise to power • Multiplication task: • 1: Get 1st number, Number_1 • 2: Get 2nd number, Number_2 • 3: Answer = 0 • 4: Add Number_1 to Answer • 5: Subtract 1 from Number_2 • 6: if Number_2>0, go to step 4 • 7: Stop

  7. Data Manipulation • All tasks done by a general-purpose computer can be accomplished through the following set of operations • Input/output • Not mentioned in book but important • Store data • numbers (positive, negative or fractions), text, pictures, etc … • Compare data (numbers, pictures, sounds, letters) • Add • Move data from one storage (memory) location to another • Editing a text document

  8. Data Manipulation • Adding and comparing bit patterns is sufficient to achieve an “operational” machines • Hard-wired vs. programmed • This is done by circuits for adding and comparing bit patterns in registers • Circuits are made up of logical gates • Gates and Truth Tables • Gates needed are NOT, AND, and OR • NOT Gate: • Single input and single output • Reverses input • 1  0 and 0  1 • If there is a strong electric current •  shut it off • If there is no/weak electric current •  turns it on • Like a power switch

  9. Data Manipulation • AND Gate • Accepts two inputs (or more) and yields one output • Output is 0 when any input is 0 • Requires power coming from both lines in order to give out power

  10. Data Manipulation • OR Gate • Accepts two inputs and yields one output • Output is 1 when any input is 1 • Requires power coming from at least one of the input lines in order to give out power

  11. Data Manipulation • These three simple gates are combined to create circuits that perform more complicated operations • Circuits, in turn, might then be used (thru programs) to perform even more complicated tasks • Gate combinations can be expressed in three ways • (1) Through Expressions • A AND B  AB • A OR B  A+B • NOT A  A’ • A’B’ + AB

  12. NOT AND OR • Enough rows to hold all input combinations • 1 letter  21 rows • 2 letters  22 rows • 3 letters 23 rows • n letters 2n rows • (2) Through Circuit diagrams • Given an expression • Draw a gate after its inputs have been drawn • Try A’B’ + AB • (3) Through Truth Tables • Each of the representations can be derived from the other • Derivetruth tablegiven expression • One column for each letter • Make 1 additional column for every sub-expression (order: parentheses, NOTs, ANDs, ORs)

  13. Practice • Try A + (A.B’+B.C)’ • How many gates? • Design circuit • Parenthesis, NOT, AND, and then OR • Find truth table • How many rows?

  14. Data Manipulation • given a circuit diagram expression  truth table • Mark every output wire by its label

  15. Sum of Products Method • Given a truth table, how to find expression? • Sum-of-product method • For each row with a 1 in the final column • AND letters with a 1 in their column and negation of the letters with a 0 in their column • Connectthe resulting AND groups with ORs • A’B’ • A’B • Ignore • AB  A’B’+A’B+AB  Complicated and UGLY  !!! (requires space, and is costly and slow)

  16. Simplification • Why simplify? • UGLY • Circuits supposed to be as simple as possible • Save on speed (operation execution---fewest gates as possible because every gates slows the operation a bit) • (in general) more gates  more time • Save space (on motherboard) • Notebooks! • Save money(not as critical)

  17. Laws of Boolean Algebra Commutative Law A+B = B+A, A.B=B.A E.g. addition and multiplication Distributive Law A.(B+C) = A.B + A.C, E.g. multiplication over addition A+(B.C) = (A+B).(A+C) Idempotency Law A+A = A, A.A=A Double Negation (A’)’ = A E.g. -(-5) = +5 DeMorgan’s Law (A+B)’ = A’.B’, (A.B)’ = A’+B’ Identities A.0 = 0, A+0=A A.1 = A, A+1=1 A.A’ = 0, A+A’ = 1 Simplification of Expressions

  18. Simplification of Expressions • To simplify (reduce the number of gates) • (1) look at two or more terms sharing one or more letters • use distributive Law • AB + AC = A(B+C) • A’B’+A’B+AB // distributive law (#1) • A’(B’+B) + AB // identities • A’(1) + AB // identities • A’ + AB // distributive law (#2) • (A’+A)(A’+B) // identities • (1)(A’+B) // identities • A’+B

  19. Simplification of Expressions • A.B’+A’.B’+A’.B • B’. (A + A’) + A’.B • B’ + A’.B • (B’ + A’).(B’ + B) • B’ + A’ • (B.A)’ Distributive law Distributive Identities IdempotencyLaw Distributive DeMorgans Idempotency Law Distributive Law

  20. Simplification of Expressions • AB’+B+B’+AB • AB’+1 + AB • 1 Identities Identities

  21. Simplification of Expressions Distributive law IdempotencyLaw Idempotency Law Distributive Law

  22. Circuit for Equivalence • We need to compare the data contents of two registers • Data is in binary • compare them bit by bit • Start right to left • Take two inputs • If both 0s or 1s, output 1 • Otherwise, output a zero • A’B’+AB • (Sum of products method) • Ask yourself: when am I getting a 1? •  (A+B)’ +AB (simpler) • Draw circuit

  23. Circuit for Equivalence

  24. Circuit for Addition

More Related