Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.

Similar presentations


Presentation on theme: "ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering."— Presentation transcript:

1 ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering

2 Understanding Decimal Numbers  Decimal numbers are made of decimal digits: (0,1,2,3,4,5,6,7,8,9)  Number representation:  8653 = 8x10 3 + 6x10 2 + 5x10 1 + 3x10 0  What about fractions?  97654.35 = 9x10 4 + 7x10 3 + 6x10 2 + 5x10 1 + 4x10 0 + 3x10 -1 + 5x10 -2  Informal notation  (97654.35) 10

3 Understanding Binary Numbers  Binary numbers are made of binary digits (bits):  0 and 1  Number representation:  (1011) 2 = 1x2 3 + 0x2 2 + 1x2 1 + 1x2 0 = (11) 10  What about fractions?  (110.10) 2 = 1x2 2 + 1x2 1 + 0x2 0 + 1x2 -1 + 0x2 -2  Groups of eight bits are called a byte (B)  (11001001) 2

4 Convert an Integer from Decimal to Another Base 1.Divide decimal number by the base (e.g. 2) 2.The remainder is the lowest-order digit 3.Repeat first two steps until no divisor remains. For each digit position: Example for (13) 10: Integer Quotient 13/2 = 6 1 a 0 = 1 6/2 = 3 0 a 1 = 0 3/2 = 1 1 a 2 = 1 1/2 = 0 1 a 3 = 1 RemainderCoefficient Answer (13) 10 = (a 3 a 2 a 1 a 0 ) 2 = (1101) 2

5 Convert a Fraction from Decimal to Another Base 1.Multiply decimal number by the base (e.g. 2) 2.The integer is the highest-order digit 3.Repeat first two steps until fraction becomes zero. For each digit position: Example for (0.625) 10: Integer 0.625 x 2 = 1 + 0.25 a -1 = 1 0.250 x 2 = 0 + 0.50 a -2 = 0 0.500 x 2 = 1 + 0 a -3 = 1 FractionCoefficient Answer (0.625) 10 = (0.a -1 a -2 a -3 ) 2 = (0.101) 2

6 The Growth of Binary Numbers n2n2n 02 0 =1 1 2 1 =2 2 2 2 =4 3 2 3 =8 4 2 4 =16 5 2 5 =32 6 2 6 =64 72 7 =128 n2n2n 82 8 =256 9 2 9 =512 10 2 10 =1024 11 2 11 =2048 12 2 12 =4096 20 2 20 =1M 30 2 30 =1G 402 40 =1T Mega Giga Tera Kilo 2 50 =Peta

7 Binary Addition  Binary addition is very simple.  This is best shown in an example of adding two binary numbers…  Procedure easy to implement by circuits 1 1 1 1 0 1 + 1 0 1 1 1 --------------------- 0 1 0 1 1 1111 1100 carries

8 Binary Subtraction °We can also perform subtraction (with borrows in place of carries). °Let’s subtract (10111) 2 from (1001101) 2 … °Procedure hard to implement by circuit 1 10 0 10 10 0 0 10 1 0 0 1 1 0 1 - 1 0 1 1 1 ------------------------ 1 1 0 1 1 0 borrows

9 Binary Multiplication  Binary multiplication is much the same as decimal multiplication, except that the multiplication operations are much simpler… 1 0 1 1 1 X 1 0 1 0 ----------------------- 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 0 1 1 1 ----------------------- 1 1 1 0 0 1 1 0

10 Binary Data Storage & Representation Binary cells store individual bits of data Multiple cells form a register. Data in registers can indicate different values Hexadecimal: (41) 16 =(65) 10 BCD (Binary Coded Decimal): (41) 10 ASCII (American Standard Code for Information Interchange): letter “A” Binary Cell 01000001

11 Register Transfer  Data can move from register to register.  Digital logic used to process data.  We will learn to design this logic. Register ARegister B Register C Digital Logic Circuits

12 Digital Systems  Analysis problem:  Determine binary outputs for each combination of inputs  Design problem: given a task, develop a circuit that accomplishes the task  Many possible implementations.  Try to develop “best” circuit based on some criterion (size, power, performance, etc.) ···· ···· Logic Circuit InputsOutputs

13 Boolean Algebra  George Boole 1815-1864  English mathematician  Boolean algebra or Boolean logic Sound and complete system Everything is either true or false, and can proven Nothing is unknown Case closed In contrast, mathematics about integers are incomplete Many things can NOT be proven true nor false Godel’s incomplete theorem Endless effort …

14 Boolean Algebra  A Boolean algebra is defined as a closed algebraic system containing a set of elements  Every variable can take only two values 0 or 1  Only two operators, * and +  Identity elements  a + 0 = a  a * 1 = a  0 is the identity element for the + operation·  1 is the identity element for the * operation·

