0% found this document useful (0 votes)
43 views74 pages

Lecture 1 Number - System

The document outlines a course on Digital Logic Design taught by Daniyal Adeeb, who has extensive academic and professional credentials. It covers essential rules for classroom conduct, definitions of key concepts like Binary-Coded Decimal (BCD), 2421 Code, Excess-3 Code, 8-4-2-1 Code, and Gray Code, emphasizing their applications in digital systems. Additionally, it includes an ungraded home assignment from a specified textbook.

Uploaded by

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

Lecture 1 Number - System

The document outlines a course on Digital Logic Design taught by Daniyal Adeeb, who has extensive academic and professional credentials. It covers essential rules for classroom conduct, definitions of key concepts like Binary-Coded Decimal (BCD), 2421 Code, Excess-3 Code, 8-4-2-1 Code, and Gray Code, emphasizing their applications in digital systems. Additionally, it includes an ungraded home assignment from a specified textbook.

Uploaded by

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

Digital Logic Design

Daniyal Adeeb
About instructor
Daniyal Adeeb
BSc Electrical Engineering GCU, Lhr Gold Medalist

MS Electrical Engineering, GCU, Lhr Gold Medalist

MS Artificial Intelligence, LUMS Distinction Award

4+ experience as a Machine
Learning/AI engineer
Office Hours

MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY


11:00-1:45 11:00-12:15 12:30-1:45 11:00-1:45 -
Rules
Respect Everyone – Treat your classmates and instructor with respect. No interruptions or side
conversations during lectures.
Be Punctual – Arrive on time. Late arrivals disturb the class and affect your learning.
No Mobile Distractions – Phones should be on silent or off unless needed for class activities.
Active Participation – Engage in discussions, ask questions, and contribute to a productive
learning environment.
No Plagiarism or Cheating – Academic integrity is a must. Any form of cheating will have
consequences.
Follow Assignment Deadlines – Late submissions may not be accepted or will have penalties.
Raise Your Hand – If you have a question or comment, raise your hand instead of speaking out of
turn.
Book
Definition
Digital Logic Design (DLD) is the
foundation of digital circuits and
systems, dealing with the representation,
manipulation, and implementation of
logic functions using electronic
components. It involves designing
circuits that process binary information
(0s and 1s) using logic gates,
combinational circuits, and sequential
circuits.
For DS/AI
AI and Data Science focus on
high-level algorithms, the efficiency
and feasibility of these models
depend on the underlying hardware,
which is governed by digital logic. A
solid grasp of DLD helps students make
better optimization decisions, work
with AI hardware, and understand
the physical limitations of
computation.
Binary-Coded Decimal (BCD)
BCD is used to represent decimal digits in binary.
Each decimal digit is encoded with a 4-bit binary
value. Since computers use binary, but humans are
more familiar with decimal, BCD allows decimal
numbers to be processed as binary.
In BCD, the decimal digits 0-9 are represented using 4
bits, but binary combinations from 1010 to 1111 are
unused. For example, decimal 396 in BCD is 0011
1001 0110.
BCD ensures that decimal values are stored and
processed efficiently in binary form, with each digit
represented separately.
2421 Code
The 2421 code is a weighted binary code where each bit is
assigned specific weights of 2, 4, 2, and 1 (from left to right).
This code allows us to represent decimal digits using a binary
sequence that has different weights assigned to each bit
position.

In 2421 code, a decimal digit is converted by using the


weights. For example, to represent decimal 7:

● 7 → 1101 in 2421 code

2×1+4×1+2×0+1×1=7

● Decimal 4 can be represented as either 0100 or 1010, as


both combinations sum to 4.

This code is a weighted code, meaning the value of a number


is determined by summing the weights of the bits that are set to
1. It is commonly used in applications that require precise
control over binary representations.
Excess-3 Code
Excess-3 is a self-complementing code where 3 is added
to each decimal digit before converting it into binary.
In Excess-3, each decimal digit is increased by 3 before
converting it to binary. For example:
● Decimal 3 → 3 + 3 = 6 → 0110 in Excess-3.
● Decimal 9 → 9 + 3 = 12 → 1100 in Excess-3.
● Decimal 5 → 5 + 3 = 8 → 1000 in Excess-3.
So, decimal 395 would be represented as 0110 1100 1000
in Excess-3. This is useful in older computer systems
that needed to handle decimal values and perform
complement operations easily.
8-4-2-1 Code
The 8-4-2-1 code is a weighted binary code where each bit has a
distinct weight: 8, 4, 2, and 1, from left to right. This code represents
decimal digits in binary using the specific weights of these bits.

For example, to represent decimal 2 in the 8-4-2-1 code:

● Decimal 2 → 0110 in 8-4-2-1 code:


○ 8×0+4×1+2×1+1×0=2

This code allows more flexibility as it uses both positive and negative
weights for the bits, which can be useful in some applications where
negative values need to be represented. It is often used in specific
situations that require precise control over binary representations.

The 8-4-2-1 code is a weighted code, and its main feature is that it
assigns both positive and negative weights to each bit position,
making it unique compared to other codes like BCD.
Gray Code
Gray code is a binary numeral system where each successive number
differs from the previous one by only a single bit. This is particularly
useful in applications that involve continuous or analog data, as it
prevents errors during the transition from one value to the next.

In Gray code, the first bit of the binary number remains the same, and
each subsequent bit is determined by performing an exclusive OR
(XOR) operation between the corresponding binary bit and the
previous binary bit. The primary advantage of Gray code is that it
reduces errors in systems where multiple bits change simultaneously,
which can lead to invalid readings.

For example:

● Decimal 3 → Binary 0011 → Gray Code 0010


● Decimal 7 → Binary 0111 → Gray Code 0100
● Decimal 8 → Binary 1000 → Gray Code 1100

This property makes Gray code useful in systems such as rotary


encoders, where the value is continuously changing, and errors due to
bit transitions need to be minimized.
Home Assignment (Ungraded)
1.3,1.4,1.6,1.7,1.8,1.9,1.11,1.12,1.25
from Digital design by Morris Mano 5th edition

You might also like