Introduction to Digital Logic

Download Report

Transcript Introduction to Digital Logic

Introduction to Digital
Logic
Modified from :
The Architecture of Computer
Hardware and Systems Software:
An Information Technology Approach
3rd Edition, Irv Englander
John Wiley and Sons 2003
Note to Students
Students usually find this topic easy (although it
looks hard at first!)
We will not do math—Boolean algebra
We will focus on the basics: LOGIC GATES
Why are we studying Digital
Logic?
 Digital logic performs the basic
instructions of a processor….
 ADD, SUB, JUMP, etc
 These are “hard-wired” into the system.
 We don’t study the components that
make up the gates – transistors,
capacitors, circuits etc..
4
Little picture….
 It all starts with LOGIC
 The logic is implemented with electrical
devices
 The individual devices are organized
together in very clever ways to perform
VERY SIMPLE functions:
 Check if the 5th bit of the PSW=1?
 ADD two binary numbers (integer)
 Find the sign, exponent and mantissa of a
floating point number
 Determine the op-code and operand of an
instruction
5
Big picture….
 The simple instructions of a CPU combine to form
useful work:
1) Sort all the names in a DATABASE by last name
2) Send a file to the printer
3) Network different devices together
4) Use the internet
5) Track 2 million bank accounts
6) Play music and movies
7) Take a class on-line
8) Write a book (or letter or report) and store it
electronically for later use
 9) Store huge amounts of information electronically








6
Integrated Circuits
 The building blocks of computers
 Designed for specialized functions
 Examples: the CPU, bus interface,
memory management unit
 Transistors: primary components of
ICs
 Motorola MPC 7400 PowerPC modules:
6.5 million transistors in less than ½ in2
7
Transistors con’t
Transistors: are the means for
implementing Boolean algebra
 Switches: on/off to represent the 0’s
and 1’s of binary digital circuits
 Combined to form logic gates
8
Boolean Logic
 Rules that govern constants and variables
that can take on 2 values
 True/false; on/off; yes/no; 0/1
 Boolean logic
 Rules for handling Boolean constants and
variables
 3 fundamental operations:
AND, OR and NOT
 Truth Table: specifies results for all possible
input combinations
9
Boolean Operators
 AND
 Result TRUE if and only if both
input operands are true
 C=A B
 INCLUSIVE-OR
 Result TRUE if any input
operands are true
 C=A+B
A
B
C
0
0
0
0
1
0
1
0
0
1
1
1
A
B
C
0
0
0
0
1
1
1
0
1
1
1
1
10
Boolean Operators
 NOT
 Result TRUE if single input value
is FALSE
 C=A
A
C
0
1
1
0
11
Boolean Operators
 EXCLUSIVE-OR
 Result TRUE if either A or B is
TRUE but not both
 C=A⊕B
 Can be derived from
INCLUSIVE-OR, AND and NOT

A
B
C
0
0
0
0
1
1
1
0
1
1
1
0
A ⊕ B = (A + B)  ( A  B )
A xor B equals A or B but not both A and B

A ⊕ B = (A  B ) + ( B  A )
A xor B = either A and not B or B and not A
12
Boolean Algebra Operations
 Valid for INCLUSIVE-OR, AND, XOR
 Associative

A + ( B + C ) = ( A + B ) + C
 Distributive

A  ( B + C ) = A  B + A  C
 Commutative

A + B = B + A
 DeMorgan’s Theorems

A + B = A  B

A  B = A + B
13
Gates and Combinatorial Logic
 Many computer functions defined in terms
of Boolean equations
 Example: sum of 2 single binary digit numbers
 Truth table for sum
Truth table for
carry XOR
AND
A
B
C
A
B
C
0
0
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0
0
1
1
0
1
1
1
14
Computer Implementation
 Gates or logical gates
 Integrated circuits constructed from
transistor switches and other electronic
components
 VLSI: very large-scale integration
15
Boolean Algebra
Implementation
 Single type of gate appropriately combined
 2 possibilities
 NAND gate: AND operation followed by a NOT
operation
 NOR gate: INCLUSIVE-OR followed by a NOT operation
Note:  indicates a NOT operation
16
Selector or Multiplexer
 Switch input back and forth between
inputs
 Logic circuits that make up a computer
 are relatively simple but
 look complicated because many circuits
required
17
EXAMPLE
 Example 1: Complete the truth
table for the following circuit:
18
EXAMPLE
 Fill-in the table:
19
EXAMPLE
 Fill-in the table:
20
EXAMPLE
 Fill-in the table:
21
EXAMPLE
 Fill-in the table:
22
EXAMPLE
 Fill-in the table:
23
In Class: How to get started?
24