You are on page 1of 63

EE205: Digital Logic Design

Summer 2016

Ms. Asra Ashraf

EE Times, Berkeley Design Tech.


(AMD X4 Proc; photo: Sc. Am, Jan. 2010) (D. Rommel)

1
Course Description

 This course introduces fundamental concepts of the digital design and


implementation.

 It starts with an introduction to information representation, number


system, Boolean algebra, minimization of Boolean functions, switching
theory, logic gates and their operational characteristics.

 Analysis and design of combinational circuits (multiplexers, decoders,


comparators and adders) and sequential circuits (using the SR, JK, D flip
flops) is covered in detail.

 Different types of memories and PLD design techniques are also


introduced. Lab experiments are used to reinforce the theoretical
concepts covered in the lectures.

2
Course Logistics

 Textbook:
» Digital Design by Morris Mano,

 Reference Book
» "Logic and Computer Design Fundamentals," 4th Edition, by M.
Mano and C. Kime,

3
Grading

Particulars % Marks

1. Class Participation 10

2. Quizzes 20
3. Assignments 05
4. Mid Term Exam 25
6. Final Exam 40
Total:- 100

4
Digital Circuits are Everywhere

Communications
Multi-media
Manufacturing
Consumer electronics
Health care
(Source: R. Tummala, IEEE Spectrum, June 2006)
Defense and security
Software
Automotive, etc

5
Introduction to Digital Logic

Deals with building blocks of digital


systems

(Intel)

6
What are Logic Gates built from?

Transistors:
 The transistor is the workhorse of every electronic
device.

Transistor
[CSE 463]

Digital building blocks

7
What is a Transistor?

 Electronic, solid-state device that can amplify


an electric signal:
» Vout > Vin

out
» Powerout > Powerin

B
in
transistor

S
(Source: IMEC)

Id
input
output
Mike

8
Digital Model of a Transistor

 We make abstraction of the signals: 0 or 1


 As a result a transistors can be considered a switch (on
or off; 1 or ;):

9
What is an IC?

 An Integrated Circuit is a miniaturized electronic


circuits whose components (transistors, resistors,
capacitors) are build on the surface of a
semiconductor wafer, using the same planar
fabrication technology.

