Computer Systems Design Thurs 5-7pm room 102 wwh Fall 1997 Will set up a www page for the course Allan Gottlieb gottlieb@nyu.edu (or gottlieb@cs.nyu.edu or ...) 715 bway rm 1001 212-998-3344 609-951-2707 email is best Text is Hennessy and Patterson "Computer Orgaiization and Design The Hardware/Software Interface" Available in bookstore. These notes are available. They are low quality (a FEATURE). The main body of the book assumes you know logic design. I do NOT make that assumption. We will start with appendix B, which is logic design review. A more extensive treatment of logic design is M. Morris Mano "Computer System Architecture" Prentice Hall. We will not need as much as mano covers and it is not a cheap book so I am not requiring you to get it. I will get it put into the library. My treatment will follow H&P not mano. Homework vs labs (describe) Left board for assignments and announcements (will be on www when that is set up). HOMEWORK Read B1 B.2 Gates, Truth Tables and Logic Equations Digital ==> Discrete Primarily binary at the hardware (but NOT exclusively). Use only two voltages -- high and low This hides a great deal of engineering Must make sure not to sample the signal when not in one of these two states. Sometimes it is just a matter of waiting long enough (determines the clock rate i.e. megahertz) Other times it is worse and you must avoid glitches. Draw sketch of scope trace square wave sine wave real wave WE WILL IGNORE THIS. In English digital (think digit, i.e. finger) => 10, but not in computers Bit = Binary digIT Instead of saying high voltage and low voltage, we say true and false or 1 and 0 or asserted and deasserted. 0 and 1 are complements of each other. A logic block can be thought of as a black box that takes signals in and produces signals out. Two kinds combinational (or combinatorial) and sequential. The first kind doesn't have memory (so is simplier) the second kind does have memory. The current value in the memory of the block is called the state of the block. We are doing combinational now. Will do sequential later (few weeks). TRUTH TABLES Since comb log has no mem, it is simply a function from its inputs to its outputs. The truth table has as columns all inputs and all outputs. It has one row for each possible input value(e) and the output columns have the output for that input. Let's start with a really simple case. Logic block with one input and one output. DRAW IT There are two columns (1 + 1) and two rows (2**1). How many different truth tables are there for one in and one out? Just 4: the constant functions 1 and 0, the identity, and an inverter (pictures in a few minutes). OK Now how about two inputs and 1 output. Three columns (2+1) and 4 rows (2**2). How many are there? It is just how many ways can you fill in the output entries. There are 4 output entries so ans is 2**4=16. How about 2 in and 8 out? 10 cols; 4 rows; 2**(4*8)=4 billion possible 3 in and 8 out? 11 cols; 8 rows; 2**(8**8)=2**64 possible n in and k out? n+k cols; 2**n rows; 2**([2**n]*k) possible Gets big fast! Certain logic functions (i.e. truth tables) are quite common and familiar. We use a notation that looks like algebra for them and expressions involving them. Boolean algebra (george Boole). Boolean variable takes on just two values 1 and 0. Boolean function takes in boolean variables and produces boolean valuesw 1. The (inclusive) OR Boolean function of two variables. Draw its truth table. This is written + (e.g. X+Y where X and Y are Boolean variables) and often called the logical sum. (three out of four squares look right!) 2. AND. Draw TT. Called log product and written as a centered dot (like product in regular algebra). All four values look right. 3. NOT. This is a unary operator (One argument, not two like above; the two above are called binary). Written A bar. Draw TT. 4. Exclusive OR (XOR). Written as + with circle around. True if exactly one input is true (i.e. true XOR true = false). Draw TT. HOMEWORK Consider the Boolean function of 3 boolean vars that is true if and only if exactly 1 of the three variables is true. Draw the TT. Some manipulation laws. Remember this is ALGEBRA. Identity: A+0 = 0+A = A A.1 = 1.A = A (using . for and) Inverse: A+A_ = A_+A = 1 A.A_ = A_.A = 0 (using _ for inverse) Both + and . are commutative so don't need as much as I wrote Really funny to call the second inverse law (you ADD the inverse and get the identity for PRODUCT). Associative: A+(B+C) = (A+B)+C A.(B.C)=(A.B).C Due to assoc law we can write A.B.C since either order of eval gives the same answer. Often elide the . so the product assoc law is A(BC)=(AB)C. Distributive (note BOTH dist laws hold): A(B+C)=AB+AC A+(BC)=(A+B)(A+C) How does one prove these laws?? Simple (but long) write the TT. Do the first dist laws HOMEWORK: Do the second distributive law. Do example on page B-6 (Based on example on page B-5 (fig A) ) For E first use the obvious method of writing one condition for each 1-value in the E column i.e. (A_BC) + (AB_C) + (ABC_) Observe that E is true if two (but not three) inputs are true, I.E. (AB+AC+BC) (ABC)_ (using . higher precedence than +) My first way of getting E shows that ANY logic function can be written using just AND, OR, and NOT. Indeed, it is in a nice form. Called two levels of logic, i.e. it is a sum of products of just inputs and their compliments. DeMorgan's laws: (A+B)_ = A_B_ (AB)_ = A_+B_ You prove DM law with a TT. Indeed that is ... HOMEWORK B.6 on page B-45