Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Digital Logic Design

Lecture No. 1
By
Muhammad Saad Amin

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) 1


DLD Lecture-01
Outline
• Digital Systems
• Binary Numbers
• Number-Base Conversions
• Octal and Hexadecimal Numbers
• Complements of Numbers
• Subtraction with complements
• Signed Binary Numbers
• Binary Codes
• Binary Storage and Registers
• Binary Logic

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 2


Must Reading
• Chapter No. 1: Digital Systems and Binary Numbers

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 3


Digital Systems
• Digital Vs. Analog

+5 +5

1 0 1
V V
Time Time

–5 –5

Digital: Analog:
only assumes discrete values values vary over a broad range
continuously

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 4


Digital Systems
• Signal examples over time
…continued 2

Time

Continuous in
Analog value & time

Digital
Discrete in
Asynchronous
value &
continuous in
time
Synchronous Discrete in
with the clock value & time
06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 5
Digital

Systems …continued 3
Advantages:
• Cheap electronic circuitry
• Easier to calibrate and adjust
• Immunity to noise
• Noise margin

Noise added

Sender Receiver

Signal Signal

 Thus digital systems have


captured the market
06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 6
Digital Systems
• Discrete Data
– Examples:
• 26 letters of the alphabet (A, B … etc.)
• 10 decimal digits (0, 1, 2 … etc.) Analog Discrete

– Combine together
• Words are made of letters (University … etc.)
• Numbers are made of digits (4241 … etc.)
• Binary System
– Only ‘0’ and ‘1’ digits
– Can be easily implemented in electronic circuits

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 8


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 100 10 1 0.1 0.01
– Weight = (Base) Position
• Magnitude
500 10 2 0.7 0.04
– Sum of “Digit x Weight”
d2*B2+d1*B1+d0*B0+d-1*B-1+d-2*B-2
• Formal Notation
(512.74)10
06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 9
Binary Systems
• Review, how the decimal system is designed?
• Base (Radix) 10
• Symbols: 0, 1, 2, … 8, 9
• What if quantity greater than 9?
• Add more significant digits to the left
• Each position carries a weight
• Example: 7392
• 7 × 103 + 3 × 102 + 9 × 101 + 2 × 100 = 7392
• Seven thousand three hundred and ninety two
• Weightage increases as the digit placement moves to left and vice
versa

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 9


Binary Systems …continued 2
• What if weightage is less than 100
• We use the symbol point (.) and write the number to the right
• MSD → ← LSD
• Base-10 is default base for numbering system
• But, we can generalize the rule for.any base-r system from
10 10 10 10 10 10
3 2 1 0 -1 -2

the base-10 (decimal) number system


• Base (Radix) is “r”
• Symbols: 0 → (r – 1)
• Weightage of each number increases by a factor of “r” as its
placement moves to the left

r3 r2 r1 r0 . r-1 r-2

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 10


Binary Systems …continued 3
• Example: an…a5a4a3a2a1a0.a-1a-2a-3…a-m
an × rn +…a5 × r5 + a4 × r4 + a3 × r3 + a2 × r2 + a1 × r1 + a0 × r0 + a-1 × r-
1
+ a-2 × r-2 + a-3 × r-3 + … a-m × r-m
• Simplified:
• aj = {0 → (r – 1)}
• j is the location of digit “aj” of the quantity in decimal numbers is:

n
D 
j  m
aj r j

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 11


Binary Systems …continued 4

• As we know the general rule, now we can understand


how the binary (base-2) would work
• Base (Radix): “2”
• Symbols: 0, 1
• Weightage of each number increases by a factor of “2” as
its placement moves to the left
• Example:
• (11010)2 (Don’t call it eleven thousand and ten, but
one,one,zero,one,zero; we are not in decimal system)
• (11010.11)2

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 12


Special Powers of 2
210 (=1024) is Kilo, denoted "K"

220 (=1,048,576) is Mega, denoted "M"

230 (1,073, 741,824) is ? Giga, denoted "G"


240 (1,099,511,627,776 ) is Tera, denoted “T"
• Note: 8 bits (b) are also called a byte (B)

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 13


Range of Binary Numbers
• Binary number: ex. a 3-bit number: n=3
– 000, 001 … ,111 or in decimal system: 0, 1 … 7
• Total of 8 numbers (=23)
• Range: from 0 to 7 (0 to 23-1)
– In general an n-bit number represents:
• 2n different numbers
• Min: 0
• Max number: 2n-1
• For fractions: m bits after the radix point:
– Min: 0
– Max number: (2m -1)/2m

06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) DLD Lecture-01 14


The Power of 2
n 2n n 2n
0 20=1 8 28=256
1 21=2 9 29=512
2 22=4 10 210=1024 Kilo

3 23=8 11 211=2048
4 24=16 12 212=4096
5 25=32 20 220=1M Mega

6 26=64 30 230=1G Giga

7 27=128 40 240=1T Tera


06/05/2024 Muhammad Saad Amin (saadamin2k13@gmail.com) 15
DLD Lecture-01

You might also like