0% found this document useful (0 votes)
31 views

EE-105 Computer Logic Design: Chapter 1 (Lecture 1-5)

This document provides an overview of the topics that will be covered in the EE-105 Computer Logic Design course. The course covers digital logic gates, number systems including binary, hexadecimal and octal, binary arithmetic, logic gate ICs, combinational and sequential logic circuits, programmable logic devices, memory, and digital system advantages. Key concepts like binary addition and subtraction, binary-to-decimal conversion, signed and two's complement representations will be discussed in detail.

Uploaded by

ShowPiece
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

EE-105 Computer Logic Design: Chapter 1 (Lecture 1-5)

This document provides an overview of the topics that will be covered in the EE-105 Computer Logic Design course. The course covers digital logic gates, number systems including binary, hexadecimal and octal, binary arithmetic, logic gate ICs, combinational and sequential logic circuits, programmable logic devices, memory, and digital system advantages. Key concepts like binary addition and subtraction, binary-to-decimal conversion, signed and two's complement representations will be discussed in detail.

Uploaded by

ShowPiece
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 79

EE-105 Computer Logic Design

Chapter 1 (Lecture 1-5)

About Me:

Education:

Areas of Interest:

(PhD in progress)
MSc Computer Engineering from UET Taxila.
BSc Computer Engineering form UET Taxila.
Digital Communication.
Wireless Communication.
Cognitive Radios.

Location:

Office#113, first floor, Electrical Engg Block


Email: [email protected]
2

Important Notes which should


be remember throughout the

semester
Discipline: I expect you to remain disciplined in the

class throughout semester. Using cell phone during


lecture is highly prohibited . Strong disciplinary
action will be taken in case of any violation.
Attendance: Try to be on time. No one will be
allowed to enter the class room after 5 min of
commencement of the lecture. Please dont come to
me for attendance compensation, whatsoever the
reason is.
Assignments: Copying assignments of others will
have very serious impact on your grade. So avoid it.
3

Important Notes-contd..

I encourage you to ask the questions. Raise


your hands before asking any question and
speak after permission. Questions should be
relevant to the topic of discussion, not from
the topics which have been discussed in
previous lectures or to be discussed in future.
Hold your questions till end of lecture.

Grading Policy

Assignments & Quizzes


First Sessional
Second Sessional
Final Exam
Class Behavior

:
:
:
:
:

15%
15%
15%
50%
5%

Grading Policy is Tentative


5

Reading

Text book:

Digital Design 4th Edition


M.Morris Mano

Micheal D.Ciletti

Digital System Advantages

Efficient processing and data storage


Reliable transmission
Easy detection and correction of errors
Easy design and implementation
Occupy minimum space

Information Processing

Numbers
Text
Formula and Equations
Drawings and Pictures
Sound and Music

10

GND

11

12

13

Vcc

Logic Gate Symbol and ICs

7400

Digital Logic Gates

10

Combinational Circuit

11

Sequential Circuit

12

Programmable Logic Devices (PLDs)

Configurable Hardware
Combinational Circuits
Sequential Circuits
Lower Cost
Short development time

Memory

Storage
RAM (Random Access Memory)

Read-Write
Volatile

ROM (Read-Only Memory)

Read-Only
Non-Volatile

Number Systems and Codes

Decimal Number System


Binary Number System
Hexadecimal Number System
Octal Number System

Decimal Number System

Ten unique numbers 0,1..9


Combination of digits
Positional Number System
275 = 2 x 102 + 7 x 101 + 5 x 100

Base or Radix 10
Weight 1, 10, 100, 1000 .

Representing Fractions

Fractions can be represented in decimal number


system in a manner
= 3 x 102 + 8 x 101 + 2 x 100 + 9 x 10-1
+ 1 x 10-2
= 300 + 80 + 2 + 0.9 + 0.01
= 382.91

Binary Number System

Two unique numbers 0 and 1


Base 2
A binary digit is a bit
Combination of bits to represent larger values

Binary to Decimal Conversion

Sum of Weights
Combination of Bits
100112 = 1910
= (1 x 24) + (0 x 23) + (0 x 22) + (1 x 21)
+ (1 x 20)
= (1 x 16) + (0 x 8) + (0 x 4) + (1 x 2)
+ (1 x 1)
= 16 + 0 + 0 + 2 + 1
= 19

Binary Number System


Decimal Number

Binary Number

Decimal Number

Binary Number

10

1010

11

1011

10

12

1100

11

13

1101

100

14

1110

101

15

1111

110

16

10000

111

17

10001

1000

18

10010

1001

19

10011

Fractions in Binary

