Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logic Circuits Basic Building Blocks Dr John Cowell

Similar presentations


Presentation on theme: "Logic Circuits Basic Building Blocks Dr John Cowell"— Presentation transcript:

1 Logic Circuits Basic Building Blocks Dr John Cowell
phones off (please) CSCI1412 Lecture 10 Logic Circuits Basic Building Blocks Dr John Cowell

2 Overview Logic gates & Truth tables Gate Operations Logic functions
Digital Logic Combinational Circuits Logic gates & Truth tables Gate Operations Logic functions Adder circuits © De Montfort University, 2005 CSCI1412-LG-1 2

3 Digital Logic

4 Digital Logic Circuits
The function of a Digital Logic Circuit determines the values of the outputs for specified value of inputs The function is normally implemented using electronic circuitry Inputs and outputs are each in either of two states: TRUE HIGH ON 1 5V Or FALSE LOW OFF 0 0V Digital Logic Circuit Outputs Inputs

5 Digital Logic … The Digital Logic Circuit may be as simple as a single logic gate or as complex as a computer’s processor Binary logic deals with binary variables (0 or 1) and with operations that assume a logical meaning It is used to describe, in algebraic or tabular form, the manipulation and processing of binary information © De Montfort University, 2007 CSCI1412-LG-1 5

6 Boolean Variables (algebra)
Boolean algebra differs in a major way from ordinary algebra in that boolean constants and variables are allowed to have only two possible values, 0 or 1 Boolean 0 and 1 are represented by the state of a voltage variable, or what is called the logic level In boolean algebra, there are three basic logic operations: OR AND and NOT These are implemented by logic gates constructed from diodes, transistors, and resistors connected in such a way that the circuit output is the result of a basic logic operation (OR, AND, NOT) performed upon the inputs © De Montfort University, 2007 CSCI1412-LG-1 6

7 Combinational Logic Circuits
There are Combinational logic circuits and Sequential logic circuits, but most realistic logic circuits are a mixture of both Combinational logic circuits Output values depend only on the current values of the inputs there is no feedback from previous outputs (more on this later) They are called combinational as they combine the operations of more than one logic gate © De Montfort University, 2007 CSCI1412-LG-1 7

8 Logic Gates and Truth Tables

9 Logic Gates The manipulation of binary information is done by logic circuits galled gates Integrated circuits (ICs) contain a number of logic gates, ranging from three or four in simple chips to many thousands in more complex parts Each gate is represented with a distinct graphic symbol and its operation is described by means of an algebraic expression The input-output relationship of the binary variables for each gate is represented in tabular form by a truth table © De Montfort University, 2007 CSCI1412-LG-1 9

10 Truth Table A truth table is a means for describing how a logic circuit's output depends on the logic levels present at the circuit's inputs In the following two-input logic circuit, the table lists all possible combinations of logic levels present at inputs A and B along with the corresponding output level X When either input A OR B is 1, the output X is 1. Therefore the "?" in the box is an OR gate (OR gate is explained later) © De Montfort University, 2007 CSCI1412-LG-1 10

11 Gate Operations

12 AND Operation truth table
The expression X = A * B reads as "X equals A AND B“ The multiplication sign stands for the AND operation same for ordinary multiplication of 1s and 0s The AND operation produces a result of 1 occurs only for the single case when all of the input variables are 1 The output is 0 for any case where one or more inputs are 0 © De Montfort University, 2007 CSCI1412-LG-1 12

13 OR Operation The expression X = A + B reads as "X equals A OR B“
truth table The expression X = A + B reads as "X equals A OR B“ The + sign stands for the OR operation, not for ordinary addition The OR operation produces a result of 1 when any of the input variable is 1 The OR operation produces a result of 0 only when all the input variables are 0 © De Montfort University, 2007 CSCI1412-LG-1 13

14 NOT Operation truth table The NOT operation is unlike the OR and AND operations in that it can be performed on a single input variable © De Montfort University, 2007 CSCI1412-LG-1 14

15 NOT….. For example, if the variable A is subjected to the NOT operation, the result x can be expressed as x = A' where the prime (') represents the NOT operation This expression is read as: x equals NOT A x equals the inverse of A x equals the complement of A Each of these is in common usage and all indicate that the logic value of x = A' is opposite to the logic value of A © De Montfort University, 2007 CSCI1412-LG-1 15

16 XOR Operation Exclusive OR Returns: True only if either input is True
Means: this or that, but not both Often used for: cryptography generating parity bits for error checking and fault tolerance ie network messages

17 De Morgans Theorem

18 DeMorgan's Theorem (x+y)' = x' * y' (x*y)' = x' + y'
DeMorgan's theorems are extremely useful in simplifying expressions in which a product or sum of variables is inverted The two theorems are: (x+y)' = x' * y' (x*y)' = x' + y' © De Montfort University, 2007 CSCI1412-LG-1 18

19 Universality of NAND Gate
It is possible to implement any logic expression using only NAND gates ie no other type of gate is required This is because NAND gates, in the proper combination, can be used to perform each of the Boolean operations OR, AND, and INVERT © De Montfort University, 2007 CSCI1412-LG-1 19

20 NAND Gate Examples © De Montfort University, 2007 CSCI1412-LG-1 20

21 NOT Gate fron NAND Gate A A*A (A*A)' 1

22 AND Gate from NAND Gates
B C=(A*B)' X=(C*C)' 1

23 OR Gate From NAND Gates A B A' B' X=(A' * B')' 1

24 Logic Functions

25 Logic Functions A = 1010 0101 B = 0000 1111 A*B = 0000 0101
Whilst the microcomputer can perform the normal arithmetical operations on binary numbers, it can also perform logical operations: AND For clearing bits OR For setting bits A = B = A*B = A = B = A+B = © De Montfort University, 2007 CSCI1412-LG-1 25

26 NOT & XOR functions A = 1010 0101 NOT A = 0101 1010 A = 1010 0101
For inverting bits XOR For checking bits A = NOT A = A = B = A xor B = © De Montfort University, 2007 CSCI1412-LG-1 26

27 Sequential Logic Circuits
Sequential logic circuits differ from combinatorial logic circuits in two main respects The output of the system depends not only on the present external input(s) but also on the previous inputs The same external input(s) can give a different output response An important feature of sequential logical circuits, not present in combinational logic circuits, is the presence of feedback where the output from one or more logic gates is fed back into the input(s) of logic gates further back in the circuit © De Montfort University, 2007 CSCI1412-LG-1 27

28 Adder Circuits

29 Addition, using logic gates
Consider: The circuit is performing binary addition of B to A (recalling that in binary 1+1 = 0 carry 1) Such a circuit is called a half-adder 1   CARRY     SUM     B     A   © De Montfort University, 2007 CSCI1412-LG-1 29

30 Full-Adder A full adder is made by combining two half-adders and an additional OR-gate A full adder adds two binary numbers AND the carry bit. By extending the full adder long bibary n umbers can be added. © De Montfort University, 2007 CSCI1412-LG-1 30

31 Truth Table for a Full Adder
Input Carry Output Carry Sum 1

32 Find out more! What are ? READ: Sequential logic circuits
Programmable logic READ: © De Montfort University, 2007 CSCI1412-LG-1 32

33 Lecture Summary Logic gates & Truth tables Gate Operations
Digital Logic Combinational Circuits Logic gates & Truth tables Gate Operations Logic functions Adder circuits © De Montfort University, 2007 CSCI1412-LG-1 33


Download ppt "Logic Circuits Basic Building Blocks Dr John Cowell"

Similar presentations


Ads by Google