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

Lecture 1

Digital logic design covers topics such as number systems, logic gates, binary arithmetic operations, and methods for converting between number systems. Key points covered include binary, octal, decimal, and hexadecimal number systems; basic logic gates like AND, OR, and NOT; binary addition and subtraction; and direct and repeated methods for converting between number systems. The document provides examples to illustrate concepts like binary to decimal conversion using repeated division.

Uploaded by

Mega Tron
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Lecture 1

Digital logic design covers topics such as number systems, logic gates, binary arithmetic operations, and methods for converting between number systems. Key points covered include binary, octal, decimal, and hexadecimal number systems; basic logic gates like AND, OR, and NOT; binary addition and subtraction; and direct and repeated methods for converting between number systems. The document provides examples to illustrate concepts like binary to decimal conversion using repeated division.

Uploaded by

Mega Tron
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

0

Digital Logic Design

Lecture#1
Instructor: Syed Muhammad Usman

Slides Courtesy: Ms. Aunsia Khan Lecturer, SZABIST


1 Grading Policy
Assignments/ Projects (16%)
- 4 Assignments.

Quizzes (14%)
- 4 (Announced/ Unannounced) quizzes

Mid Exam (30%)

Final (40%)
2 Digital Systems
• Digital systems represent information using a
binary system, where data can assume one of only two
possible values:

• zero or one.

• Appropriate for implementation in electronic circuitry,


where values are characterized by the absence/presence of
an electrical current flow.
3 Analog signals

• These are usually older electronic gadgets (introduced


before the mid 1990’s).
• A good example of an analog signal is the loud-speaker
of a stereo system. When the volume is turned up the
sound increases slowly and constantly.
• Examples of analog systems include;
Old radios, megaphones and the volume control on old
telephone hand sets.
4
Digital signals
• Modern electronic products such as computers and
mobile phones depend on digital signals.

• The signal is sent as a series of ‘on’ and ‘off’ pulses.

• The signal is either present or it is not.


5 Logic Gates

• Digital systems are said to be constructed by using logic


gates.

• These gates are the AND, OR, NOT, NAND, NOR, XOR and
XNOR gates.

• The basic operations are described below with the aid


of Truth Tables.
6 Logic Gates
AND gate

The AND gate is an electronic circuit that gives


a high output (1) only if all its inputs are high.

A dot (.) is used to show the AND operation i.e. A.B.


7 Cont.
OR gate

The OR gate is an electronic circuit that gives a high output


(1) if one or more of its inputs are high.

A plus (+) is used to show the OR operation.


8
Cont.

NOT gate

The NOT gate is an electronic circuit that produces an


inverted version of the input at its output.
It is also known as an inverter.
9 Binary Arithmetic Operations
Binary Addition
It is a key for binary subtraction, multiplication, division.

Binary Subtraction
• Subtraction and Borrow, these two words will be used
very frequently for the binary subtraction.
10

Binary Multiplication
• Binary multiplication is similar to decimal multiplication.
• It is simpler than decimal multiplication because only 0s
and 1s are involved.
11 Number System

• Binary Number System


• Octal Number System
• Decimal Number System
• Hexa-Decimal Number System
12 Binary Number System

Binary numbers uses only 0 and 1 digits.

Example:
13 Octal Number System

Octal numbers uses digits from 0 to 7.

Example:
14 Decimal Number System
Decimal numbers uses digits from 0 to 9.

Example:
15 Hexadecimal Numbers
Hex numbers uses digits from 0 to 9 and A to F.

Example:
16 Number System Conversion Table

DecimalBase- HexadecimalBas
BinaryBase-2 OctalBase-8
10 e-16

0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 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
17 Decimal to Other Base System
•Step 1 − Divide the decimal number to be converted by the value of
the new base.

•Step 2 − Get the remainder from Step 1 as the rightmost digit (least
significant digit) of new base number.

•Step 3 − Divide the quotient of the previous divide by the new base.

•Step 4 − Record the remainder from Step 3 as the next digit (to the
left) of the new base number.

Repeat Steps 3 and 4, getting remainders from right to left, until the
quotient becomes zero in Step 3.

The last remainder thus obtained will be the Most Significant Digit
(MSD) of the new base number.
18 Example
Decimal Number: (29)10

Calculating Binary Equivalent −

Step Operation Result Remainder

Step 1 29 / 2 14 1

Step 2 14 / 2 7 0

Step 3 7/2 3 1

Step 4 3/2 1 1

Step 5 1/2 0 1
19 Cont.
As mentioned in Steps 2 and 4, the remainders have to be
arranged in the reverse order so that the first remainder
becomes the Least Significant Digit (LSD) and the last
remainder becomes the Most Significant Digit (MSD).

Decimal Number − (29)10 = Binary Number − (11101)2.


20 Example
Binary Number − 111012
Calculating Decimal Equivalent −

Step Binary Number Decimal Number

4 3 2
Step 111012 ((1 × 2 ) + (1 × 2 ) + (1 × 2 )
1 0
1 + (0 × 2 ) + (1 × 2 ))10

Step 111012 (16 + 8 + 4 + 0 + 1)10


2

Step 111012 2910


3

Binary Number − (11101)2 = Decimal Number − (29)10


