Lecture 2 Comp Sys PDF - Introduction to Computer Systems

Summary

This document is a lecture presentation on introduction to computer systems, focusing on computer circuits, Boolean logic, and Karnaugh maps. The lecture covers historical developments of computers and digital circuit operations.

Full Transcript

Introduction to Computer Systems Computer Circuits Lecture 2 Introduction to Computer Systems – Lecture 2 Topics of this lecture: Historical Development of Computers Intro to Boolean Logic and Expressions Boolean Operators (AND, OR and NOT) and their Truth Tables Lo...

Introduction to Computer Systems Computer Circuits Lecture 2 Introduction to Computer Systems – Lecture 2 Topics of this lecture: Historical Development of Computers Intro to Boolean Logic and Expressions Boolean Operators (AND, OR and NOT) and their Truth Tables Logic Gates (AND, OR and NOT ) Computer Circuits & Simulator Circuit Construction Algorithms Simplifying Circuit using Karnaugh Maps Historical Development The evolution of computing machinery has taken place over several centuries. In modern times, computer evolution is usually classified into four generations – G1: Vacuum Tube Computers (1940s) – G2: Transistorized Computers (1950s) – G3: Integrated Circuit (IC) Computers (1960s) – G4: Very Large Scale IC - Microprocessor (1970s) Notes – Japan tried to create G5 computer in 1982-1992 but it was not successful (massively parallel computing and logic programming) – Some sources say the new robots are G5 Historical Development - Generation Zero Mechanical Calculating Machines (1623–1945) – Calculating Clock: Wilhelm Schickard (1623) – Pascaline: Blaise Pascal (1642) – Babbage Engines: Difference Engine (1822) & Analytical Engine (1837). – Punched card tabulating machines: Herman Hollerith (1890): electromechanical machine Hollerith cards were commonly used for computer input well into the 1970s. Historical Development – First Generation The First Generation: Vacuum Tube Computers (Mid 1940s) – Atanasoff Berry Computer (1937– 1938) solved systems of linear equations. Historical Development – First Generation Electronic Numerical Integrator and Computer (ENIAC) – John Mauchly and J. Presper Eckert – University of Pennsylvania, 1946 The ENIAC was the first general-purpose computer Historical Development – Second Generation Transistorized Computers (1950s): Discrete transistors replacing the tubes – IBM 7094 (scientific) and 1401 (business) – Digital Equipment Corporation (DEC) PDP-1 Historical Development – Third Generation Integrated Circuit Computers (1960s): The integration of large numbers of tiny transistors into a small chip IBM 360 DEC PDP-8 and PDP-11 Cray-1 supercomputer By this time, IBM had gained overwhelming dominance in the industry. A picture at IBM showing the first 3 generation (late 1960s) Historical Development - Fourth Generation Very Large Scale Integrated Circuits VLSI Computers (1970s–2010) – Enabled the creation of microprocessors. – The first microprocessors was Intel 4004 (can execute 92,000 instructions per second). – Later versions, such as the 8080, 8086, and 8088 led to the idea of “personal computing.” – CPU like intel i7 has more that 3 billions transistors Historical Development Moore’s Law (1965) – Gordon Moore, Intel founder – “The density of transistors in an integrated circuit will double every two year.” Moore’s Law cannot hold forever... Source: https://ourworldindata.org/technological-progress Boolean Logic A form of logic developed by George Boole (1815– 1864) A branch of mathematics containing operators, variables and transformation rules Deals with rules for manipulating two logical values true and false Construction of computer circuits is based on Boolean logic Boolean expression Any expression that can be evaluated to either true or false Example x≤5 – is true if x is less or equal to 5 – is false if x has any other value x + 6= y – is true if ? – is false if ? Boolean operations In traditional mathematics, the operations used to construct expressions are: +, −, ×, ÷, a b map real numbers to real numbers In Boolean logic, the operations used to construct Boolean expressions are: AND, OR and NOT map a set of (true, false) values into a single (true, false) result The Boolean AND operation If a and b are Boolean expressions, then the value of the expression (a AND b) is true if and only if both a and b are true. Otherwise, (a AND b) is false. a AND b is also written as a · b Can also be expressed as a truth table The Boolean OR operation If a and b are Boolean expressions, then the value of the expression (a OR b) is true if a is true, if b is true or if both are true. Otherwise, (a OR b) is false a OR b is also written as a + b Can also be expressed as a truth table The Boolean NOT operation AND and OR are binary operators (requires two operands) NOT is a unary operator (requires only one operand) If a is Boolean expressions, then the value of the expression (NOT a) is true if a is false and it is false if a is true. The NOT operation complements the value of a Boolean expression NOT a is also written as Can also be expressed as a truth table Other Boolean operations XOR (Exclusive OR) NOR (NOT OR) NAND (NOT AND) Create a truth table for XOR, NOR and NAND A B NAND 0 0 1 0 1 1 1 0 1 1 1 0 Examples Assuming x = 3 and y = 2, determine the value of each of the following Boolean expressions: (x = 3) AND (y < 5) (x < y) OR (x > 3) NOT [(x = 3) AND (y > x)] Not[ 1 And 0] Gates A gate is an electronic device that – Operates on a collection of binary inputs – Produces a binary output In other words, a gate transforms a set of (0,1) input values into a single(0,1) output according to a pre- defined rule. Here, we will look at gates that implement the Boolean operations – AND, OR and NOT The AND gate Implements Boolean operation AND Try http://logic.ly/demo/ Two- and Three-input AND gate The OR Gate Implements Boolean operation OR Two- and Three-input OR gate The NOT Gate Implements Boolean operation NOT The NOT Gate The NAND and NOR gates Computer Circuits A circuit is a collection of gates that transforms a set of binary inputs into a set of binary outputs – Combinational circuits - circuits in which the output values depends only on the current values of the inputs – Sequential circuits - circuits that contain feedback loops in which the output depends on the current inputs as well as previous inputs Every Boolean expression can be represented as a circuit diagram Typical Computer Circuit Example - Computer circuit Boolean expression c = (a OR b) d = NOT ((a OR b) AND (NOT b)) (http://logic.ly/demo/) The sum-of-products algorithm 1. Construct the truth table describing the behaviour of the desired circuit 2. While there is still an output column in the truth table, do steps 2.1 and 2.2 2.1 Select an output column 2.2 Subexpression construction using AND and NOT gates 2.3 Subexpression combination using OR gates 2.4 Circuit diagram production 1. Done Step 1. Truth table construction Determine the behaviour of the circuit for all possible circumstances Organize this as a truth table. – For N inputs (each either a 0 or a 1), there are 2N possible combinations – Specify the output value (0 or 1) for each input combination Step 2.1: Select an output column Select one output (i.e. one column of the truth table) Build a Boolean subexpression that produces a value 1 for each output with a value 1 using exactly that combination of input values Step 2.2: Subexpression construction using AND and NOT gates Examine the value of each input for each selected output If the input = 1, use that input in the subexpression If the input = 0, take the NOT of the input and use that in the subexpression Take the AND of the input sequence of all 1s Step 2.3: Subexpression combination using OR gates Combine each subexpression (two at a time) in Step 2.2 using OR gates – Each individual subexpression in Step 2.2 produces a 1 for exactly one case – OR of the above outputs produces a 1 in each case where the truth table has 1 – Every other case produces a 0 The Boolean expression produced is Step 2.4: Circuit diagram production Construct the circuit diagram by converting the Boolean expression in Step 2.3 using AND, OR and NOT gates Use (http://logic.ly/demo/) to construct: Examples: Some Common Circuits A Compare-For-Equality circuit Multiplexer circuit (2n input lines and 1 output line) Demultiplexer circuit (1 input line and 2n output line) Other Circuits: a b = Odd/Even parity bit generators 0 0 1 Majority-rules circuit 0 1 0 Full Adder ADD circuit 1 0 0 Prioritiser 1 1 1 A Compare-For-Equality circuit Tests two unsigned binary numbers for exact equality Outputs value 1 (true) if the two numbers are equal and value 0 (false) if they are not 111 110 N-Bit Compare-For-Equality circuit Multiplexer circuit Has 2n input lines and 1 output line The circuit copy binary value of exactly one of its input lines onto its output line The circuit uses a second set of N selector lines to select the specific input Example - 1-of-4 Multiplexer circuit Example - Multiplexer in ALU Demultiplexer circuit Has n input lines and 2n output line The circuit interprets the number represented by the input lines and send a signal on the output line that has that identification number All other outputs are set to 0 Example - Instruction decoder Karnaugh Maps Simplification of Boolean functions leads to simpler (and usually faster) digital circuits. In 1953, Maurice Karnaugh was a telecommunications engineer at Bell Labs. He invented a graphical way of visualizing and then simplifying Boolean expressions. This graphical representation, now known as a Karnaugh map, or Kmap, is named in his honor. Description of Kmaps A Kmap is a matrix consisting of rows and columns that represent the output values of a Boolean function. The output values placed in each cell are derived from the value of the corresponding sub-expression. Description of Kmaps As an example, we give the truth table and KMap for the function, F(x,y) = x + y at the right. This function is equivalent to the OR of all of the minterms that have a value of 1. Thus: F(x,y)= x+y = x’y+xy’+xy Kmap Simplification for Two Variables We can reduce our complicated expression to its simplest terms by finding adjacent 1s in the Kmap that can be collected into groups that are powers of two. In our example, we have two such groups. – Can you find them? Kmap Simplification for Two Variables The rules of Kmap simplification are: – Groupings can contain only 1s; no 0s. – Groups can be formed only at right angles; diagonal groups are not allowed. – The number of 1s in a group must be a power of 2 – even if it contains a single 1. – The groups must be made as large as possible. – Groups can overlap and wrap around the sides of the Kmap. Kmap Simplification for Two Variables The green group can by represented by Y why? The red group can by represented by X why? F(x,y) = x + y F(x,y)= x.y’ + y Description of Kmaps Not always useful !! Kmap Simplification for Three Variables A Kmap for three variables is constructed as shown in the diagram below. Notice that the values for the yz combination at the top of the matrix form a pattern that is not a normal binary sequence (one change at a time). Kmap Simplification for Three Variables Consider the function: F(X,Y,Z)= X’Y’Z + X’YZ + XY’Z + XYZ Its Kmap is given below. – What is the largest group of 1s that is a power of 2? Kmap Simplification for Three Variables This grouping tells us that changes in the variables x and y have no influence upon the value of the function: They are irrelevant. This means that the function, reduces to F(x) = z. You could verify this reduction with identities or a truth table. Kmap Simplification for Three Variables Now for a more complicated Kmap. Consider the function: F(X,Y,Z)= X’Y’Z’+ X’Y’Z + X’YZ + X’YZ’+ XY’Z’+ XYZ’ Its Kmap is shown below. There are (only) two groupings of 1s. – Can you find them? Kmap Simplification for Three Variables In this Kmap, we see an example of a group that wraps around the sides of a Kmap. What about the green group in the top row? Kmap Simplification for Three Variables The green group in the top row tells us that only the value of x is significant in that group. We see that it is complemented in that row, so the other term of the reduced function is X’ Our reduced function is F(X,Y,Z)= X’+ Z’ Kmap Simplification for Four Variables The same rules apply when we have four or even more variable Summary Boolean logic and Boolean operations Logic gates Computer circuits Circuit construction algorithms Kmap Simplification Further reading A. Clements “Principles of Computer Hardware”, Chapter 2. G. M. Schneider & J. L. Gersting, “Invitation to Computer Science”, Chapter 4. Boolean logic simulator (http://logic.ly/demo/)

Use Quizgecko on...
Browser
Browser