15 Commutativity and Associativity of the Operators  The Commutative Property: For every a and b  a + b = b + a  a * b = b * a  The Associative Property: For every a, b, and c  a + (b + c) = (a + b) + c  a * (b * c) = (a * b) * c

16 The Distributive Property  The Distributive Property: For every a, b, and c,  a + ( b * c ) = ( a + b ) * ( a + c )  a * ( b + c ) = ( a * b ) + ( a * c )

17 Distributivity of the Operators and Complements  The Existence of the Complement: For every a there exists a unique element called a’ (complement of a) such that,  a + a’ = 1  a * a’ = 0  To simplify notation, the * operator is frequently omitted. When two elements are written next to each other, the AND (*) operator is implied…  a + b * c = ( a + b ) * ( a + c )  a + bc = ( a + b )( a + c )

18 Claude Shannon 1916-2001  American mathematician  Father of information theory and cryptography  In 1937, at age 21, he was a master student at MIT  Noticed engineers were messing around with logic circuits without a sound foundation  Wrote the “most important master’s thesis of all time” to demonstrate Boolean algebra could be used to resolve any logical relationship  Since then, Boolean algebra becomes widely used

19 Describing Circuit Functionality: Inverter  Basic logic functions have symbols.  The same functionality can be represented with truth tables·  Truth table completely specifies outputs for all input combinations.  The above circuit is an inverter.  An input of 0 is inverted to a 1.  An input of 1 is inverted to a 0. AY 01 10 InputOutput A Y Symbol Truth Table

20 The AND Gate  This is an AND gate  Logic operation Y= A* B  So, if the two inputs signals are asserted (high) the output will also be asserted. Otherwise, the output will be deasserted (low). ABY 000 010 100 111 A B Y Truth Table

21 The OR Gate  This is an OR gate.  Logic operation Y = A+B  So, if either of the two input signals are asserted, or both of them are, the output will be asserted. Note: If there are n inputs, then the truth table will have 2 n rows. Since we can fill any of the entries on output with 0 or 1, there are 2^2^n ways to fill a truth table of n input. Therefore, there are 2^2^n gates of n input ABY 000 011 101 111 A B Y

22 The NAND Gate  This is a NAND gate. It is a combination of an AND gate followed by an inverter. Its truth table shows this. ABY 001 011 101 110 A B Y

23 The NOR Gate  This is a NOR gate. It is a combination of an OR gate followed by an inverter. It’s truth table shows this ABY 001 010 100 110 A B Y

24 The XOR Gate (Exclusive-OR)  This is a XOR gate.  XOR gates assert their output when exactly one of the inputs is asserted, hence the name.  The switching algebra symbol for this operation is , i.e. 1  1 = 0 and 1  0 = 1. ABY 000 011 101 110 A B Y

25 Describing Circuit Functionality: Waveforms  Waveforms provide another approach for representing functionality.  Values are either high (logic 1) or low (logic 0).  Can you create a truth table from the waveforms? ABY 000 010 100 111 AND Gate

26 Consider three-input gates 3 Input OR Gate

27 Ordering Boolean Functions  How to interpret A · B+C?  Is it A · B ORed with C ?  Is it A ANDed with B+C ?  Order of precedence for Boolean algebra: AND before OR.  Note that parentheses are needed here :

28 Toll Booth Controller  Consider the design of a toll booth controller.  Inputs: quarter, car sensor.  Outputs: gate lift signal, gate close signal  If driver pitches in quarter, raise gate.  When car has cleared gate, close gate.  Call quarter detector signal Q, car detector C  Call raise gate signal R=Q*C, and lower gate signal L=C’ Logic Circuit $0.25? Car? Raise gate Close gate

29 Boolean Algebra

30  A Boolean algebra is defined with:  A set of elements S={0,1}  A set of operators  A number of unproved axioms or postulates

31 Boolean Algebra (cont.)  A binary operator:  Defined on a set S of elements  A rule that assigns to each pair of elements from S a unique element from S  Example a*b=c   a  S and  b  S it must hold that a*b  S  A set S is closed with respect to a binary operator if for every two elements of S, the binary operator specifies a unique element of S

32 Definition of Boolean Algebra  Boolean algebra is an algebraic structure, defined by a set of elements S and two binary operators, +, and ·, with the following postulates: 1. The structure is closed with respect to + and * 2. Element 0 is an identity element for + Element 1 is an identify element for * x+0=0+x=x x · 1=1 · x=x

33 Definition of Boolean Algebra (cont.) 3. The structure is commutative with respect to + and · : a + b = b + a a · b = b · a 4. The operator · is distributive over + The operation + is distributive over · a · ( b + c ) = ( a · b ) + ( a · c ) a + ( b · c ) = ( a + b ) · ( a + c )


Download ppt "ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering."

Similar presentations


Ads by Google