(Source: http://www.majelac.com/images/wafer_dicing.jpg) (Source: Wikipedia)

(Picture: Scientific American, Jan. 2010)


10
Intel Itanium 9300 Tukwila Processor

(source: www.tgdaily.com)

Four cores
Over 2 billion transistors!

11
Chip complexity

Complexity of the USA


(AMD X4 Proc: 758 million transistors; photo: Sc. Am, Jan. 2010)

Submicron and nanoscale dimensions

Compare to a street map


12
Outline of Chapter 1

 1.1 Digital Systems


 1.2 Binary Numbers
 1.3 Number-base Conversions
 1.4 Octal and Hexadecimal Numbers
 1.5 Complements
 1.6 Signed Binary Numbers
 1.7 Binary Codes
 1.8 Binary Storage and Registers
 1.9 Binary Logic

13
Analogue Quantities

Continuous Quantity
 Intensity of Light
 Temperature 45

40

 Velocity 35

temperature 0C
30

25

20

15

10

0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
time

14
Continuous Signal

45
42 41
40
37
temperature 0C 35 34 35

30 29
25 25 25
23 22
20
18
15

10
7
5 4
1 2
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
time

15
Digital Values

 Discrete set of values

45
42 41
40
37
35 34 35
temperature 0C
30 29
25 25 25
23 22
20
18
15

10
7
5 4
1 2
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
samples

16
Digital Systems

 Two Voltage Levels


 Two States
» On/Off
» Black/White
» Hot/Cold
» Stationary/Moving

17
Merits of Digital Systems

 Efficient Processing & Data Storage


 Efficient & Reliable Transmission
 Detection and Correction of Errors
 Precise & Accurate Reproduction
 Easy Design and Implementation
 Occupy minimum space

18
Information Processing

 Numbers
 Text
 Formula and Equations
 Drawings and Pictures
 Sound and Music

19
Outline of Chapter 1

 1.1 Digital Systems


 1.2 Binary Numbers
 1.3 Number-base Conversions
 1.4 Octal and Hexadecimal Numbers
 1.5 Complements
 1.6 Signed Binary Numbers
 1.7 Binary Codes
 1.8 Binary Storage and Registers
 1.9 Binary Logic

20
Binary Number System

 Binary Numbers
 Representing Multiple Values
 Combination of 0v & 5v

21
Binary Digital Signal
 An information variable represented by physical quantity.
 For digital systems, the variable takes on discrete values.
» Two level, or binary values are the most prevalent values.
 Binary values are represented abstractly by:
» Digits 0 and 1
» Words (symbols) False (F) and True (T)
» Words (symbols) Low (L) and High (H) V(t)
» And words On and Off
 Binary values are represented by values Logic 1
or ranges of values of physical quantities.
undefine

Logic 0
t
Binary digital signal

22
Outline of Chapter 1

 1.1 Digital Systems


 1.2 Binary Numbers
 1.3 Number-base Conversions
 1.4 Octal and Hexadecimal Numbers
 1.5 Complements
 1.6 Signed Binary Numbers
 1.7 Binary Codes
 1.8 Binary Storage and Registers
 1.9 Binary Logic

23
Number Systems and Codes

 Decimal Number System


 Caveman Number System
 Binary Number System
 Hexadecimal Number System
 Octal Number System

24
Decimal Number System

 Base (also called radix) = 10


» 10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
 Digit Position
2 1 0 -1 -2
» Integer & fraction
 Digit Weight 5 1 2 7 4
» Weight = (Base) Position
100 10 1 0.1 0.01
 Magnitude
» Sum of “Digit x Weight”
 Formal Notation 500 10 2 0.7 0.04

d2*B2+d1*B1+d0*B0+d-1*B-1+d-2*B-2

(512.74)10
25
Octal Number System

 Base = 8
» 8 digits { 0, 1, 2, 3, 4, 5, 6, 7 }
 Weights
Position 64 8 1 1/8 1/64
» Weight = (Base)
 Magnitude 5 1 2 7 4
» Sum of “Digit x Weight” 2 1 0 -1 -2

 Formal Notation 5
2 *8 2
+1 *8 1
+2 *8 0
+7 *8 -1
+4 *8 -

=(330.9375)10
(512.74)8

26
Binary Number System

 Base = 2
» 2 digits { 0, 1 }, called binary digits or “bits”
 Weights
Position 4 2 1 1/2 1/4
» Weight = (Base)
 Magnitude 1 0 1 0 1
» Sum of “Bit x Weight” 2 1 0 -1 -2

 Formal Notation 1
2 *2 2
+0 *2 1
+1 *2 0
+0 *2 -1
+1 *2 -

 Groups of bits 4 bits = Nibble


=(5.25)10
8 bits = Byte
(101.01)2
1011

11000101
27
Hexadecimal Number System

 Base = 16
» 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
 Weights
Position 256 16 1 1/16 1/256
» Weight = (Base)
 Magnitude 1 E 5 7 A
» Sum of “Digit x Weight” 2 1 0 -1 -2

 Formal Notation 1 *16 2


+14 *16 1
+5 *16 0
+7 *16 -1
+10 *16 -2

=(485.4765625)10

(1E5.7A)16

28
Number Base Conversions

Evaluate
Magnitude
Octal
(Base 8)

Evaluate
Magnitude
Decimal Binary
(Base 10) (Base 2)

Hexadecimal
(Base 16)
Evaluate
Magnitude
29
Decimal (Integer) to Binary Conversion

 Divide the number by the ‘Base’ (=2)


 Take the remainder (either 0 or 1) as a coefficient
 Take the quotient and repeat the division

Example: (13)10
Quotient Remainder Coefficient
13/ 2 = 6 1 a0 = 1
6/2= 3 0 a1 = 0
3/2= 1 1 a2 = 1
1/2= 0 1 a3 = 1
Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2

MSB LSB
30
Decimal (Fraction) to Binary Conversion

 Multiply the number by the ‘Base’ (=2)


 Take the integer (either 0 or 1) as a coefficient
 Take the resultant fraction and repeat the division

Example: (0.625)10
Integer Fraction Coefficient
0.625 * 2 = 1 . 25 a-1 = 1
0.25 * 2 = 0 . 5 a-2 = 0
0.5 *2= 1 . 0 a-3 = 1
Answer: (0.625)10 = (0.a-1 a-2 a-3)2 = (0.101)2

MSB LSB

31
Decimal to Octal Conversion

Example: (175)10
Quotient Remainder Coefficient
175 / 8 = 21 7 a0 = 7
21 / 8 = 2 5 a1 = 5
2 /8= 0 2 a2 = 2
Answer: (175)10 = (a2 a1 a0)8 = (257)8

Example: (0.3125)10
Integer Fraction Coefficient
0.3125 * 8 = 2 . 5 a-1 = 2
0.5 *8= 4 . 0 a-2 = 4
Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8

32
Binary − Octal Conversion

Octal Binary
 8 = 23
 Each group of 3 bits represents an 0 000
octal digit 1 001
2 010
Assume Zeros
Example: 3 011

( 1 0 1 1 0 . 0 1 )2 4 100
5 101
6 110
( 2 6 . 2 )8 7 111

Works both ways (Binary to Octal & Octal to


Binary)
33
Binary − Hexadecimal Conversion
Hex Binary
 16 = 24 0 0000

 Each group of 4 bits represents a 1


2
0001
0010
hexadecimal digit 3 0011
4 0100
5 0101
Assume Zeros 6 0110
Example: 7 0111
8 1000
( 1 0 1 1 0 . 0 1 )2 9 1001
A 1010
B 1011
C 1100
D 1101
(1 6 . 4 )16 E 1110
F 1111

Works both ways (Binary to Hex & Hex to


Binary)
34
Octal − Hexadecimal Conversion

 Convert to Binary as an intermediate step


Example:
( 2 6 . 2 )8

Assume Zeros Assume Zeros

( 0 1 0 1 1 0 . 0 1 0 )2

(1 6 . 4 )16

Works both ways (Octal to Hex & Hex to Octal)


35
Decimal, Binary, Octal and Hexadecimal

Decimal Binary Octal Hex


00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F

36
Conversion - Summary

Divisions (or x) by 16

Ai.16i Hexadecimal
Decimal

SAi.2i Group in
bits of 4
Binary
Octal Hex:
Group in
through the binary
 Ai.8i bits of 3
representation
Octal

37
Outline of Chapter 1

 1.1 Digital Systems


 1.2 Binary Numbers
 1.3 Number-base Conversions
 1.4 Octal and Hexadecimal Numbers
 1.5 Complements
 1.6 Signed Binary Numbers
 1.7 Binary Codes
 1.8 Binary Storage and Registers
 1.9 Binary Logic

38
Signed and Unsigned Numbers

 Unsigned Binary Numbers


 Signed Binary Numbers
» Most significant bit represents sign
» 0 represents a positive number
» 1 represents a negative number

39
2’s Complement form

 1’s complement form


 2’s complement form

Binary number 01101 (13)


1’s complement 10010
+ 1
2’s complement 10011 (-13)

40
Addition and Subtraction with 2’s
Complement

0101 +5 0101 +5
0010 +2 1110 -2
0111 +7 0011 +3

1011 -5 1011 -5
1110 -2 0010 +2
1001 -7 1101 -3

41
Outline of Chapter 1

 1.1 Digital Systems


 1.2 Binary Numbers
 1.3 Number-base Conversions
 1.4 Octal and Hexadecimal Numbers
 1.5 Complements
 1.6 Signed Binary Numbers
 1.7 Binary Codes
 1.8 Binary Storage and Registers
 1.9 Binary Logic

42
Binary Code
 Example:
» Consider decimal 185 and its corresponding value
in BCD and binary:

43
Binary Codes

 Other Decimal Codes

45
Binary Codes

 Gray Code
» The advantage is that only bit in
the code group changes in going
from one number to the next.
– Error detection.
– Representation of analog
data.
– Low power design.
000 001

010 011
100 101

110 111

1-1 and onto!! 46


GRAY CODE – Decimal

Binary Gray
000 000
001 2 bit changes 001
010 011
011 2 bit changes 010 Only 1 bit changes
100 110
101 2 bit changes 111
110 101
111 100

47
ALPHANUMERIC CODES - ASCII Character Codes

 American Standard Code for Information Interchange


 This code is a popular code used to represent
information sent as character-based data. It uses 7-bits
to represent:
» 94 Graphic printing characters.
» 34 Non-printing characters
 Some non-printing characters are used for text format
(e.g. BS = Backspace, CR = carriage return)

48
ASCII Code: B7B6B5 B4B3B2B1 H=(1001000)

49
Binary Codes

 ASCII Character Code

50
Binary Codes

 Error-Detecting Code
» To detect errors in data communication and
processing, an eighth bit is sometimes added to the
ASCII character to indicate its parity.
» A parity bit is an extra bit included with a message
to make the total number of 1's either even or odd.
 Example:
» Consider the following two characters and their
even and odd parity:

51
Binary Codes

 Error-Detecting Code
» Redundancy (e.g. extra information), in the form of
extra bits, can be incorporated into binary code
words to detect and correct errors.
» A simple form of redundancy is parity, an extra bit
appended onto the code word to make the number
of 1’s odd or even. Parity can detect all single-bit
errors and some multiple-bit errors.
» A code word has even parity if the number of 1’s in
Message A: 100010011 (even parity)
the code word is even.
Message B: 10001001 0 (odd parity)
» A code word has odd parity if the number of 1’s in
the code word is odd.
» Example:
52
Outline of Chapter 1

 1.1 Digital Systems


 1.2 Binary Numbers
 1.3 Number-base Conversions
 1.4 Octal and Hexadecimal Numbers
 1.5 Complements
 1.6 Signed Binary Numbers
 1.7 Binary Codes
 1.8 Binary Storage and Registers
 1.9 Binary Logic

53
Binary Storage and Registers

 Registers
» A binary cell is a device that possesses two stable states and is
capable of storing one of the two states.
» A register is a group of binary cells. A register with n cells can store
any discrete quantity of information that contains n bits.
n cells 2n possible states

 A binary cell
» Two stable state
» Store one bit of information
» Examples: flip-flop circuits, ferrite cores, capacitor
 A register
» A group of binary cells
» AX in x86 CPU
 Register Transfer
» A transfer of the information stored in one register to another.
» One of the major operations in digital system.
» An example in next slides.
54
A Digital Computer Example

Memory

Control
CPU unit Datapath

Inputs: Keyboard, Outputs: CRT,


mouse, modem, LCD, modem,
Input/Output speakers
microphone
Synchronous or
Asynchronous?
55
Transfer of information

Figure 1.1 Transfer of information among register 56


Transfer of information

 The other major


component of a digital
system
» Circuit elements to
manipulate individual
bits of information
» Load-store machine
LD R1;
LD R2;
ADD R3, R2, R1;
SD R3;

Figure 1.2 Example of binary information processing 57


Outline of Chapter 1

 1.1 Digital Systems


 1.2 Binary Numbers
 1.3 Number-base Conversions
 1.4 Octal and Hexadecimal Numbers
 1.5 Complements
 1.6 Signed Binary Numbers
 1.7 Binary Codes
 1.8 Binary Storage and Registers
 1.9 Binary Logic

58
Binary Logic
 Definition of Binary Logic
» Binary logic consists of binary variables and a set of logical
operations.
» The variables are designated by letters of the alphabet, such as A, B,
C, x, y, z, etc, with each variable having two and only two distinct
possible values: 1 and 0,
» Three basic logical operations: AND, OR, and NOT.

59
Binary Logic
 Truth Tables, Boolean Expressions, and Logic Gates

AND OR NOT
x y z x y z x z
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1

z=x•y=xy z=x+y z = x = x’

x x x
y z y z z
60
Switching Circuits

AND OR

61
Binary Logic

 Logic gates
» Example of binary signals

3
Logic 1
2
Un-define
1
Logic 0
0

Figure 1.3 Example of binary signals 62


Binary Logic

 Logic gates
» Graphic Symbols and Input-Output Signals for
Logic gates:


Fig. 1.4 Symbols for digital logic circuits

Fig. 1.5 Input-Output signals for gates 63


Binary Logic

 Logic gates
» Graphic Symbols and Input-Output Signals for
Logic gates:

Fig. 1.6 Gates with multiple inputs

64

You might also like