Professional Documents
Culture Documents
EEE241 DLDlect 01
EEE241 DLDlect 01
Engineering
Islamabad
EEE241
Digital Logic Design
Lecture No. 1
Dr. Riaz Hussain
Assistant Professor
Department of Electrical Engineering
COMSATS Institute of Information Technology, Islamabad
Review
• Introduction to course and course material
• Why DLD?
• What is DLD?
– Abstraction
– Divide and conquer
– Build upon previous work
• Digital Systems
– Advantages
+5 +5
1 0 1
V V
Time Time
–5 –5
Digital: Analog:
only assumes discrete values values vary over a broad range
continuously
Continuous in
Analog value & time
Digital
Discrete in
Asynchronous
value &
continuous in
time
Synchronous Discrete in
with the clock value & time
02/23/2024 Riaz Hussain (rhussain@comsats.edu.pk) CIIT-IBD-EE EEE241 DLD Lecture-01 6
Digital Systems …continued 3
• Advantages:
– Cheap electronic circuitry
– Easier to calibrate and adjust
– Immunity to noise
• Noise margin Noise added
Sender Receiver
Signal Signal
– 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
3 23=8 11 211=2048
4 24=16 12 212=4096
5 25=32 20 220=1M Mega
• (48.5625)10 = (110000.1001)2
• (48.5625)10 = (143.2401)5
• (48.5625)10 = (60.44)8
• (48.5625)10 = (30.90)16
Evaluate
Magnitude
Decimal Binary
(Base 10) (Base 2)
Hexadecimal
(Base 16)
Evaluate
Magnitude
Conversion between Number Systems
…continued 9
– Conversion between binary and octal
• Each octal digit corresponds to three (3) bits
• Examples:
– (101 110 010 . 011 001 )2 = (562.31)8
– (010 011 100 . 101 001 )2 = (234.51)8
– (745.32)8 = (111 100 101 . 011 010)2
– (306.05)8 = (011 000 110 . 000 101)2
2138
10001011
8 B16
1 1 Carry
5 5
+ 5 5
1 1 0
= Ten ≥ Base
Binary Arithmetic
– Binary Addition
1 1 1 1
101101 ← augend
+100111 ← addend
1010100
1 1 1 1 1 1
1 1 1 1 0 1 = 61
+ 1 0 1 1 1 = 23
1 0 1 0 1 0 0 = 84
≥ (2)10
Binary Arithmetic …continued 2
– Binary Subtraction
101101 ← minuend
−100111 ← subtrahend
000110
1 2 = (10)2
0 2 2 0 0 2
1 0 0 1 1 0 1 = 77
− 1 0 1 1 1 = 23
0 1 1 0 1 1 0 = 54
Binary Arithmetic …continued 3
– Binary Multiplication
1011 ← multiplicand
× 101 ← multiplier
1011
0000
1011 =
110111
1 0 1 1 1
x 1 0 1 0
0 0 0 0 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1
1 1 1 0 0 1 1 0
Binary Arithmetic …continued 4
– Binary Division
Dividend Divisor
↓ ↓
1000001/1100=?
101 . ← Quotient
1100/1000001
1100↓↓ ← shift, if divisor is bigger and write 1 in quotient
010001 ← subtraction
1100 ← since brought down two bits write 01 in quotient
0101 ← Remainder
M= 1010100
2’s complement of N = + 0 1 1 1 1 0 1
10010001
Discard the end carry M – N = 1 0 0 0 1
Supplementary Reading:
http://ecse.bd.psu.edu/c
se271/twoscomp.pdf
02/23/2024 Riaz Hussain (rhussain@comsats.edu.pk) CIIT-IBD-EE EEE241 DLD BCE-3 Lecture-01 53
Signed Binary Numbers…continued 4
• Arithmetic addition
– Ordinary arithmetic (sign magnitude system) requires comparison of
signs and magnitudes
– Signed complement system does not require comparison or
subtraction
+ 4 0100
+ 5 0101
+ 9 1001
BUT, 1 0 0 1 is the representation of – 7 and not 9
• In order to obtain a correct answer, we must ensure that the result has a
sufficient number of bits to accommodate the sum.
8 1000
+ 9 1001
17 1 0 0 0 1 end carry
0 1 1 0 for correction add 6
10111
= (0001 0111)BCD
7
TX RX
At the receiver side:
If an even parity is
Parity bit
detected, send an ACK
Transmit Ha in ascii: control = 00000110
1001000 1100001 If error was detected
Transmit with even parity:
send negative
01001000 11100001 acknowledge NAK =
10010101
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
As we “count” up or down in decimal, the code word
for the Gray code changes in only one bit position as
we go from decimal digit to digit including from 9 to 0.
02/23/2024 Riaz Hussain (rhussain@comsats.edu.pk) CIIT-IBD-EE EEE241 DLD BCE-3 Lecture-01 68
Binary Storage and Registers
• Register: 0000
– Device for holding data 0001
0010
– Most common device for holding data 0011
– Array of binary cells 0100
• Cell is capable of storing a bit (0, 1) information 0101
• Can be set to one of two states 0110
0111
– An “n” cell register can be one of 2n states 1000
• 0 → 2n – 1 1001
1010
– Example: n = 4
1011
1100
1101
1110
1111
x z = x’
0 1
1 0