Fractions in Binary
1011.1012 = 11.625
= (1 x 23) + (0 x 22) + (1 x 21) + (1 x 20)
+ (1 x 2-1) + (0 x 2-2) + (1 x 2-3)
= (1 x 8) + (0 x 4) + (1 x 2) + (1 x 1)
+ (1 x 1/2) + (0 x 1/4) + (1 x 1/8)
= 8 + 0 + 2 + 1 + 0.5 + 0 + 0.125
= 11.625

Floating Point Notations

Binary to Decimal Conversion

Add weights of non-zero terms


Weights increase/decrease by power of 2
100112 = 16 + 2 + 1 = 19

1011.1012 = 8 + 2 + 1 + 1/2 + 1/8

= 11 + 5/8
= 11.625

Decimal-Binary Conversion

Binary to Decimal Conversion

Sum-of-Weights
Adding weights of non-zero terms

Decimal to Binary Conversion

Repeated Division by 2

Decimal to Binary Conversion


number

Quotient after division

Remainder after division

392

196

(b 0)

196

98

(b 1)

98

49

(b 2)

49

24

(b 3)

24

12

(b 4)

12

(b 5)

(b 6)

(b 7)

(b 8)

Decimal-Binary fraction conversion

Decimal to Binary Conversion

Repeated multiplication by 2

Number

Mult. By 2

Integer

0.8125

1.625

(b-1)

0.625

1.250

(b-2)

0.250

0.500

(b-3)

0.500

1.000

(b-4)

Decimal-Binary fraction conversion

26

Binary Arithmetic

Binary Addition
Binary Subtraction
Binary Multiplication
Binary Division

Binary Addition

Four Basic rules for binary addition

1st digit
0
0
1
1

2nd digit Sum


0
0
1
1
0
1
1
0

Carry
0
0
0
1

Addition of multiple binary numbers

Binary Addition
Carry

10

1st Number

2nd Number
3rd Number

4th Number
Result

Binary Subtraction

Four Basic rules for binary subtraction

1st digit
0
0
1
1

2nd digit Difference


0
0
1
1
0
1
1
0

Borrow
0
1
0
0

Binary Subtraction

Borrow
1st Number

1
1

2nd Number

Result

Representations of Binary
Number

1.
2.
3.

In digital System data is stored in form of


binary numbers.
There are three methods to represent the
binary numbers in digital systems.
Unsigned Representation
Signed Representation
2s Complement Representation

32

Unsigned Representation

All binary numbers are considered positive.


Range of Unsigned numbers

33

Signed Representation

MSB of binary number is used as sign of


binary number: Example

Range of signed numbers

34

2s Complement
Representation

Positive numbers are represented in their


original form.
Negative numbers are represented in 2s
Complement form
2s Complement: invert the bits and add 1

35

2s Complement form

1s complement form
2s complement form

Binary number 01101


1s complement 10010
+
2s complement 10011

(13)
1
(-13)

Range of Binary Numbers


Decimal Sign Magnitude 2s Complement Unsigned
Number -(2n-1 -1), 2n-1 -1 -2n-1, 2n-1 -1
0, 2n - 1
0
1
2
3
4
5
6
7

0000
0001
0010
0011
0100
0101
0110
0111

0000
0001
0010
0011
0100
0101
0110
0111

000
001
010
011
100
101
110
111

Range of Binary Numbers


Decimal Sign Magnitude 2s Complement Unsigned
Number -(2n-1 -1), 2n-1 -1 -2n-1, 2n-1 -1
-8
-7
-6
-5
-4
-3
-2
-1

1111
1110
1101
1100
1011
1010
1001

1000
1001
1010
1011
1100
1101
1110
1111

Exercise

Write all numbers from -15 to 15 using signed


number representation.
Write all numbers from -16 to 15 using 2s
complement representation.

39

Addition and Subtraction


2s complement vs. Signed
2s Complement
0101
+5
0010
+2
0111
+7
1011
1110
11001

-5
-2
-7

Signed Binary
0101
0010
0111
1101
1010
10111

+5
+2
+7
-5
-2
-7

Addition and Subtraction


2complement vs. Signed
0101
1110
10011

+5
-2
+3

0101
1010
1111

+5
-2
+3

1011
0010
1101

-5
+2
-3

1101
0010
1111

-5
+2
-3

Range and Overflow


1011
1101
11000

-5
-3
-8

1011
1100
10111

-5
-4
-9

0101
0100
1001 +9

+5
+4

Hexadecimal Number System

Base 16
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Representing Binary in compact form

11011000001102 = 1B06 H

Counting in Hexadecimal
Decimal Binary

Hexadecimal

Decimal Binary

Hexadecimal

0000

1000

0001

1001

0010

10

1010

0011

11

1011

0100

12

1100

0101

13

1101

0110

14

1110

0111

15

1111

Counting in Hexadecimal
Decimal HexaDecimal

Decimal HexaDecimal

Decimal HexaDecimal

