Digital Unit I Part 1
Digital Unit I Part 1
Digital Unit I Part 1
SYSTEM DESIGN
1
UNIT-1
Binary Codes, Digital Arithmetic and
Simplification of Boolean Functions
2
COMMON NUMBER SYSTEMS
3
QUANTITIES/COUNTING (1 OF 3)
Hexa-
Decimal Binary Octal decimal
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
4 p. 33
QUANTITIES/COUNTING (2 OF 3)
Hexa-
Decimal Binary Octal decimal
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
5
QUANTITIES/COUNTING (3 OF 3)
Hexa-
Decimal Binary Octal decimal
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
20 10100 24 14
21 10101 25 15
22 10110 26 16
23 10111 27 17 Etc.
6
CODE CONVERSION
Decimal Octal
Binary Hexadecimal
7
QUICK EXAMPLE
Base
8
DECIMAL TO DECIMAL
Decimal Octal
Binary Hexadecimal
9
Weight
Base
10
BINARY TO DECIMAL
Decimal Octal
Binary Hexadecimal
11
BINARY TO DECIMAL
Technique
Multiply each bit by 2n, where n is the “weight” of the bit
The weight is the position of the bit, starting from 0 on the
right
Add the results
12
EXAMPLE
Bit “0”
1010112 => 1 x 20 = 1
1 x 21 = 2
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
4310
13
OCTAL TO DECIMAL
Decimal Octal
Binary Hexadecimal
14
OCTAL TO DECIMAL
Technique
Multiply each bit by 8n, where n is the “weight” of the bit
The weight is the position of the bit, starting from 0 on the
right
Add the results
15
EXAMPLE
7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
16
HEXADECIMAL TO DECIMAL
Decimal Octal
Binary Hexadecimal
17
HEXADECIMAL TO DECIMAL
Technique
Multiply each bit by 16n, where n is the “weight” of the bit
The weight is the position of the bit, starting from 0 on the
right
Add the results
18
EXAMPLE
19
DECIMAL TO BINARY
Decimal Octal
Binary Hexadecimal
20
DECIMAL TO BINARY
Technique
Divide by two, keep track of the remainder
First remainder is bit 0 (LSB, least-significant bit)
Second remainder is bit 1
Etc.
21
EXAMPLE
12510 = ?2 2 125
2 62 1
2 31 0
2 15 1
2 7 1
2 3 1
2 1 1
0 1
12510 = 11111012
22
OCTAL TO BINARY
Decimal Octal
Binary Hexadecimal
23
OCTAL TO BINARY
Technique
Convert each octal digit to a 3-bit equivalent binary
representation
24
EXAMPLE
7058 = ?2
7 0 5
7058 = 1110001012
25
HEXADECIMAL TO BINARY
Decimal Octal
Binary Hexadecimal
26
HEXADECIMAL TO BINARY
Technique
Convert each hexadecimal digit to a 4-bit equivalent binary
representation
27
EXAMPLE
10AF16 = ?2
1 0 A F
10AF16 = 00010000101011112
28
DECIMAL TO OCTAL
Decimal Octal
Binary Hexadecimal
29
DECIMAL TO OCTAL
Technique
Divide by 8
Keep track of the remainder
30
EXAMPLE
123410 = ?8
8 1234
8 154 2
8 19 2
8 2 3
0 2
123410 = 23228
31
DECIMAL TO HEXADECIMAL
Decimal Octal
Binary Hexadecimal
32
DECIMAL TO HEXADECIMAL
Technique
Divide by 16
Keep track of the remainder
33
EXAMPLE
123410 = ?16
16 1234
16 77 2
16 4 13 = D
0 4
123410 = 4D216
34
BINARY TO OCTAL
Decimal Octal
Binary Hexadecimal
35
BINARY TO OCTAL
Technique
Group bits in threes, starting on right
Convert to octal digits
36
EXAMPLE
10110101112 = ?8
1 3 2 7
10110101112 = 13278
37
BINARY TO HEXADECIMAL
Decimal Octal
Binary Hexadecimal
38
BINARY TO HEXADECIMAL
Technique
Group bits in fours, starting on right
Convert to hexadecimal digits
39
EXAMPLE
10101110112 = ?16
10 1011 1011
2 B B
10101110112 = 2BB16
40
OCTAL TO HEXADECIMAL
Decimal Octal
Binary Hexadecimal
41
OCTAL TO HEXADECIMAL
Technique
Use binary as an intermediary
42
EXAMPLE
10768 = ?16
1 0 7 6
2 3 E
10768 = 23E
43 16
HEXADECIMAL TO OCTAL
Decimal Octal
Binary Hexadecimal
44
HEXADECIMAL TO OCTAL
Technique
Use binary as an intermediary
45
EXAMPLE
1F0C16 = ?8
1 F 0 C
1 7 4 1 4
1F0C16 = 17414
46 8
BASIC BINARY ARITHMETIC
Binary Addition
47
BINARY ADDITION
0 0 1 1
+ 0 + 1 + 0 + 1
0 1 1 10
48
BINARY ADDITION
Examples:
49
BASIC BINARY ARITHMETIC
Binary Subtraction
50
BINARY SUBTRACTION
Borrow
0 10 1 1
- 0 - 1 - 0 - 1
0 1 1 0
Difference
51
BINARY SUBTRACTION
Examples:
52
BASIC BINARY ARITHMETIC
0 0 0 0 0 0 0
0 1 0 1 0 1 1
1 0 0 1 1 0 1
1 1 1 0 1 1 0
53
INTRODUCTION
54
1’S COMPLEMENT SUBTRACTION
addition.
55
CONT.,
56
1’S COMPLEMENT METHOD
3.
1. Determine
2. Add this the
Remove tothe
the
carry
1’s
larger
complement
andnumber
add it toof
thethe
result.
smaller
Thisnumber.
carry is
called end-around-carry
57
EXAMPLE OF 1’S COMPLEMENT
3.
1. The
2. Determine
Add answer
this to the
the
is the
1’s
smaller
1’s
complement
complement
numberof aoflarge
the result
numberand is
60
STEPS
1.
3.
2. Determine
Omit
Add this
the to the
the2’s
carry complement
(larger
there is alwaysof
number the smaller
a carry in thisnumber
case )
61
EXAMPLE OF 2’S COMPLEMENT
1 1 1 1 1 1 1 1
1 0 1 0 2’s complement 0 1 1 0
0 1 01 Carry 1 01 0 1
62
SUBTRACTION STEPS
3.
1.
2.
4. Add
There
Determine
the
To get isan2’s
noanswer
the
carry
complement
2’s .complement
The
in result
truetoform,
theissmaller
ofinthe
2’s larger
take complement
number
the 2’snumber
63
form is negative
complement and change the sign.
COMPARISON BETWEEN 1’S AND 2’S
COMPLEMENTS
65
LOGIC GATES
66
LOGIC GATES
67
The AND gate
68
The OR gate
69
The NOT gate (or inverter)
70
A logic buffer gate
71
The NAND gate
72
The NOR gate
73
The Exclusive OR gate
74
The Exclusive NOR gate
75
Boolean Algebra and Logic Simplification
76
BOOLEAN OPERATIONS AND EXPRESSIONS
77
BOOLEAN OPERATIONS AND
EXPRESSIONS
Addition Multiplication
0+0=0 0*0=0
0+1=1 0*1=0
1+0=1 1*0=0
1+1=1 1*1 =1
78
LAWS AND RULES OF BOOLEAN ALGEBRA
79
LAWS BOOLEAN ALGEBRA
Commutative Laws
Associative Laws
Distributive Law
80
LAWS OF BOOLEAN ALGEBRA
Commutative Law of Addition:
A+B= B+A
81
LAWS OF BOOLEAN ALGEBRA
82
LAWS OF BOOLEAN ALGEBRA
83
LAWS OF BOOLEAN ALGEBRA
84
LAWS OF BOOLEAN ALGEBRA
Distributive Law:
A(B + C) = AB + AC
RULES OF BOOLEAN ALGEBRA
86
RULES OF BOOLEAN ALGEBRA
Rule 1
OR Truth Table
87
RULES OF BOOLEAN ALGEBRA
Rule 2
OR Truth Table
88
RULES OF BOOLEAN ALGEBRA
Rule 3
Rule 4
90
RULES OF BOOLEAN ALGEBRA
Rule 5
OR Truth Table
91
RULES OF BOOLEAN ALGEBRA
Rule 6
OR Truth Table
92
RULES OF BOOLEAN ALGEBRA
Rule 7
93
RULES OF BOOLEAN ALGEBRA
Rule 8
94
RULES OF BOOLEAN ALGEBRA
Rule 9
95
RULES OF BOOLEAN ALGEBRA
Rule 10: A + AB = A
Rule 11: A AB A B
99
DEMORGAN’S THEOREMS
Theorem 1
XY X Y
XY X Y
Theorem 2
X Y XY
Remember:
“Break the bar,
change the sign”
100
STANDARD FORMS OF BOOLEAN
EXPRESSIONS
101
STANDARD FORMS OF BOOLEAN EXPRESSIONS
102
CONVERTING BETWEEN CIRCUITS
AND EQUATIONS
Find the output of the following circuit
x x+y
y (x+y)y
y y
Answer: (x+y)y
103
PROPERTY
COMMUTATIVE
A+B=B+A A.B=B.A
ASSOCIATIVE PROPERTY
A+(B+C)=(A+B)+C A.(B.C)=(A.B).C
DISTRIBUTIVE
A+BC= (A+B)(A+C) A.(B+C)=(A.C)+(A.B)
104
BOOLEAN LAWS
ADDITION
1) A+0=A
2) A+1=1
3) A+A=A
4) A+=1
MULTIPLICATION
5) A.0=0
6) A.1=A
7) A.A=A
8) A=0
9) =A
105
PROOF
i) A+AB = A
ii) A+ B=A+B
iii) AB+
SOLUTION
A+AB= A(1+B) DIS
= A(1) LAW 2
=A LAW 6
106
A+
B= (A+ ).(A+B) DIS
= (1) .(A+B) LAW4
= A+B LAW6
107
DE MORGANS
=+
BUBBLE PUSHING THEOREM
=.
108
SOLVE
THE FOLLOWING
A+AB+ AC = A+ AC (A+AB=A)
= A(1+ C)
= A(1)
=A
AC(BD+CED)+A
=ACBD+ACCED+ A (DIS)
= 0 + ACED + A (LAW 7&8)
= A (CED+ (A+B=A+B)
= A (ED
109
=F
F
=
= (a+b)(a+c)=a+bc
=
=
110
BCD ADDITION
What is BCD
Binary Coded Decimal
Mean’s
If decimal converted binary (eg) 17
2 17
2 8 -1
2 4 -0
2 2 -0
1- 0 0001 0001
BCD 1 7
0001 0111
111
1 0 0 1
0 1 0 0 (+)
1 1 0 1
0 1 1 0 (+)
000100 1 1
1 3
112
19 - 00011001
14 - 00010100
33- 00101101
00101101
0110
00110011
3 3
113
GATES
BASIC
AND
OR
NOT
UNIVERSAL
NAND
NOR
DERIVED
EX-OR
EX-NOR
114
AND
A B OUT
A 0 0 0
OUT 0 1 0
B 1 0 0
1 1 1
115
OR
A A B OUT
OUT 0 0 0
B 0 1 1
1 0 1
1 1 1
116
NOT
A OUT A OUT
0 1
1 0
OR + NOT
NOR
117
NAND GATE
A B OUT
A 0 0 1
0 1 1
B 1 0 1
1 1 0
118
IMPLEMENT INVERTER USING NAND GATE
A
OUT
B
A OUT
B
0 0 1
0 1 1
1 0 1
1 1 0
119
OR gate using NAND gate
A
= A+B
120
121
122
123
124
125
126
ERROR DETECTING AND
CORRECTING CODES
127
INTRO
The dynamic physical interaction of the electrical signals
affecting the data path of a memory unit may cause occasional
errors in storing and retrieving the binary information. The
reliability of a memory unit may be improved by employing
error‐detecting and error‐correcting codes. The most common
error detection scheme is the parity bit.
A parity bit is generated and stored along with the data word in
memory. The parity of the word is checked after reading it
from memory. The data word is accepted if the parity of the
bits read out is correct. If the parity checked results in an
inversion, an error is detected, but it cannot be corrected.
128
INTRO-CONT
An error‐correcting code generates multiple parity check
bits that are stored with the data word in memory. Each
check bit is a parity over a group of bits in the data
word. When the word is read back from memory, the
associated parity bits are also read from memory and
compared with a new set of check bits generated from the
data that have been read.
If the check bits are correct, no error has occurred.
130
PARITY GENERATOR AND CHECKER
The CKT that generates the parity bit in the transmitter is
called a parity generator and the CKT that checks the
parity in the receiver is called parity checker
EVEN & ODD Parity
In even parity , the added parity bit will make the total
no of 1’s even amount. Use XOR
In odd parity , the added parity bit will make the total no
of 1’s odd amount. Use XNOR
131
HAMMING CODE
Hamming code not only provide the detection of a bit error,
but also identifies which bit is in error so that it can be
corrected.
Number of Parity Bits
2r m + r + 1
m -> information bit
r -> parity bit
Case:1
m=4, let r=2 then 2 2 = 4 , 4+2+1=7, 4 ≠7 Not satisfied
Case:1
m=4, let r=3 then 2 3 = 8 , 4+3+1=8, 8 =7 satisfied 132
CONT……
The parity bits are located in the position that are
numbered corresponding to ascending power of Two
(1,2,4,8….)
Format of (4,3) 7 bit hamming code to be transmitted ,
were 4 mgs bit, 3 parity bit
Assignment FOR P1
m7 m6 m5 p4 m3 p2 p1
So it will calculated m7
CONT……
Assignment
FOR P4
m7 m6 m5 p4 m3 p2 p1
Bit desinition m7 m6 m5 p4 m3 p2 p1
Bit location 7 6 5 4 3 2 1
Binary code 111 110 101 100 011 010 001
Information bits 1 0 1 1
Paity Bit 0 0 1
Coded message 1 0 1 0 1 0 1 135
PROBLEM-2
Encode the binary word 10111 into seven bit odd parity
hamming code.
=0
2 m+r+1
r
=1
So m= 5 , let r = 4
24 5 + 4+ 1
=1
16 10 =0
Bit desinition m9 p8 m7 m6 m5 p4 m3 p2 p1
Bit location 9 8 7 6 5 4 3 2 1
Binary code 1001 1000 0111 0110 0101 0100 0011 0010 0001
Information bits 1 0 1 1 1
Paity Bit 0 1 1 0
Coded message 1 0 0 1 1 1 1 1 0 136
PROBLEM-3
Assume that even parity hamming code 0100011 is
received. Find error in the message and correct it ?
Bit desinition m7 m6 m5 p4 m3 p2 p1
Bit location 7 6 5 4 3 2 1
Binary code 111 110 101 100 011 010 001
Information bits 0 1 0 0 0 1 1
Correct information 0 1 1 0 0 0 1
c=p
m7=1 101 = 5
c=
p2 m7=0 Invert the bit
c=p4
m7 = 1 in 5th 137
location