21 Number System Conversion
There are many methods or techniques which can be
used to convert numbers from one base to another.
• Decimal to Other Base System
•Repeated division Method

• Other Base system to Decimal


•Repeated Multiplication Method
•Direct Method

• Other Base system to Non-Decimal


Binary to Decimal
22

Binary Number − 111012


Calculating Decimal Equivalent −
Step Binary Number Decimal Number

4 3 2
Step 11101 ((1 × 2 ) + (1 × 2 ) + (1 × 2 )
1 0
1 + (0 × 2 ) + (1 × 2 ))

Step 11101 (16 + 8 + 4 + 0 + 1)


2

Step 11101 29
3

Binary Number − (11101)2 = Decimal Number − (29)10


23
Octal to Binary
Octal Number − (25)8

Step 1 − Convert to Decimal


Step Octal Number Decimal Number

1 0
Step 1 25 ((2 × 8 ) + (5 × 8 ))

Step 2 25 (16 + 5 )

Step 3 25 21

Octal Number − (25)8 = Decimal Number − (21)10


24 Octal to Binary (Cont.)
Step 2 − Convert Decimal to Binary

Decimal Number (21)10 = Binary Number − (10101)2


Step Operation Result Remainder
Step 1 21 / 2 10 1
Step 2 10 / 2 5 0
Step 3 5/2 2 1
Step 4 2/2 1 0
Step 5 1/2 0 1

Octal Number (25)8 = Binary Number (10101)2


Direct Method: Binary to Octal
25

•Step 1 − Divide the binary digits into groups of three


(starting from the right).
•Step 2 − Convert each group of three binary digits to one
octal digit.
Example
Binary Number − (10101)2
Calculating Octal Equivalent
Step Binary Number Octal Number
Step 1 10101 010 101
Step 2 10101 2 5
Step 3 10101 25

Binary Number (10101)2 = Octal Number (25)8


26
Direct Method: Octal to Binary
•Step 1 − Convert each octal digit to a 3 digit binary
number.
•Step 2 − Combine all the resulting binary groups (of 3
digits each) into a single binary number.
Example
Octal Number − (25)8
Calculating Binary Equivalent −
Step Octal Number Binary Number
Step 1 25 2 5
Step 2 25 010 101
Step 3 25 010101

Binary Number (25)8 = Octal Number (010101)2


27 Direct method: Binary to Hexadecimal
•Step 1 − Divide the binary digits into groups of four
(starting from the right).
•Step 2 − Convert each group of four binary digits to one
hexadecimal symbol.
Example
Binary Number − (10101)2

Step Binary Number Hexadecimal Number


Step 1 10101 0001 0101
Step 2 10101 1 5
Step 3 10101 15

Binary Number (10101)2 = Hexadecimal Number (15)16


Direct Method: Hexadecimal to Binary
28
•Step 1 − Convert each hexadecimal digit to a 4 digit binary
number (the hexadecimal digits may be treated as decimal
for this conversion).
•Step 2 − Combine all the resulting binary groups (of 4
digits each) into a single binary number.
Example: Hexadecimal Number − (15)16
Calculating Binary Equivalent

Step Hexadecimal Number Binary Number


Step 1 15 1 5

Step 2 15 0001 0101

Step 3 15 00010101

Hexadecimal Number (15)16 = Binary Number (10101)2


29 Hexadecimal to Octal
When converting from hexadecimal to octal, it is often
easier to first convert the hexadecimal number into binary
and then from binary into octal.

For example, to convert A2DE hex into octal:

Add leading zeros or remove leading zeros to group into sets of


three binary digits.

Binary: 1010001011011110 = 001 010 001 011 011 110


Then, look up each group in a table:
Hexadeci
A 2 D E
mal =
=
10100010
Binary = 1010 0010 1101 1110
11011110
binary
30 Cont.
Binary: 000 001 010 011 100 101 110 111

Octal: 0 1 2 3 4 5 6 7

Binary
001 010 001 011 011 110
=
=
Octal
1 2 1 3 3 6 121336
=
octal

Through a two-step conversion process, hexadecimal A2DE


equals binary 1010001011011110 equals octal 121336.
31 Octal to Hexadecimal
When converting from octal to hexadecimal, it is often
easier to first convert the octal number into binary and
then from binary into hexadecimal.

For example, to convert 345 octal into hex:

Drop any leading zeros or pad with leading zeros to get groups
of four binary digits (bits):
Binary 011100101 = 1110 0101

Then, look up the groups in a table to convert to hexadecimal


digits.
Octal = 3 4 5
= 011100101
Binary = 011 100 101
binary
32 Cont.

Therefore, through a two-step conversion process, octal 345


equals binary 011100101 equals hexadecimal E5.

Binary: 0000 0001 0010 0011 0100 0101 0110 0111


Hexad
0 1 2 3 4 5 6 7
ecimal:

Binary: 1000 1001 1010 1011 1100 1101 1110 1111


Hexad
ecimal 8 9 A B C D E F
:

Binary = 1110 0101


Hexadecimal = E 5 = E5 hex
33 One’s Complement

Take one’s complement of 1010110

1111111
-1010110

Answer ???
34 Two’s complement

Take two’s complement of 1010110

Answer??

You might also like