16

10

24

18

32

20

17

11

25

19

33

21

18

12

26

1A

34

22

19

13

27

1B

35

23

20

14

28

1C

36

24

21

15

29

1D

37

25

22

16

30

1E

38

26

23

17

31

1F

39

27

Binary-Hexadecimal Conversion

Binary to Hexadecimal Conversion

11010110101110010110
1101 0110 1011 1001 0110
D
6
B
9
6

Hexadecimal to Binary Conversion


FD13
1111 1101 0001 0011

Decimal-Hexadecimal Conversion

Decimal to Hexadecimal Conversion


Repeated Division by 16

Repeated Division by 16

Number

Quotient

Remainder

2096

131

131

Hexadecimal-Decimal Conversion

Hexadecimal to Decimal Conversion


Sum-of-Weights

Sum-of-Weights
CA02
(C x 163) + (A x 162) + (0 x 161) + (2 x 160)
(12 x 163) + (10 x 162) + (0 x 161) + (2 x 160)
(12 x 4096) + (10 x 256) + (0 x 16) + (2 x 1)
49152 + 2560 + 0 + 2
51714

Octal Number System

Base 8
0, 1, 2, 3, 4, 5, 6, 7
Representing Binary in compact form

11011000001102 = 154068

Not commonly used in the presence of


Hexadecimal Number System

Counting in Octal

Octal digit represented by a 3-bit binary


Decimal 8 represented by 2-digit Octal

Counting in Octal
Decimal
0
1
2
3
4
5
6
7

Binary
000
001
010
011
100
101
110
111

Octal
0
1
2
3
4
5
6
7

Counting in Octal
Decimal Octal Decimal Octal
8
10
16
20
9
11
17
21

Decimal Octal
24
30
25
31

10
11
12
13
14
15

26
27
28
29
30
31

12
13
14
15
16
17

18
19
20
21
22
23

22
23
24
25
26
27

32
33
34
35
36
37

Binary to Octal Conversion

011010110101110010110
011 010 110 101 110 010 110
3 2 6 5 6 2 6
1011011101001
1 011 011 101 001
001 011 011 101 001
1 3 3
5 1

Octal to Binary Conversion

1726
001 111 010 110

Decimal-Octal Conversion

Decimal to Octal Conversion


Repeated Division by 8

Repeated Division by 8

Number

Quotient

Remainder

2079

259

(a0)

259

32

(a1)

32

(a2)

(a3)

Octal-Decimal Conversion

Octal to Decimal Conversion


Sum-of-Weights

Sum-of-Weights
4037
(4 x 83) + (0 x 82) + (3 x 81) + (7 x 80)
(4 x 512) + (0 x 64) + (3 x 8) + (7 x 1)
2048 + 0 + 24 + 7
2079

Alternate Representations

BCD Code
Gray Code

BCD (Binary Coded Decimal) Code

Binary Code to represent decimal digits 0-9


Used by Decimal Number Displays

BCD (Binary Coded Decimal) Code


Decimal
0
1
2
3
4

BCD
0000
0001
0010
0011
0100

Decimal
5
6
7
8
9

BCD
0101
0110
0111
1000
1001

BCD Addition
23
45
68

0010 0011
0100 0101
0110 1000

23
0010 0011
49
0100 1001
72
0110 1100
1100 is illegal BCD number

BCD Addition

Add a 0110 (6) to an invalid BCD number


Carry added to the most significant BCD digit
23
49
72

0010 0011
0100 1001
0110 1100
0110
0111 0010

Gray Code
Decimal
0
1
2
3
4
5
6
7

Gray
000
001
011
010
110
111
101
100

Binary
000
001
010
011
100
101
110
111

Boolean Logic

Boolean logic deals with Boolean variables and


logical operations.
Boolean variables can take two discrete values
(0,1).
Logical operations:
AND: z=x.y
OR : z=x + y
NOT: z= x

Truth Tables of Logic Operations

Logic Gates

Basic Building Blocks


Logic Gate Symbol
Unique Function
Truth or Function Table
Function Expression
Timing Diagram

AND Gate

1 output
2 inputs
3 inputs
4 inputs
Multiple inputs

AND Gate function

Logical Multiplication function


Input
A
0
0
1
1

B
0
1
0
1

Output
F
0
0
0
1

F A B
F A B C .... N

AND Gate Timing Diagram

OR Gate

1 output
2 inputs
3 inputs
4 inputs
Multiple inputs

OR Gate function

Boolean Add function


Input
A
0
0
1
1

B
0
1
0
1

Output
F
0
1
1
1

F A B
F A B C .. N

OR Gate Timing Diagram

NOT Gate

1 input
1 output

NOT Gate function

Invert function
Input

Output

FA

NOT Gate Timing Diagram

Questions?

79

You might also like