Unit Iv
Unit Iv
DIGITAL ELECTRONICS
Number system
• Decimal Base = 10
• Binary Base = 2
• Octal Base = 8
• Hexadecimal (Hex) Base = 16
Decimal Number System
Base (Radix) 10
Digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
e.g. 747510
1 1 1 0
The digit 1 in the third position from the right
represents the value 4 and the digit 1 in the fourth
position from the right represents the value 8.
Octal Number System
Base (Radix) 8
Digits 0, 1, 2, 3, 4, 5, 6, 7
e.g. 16238
512=83 64=82 8=81 1=80
1 6 2 3
2 F 4 D
• Addition
•Complements
•Subtraction
Binary Addition
0 (b) 0
(a)
+0 +1
0 1
(c) 1 (d) 1
+0 +1
1 10
Carry Bit
Binary Addition Examples
(a) 1011 (b) 1010 (c) 1011
+ 1100 + 100 + 101
10111 1110 10000
(d)
101 (e) 10011001
+ 1001 + 101100
1110 11000101
Binary Complement
(1s Complement) Operation
1 0
0 1
Example
110010110
001101001
Two’s Complement
The Two’s complement of a binary number is
obtained by first complementing the number and
then adding 1 to the result.
1001110
0110001 One’s Complement
+ 1
0110010 Two’s Complement
Binary Subtraction
Binary subtraction is implemented by adding the Two’s
complement of the number to be subtracted.
Two’s
Example complement
of 1001
1101 1101
-1001 +0111
10100
If there is a carry then it is ignored. Thus, the
answer is 0100.
Binary Codes
A binary code is a group of n bits that assume up
to 2n distinct combinations of 1’s and 0’s with
each combination representing one element of the
set that is being coded.
0 A
0110000 1000001
1 B
0110001 1000010
2 C
0110010 1000011
3 D
0110011 1000100
4 E
0110100 1000101
5 F
ASCII Continued.
Letter ASCII Letter ASCII
J S
1001010 1010011
K T
1001011 1010100
L U
1001100 1010101
M V
1001101 1010110
N W
1001110 1010111
O X
Logic Gates
A
A B A+B
0 0 0
0 1 1
Parallel Circuit:
B 1 0 1
1 1 1
A+B
NOT
Logic Gate: A A’ or A
(also called an inverter) Truth Table:
a A
0 1
1 0
Single-throw A
Double-pole
Switch: A’ or A
n-input Gates
• Because + and * are binary operations, they can be cascaded
together to OR or AND multiple inputs.
A A
B A+B+C B ABC
C
A A
B A+B+C B ABC
C C
n-bit Inputs
• For convenience, it is sometimes useful to think of the logic
gates processing n-bits at a time. This really refers to n
instances of the logic gate, not a single logic date with n-inputs.
1101100101
1101110111
0100110111
10001111 00001100
00111100
110001 001110
Logic Circuits ≡ Boolean Expressions
• All logic circuits are equivalent to Boolean expressions and any boolean
expression can be rendered as a logic circuit.
• AND-OR logic circuits are equivalent to sum-of-products form.
• Consider the following circuits:
A y=aB+Bc
abc
B aBc
C A
B Y
y
C
Ab
y=abc+aBc+Ab
NAND and NOR Gates
• NAND and NOR gates can greatly simplify circuit diagrams.
As we will see, can you use these gates wherever you
could use AND, OR, and NOT.
A B AB
0 0 1
NAND 0 1 1
x=A.B 1 0 1
1 1 0
A B AB
NOR 0 0 1
x=A+B 0 1 0
1 0 0
1 1 0
XOR and XNOR Gates
• XOR is used to choose between two mutually exclusive inputs. Unlike
OR, XOR is true only when one input or the other is true, not both.
A B AB
XOR 0 0 0
0 1 1
x = AB 1 0 1
1 1 0
XNOR A B A B
0 0 1
x =A B
0 1 0
1 0 0
1 1 1
Properties of NAND AND NOR
• NAND and NOR have special properties, but neither satisfies
the distributive or associative laws.
NAND NOR
x1=X x0=X
x 0=1 x 1=0
x x=X x x=X
x y=X+Y x y=XY
X Y=x+y X Y=xy
not (x y)=xy not (x y)=x+y
Binary Addition
The half adder adds 2 single-bit inputs
It cannot complete a full addition
Half Adder
Full Adder
Circuit-SUM
Full Adder
Circuit-CARRY
03 07 10 14 09 02 00 04
Conversion Methods
• Ladder Comparison
• Successive Approximation
• Slope Integration
• Flash Comparison
Ladder Comparison
Single slope integration
20
•Charge a capacitor at constant
Start
Conversion Start
S Q Enable
Conversion
- R
Counter
N-bit Output
C
IN
+ Oscillator Clk
Successive Approximation
Flash Comparison
•If N is the number of bits
in the output word….
•Then 2N comparators will
be required.
•With modern
icroelectronics this is
quite possible, but will be
expensive.
Pro and Cons
• Successive Approximation
The Happy Medium ??
• Slope Integration & Ladder Approximation
Cheap but Slow
• Flash Comparison
Fast but Expensive
Resolution
EXCITATION TABLE
CHARACTERISTICS EQUATION
Q(next) = S + R'Q
SR = 0
JK Flip-Flop
SYMBOL CHARACTERISTICS TABLE
EXCITATION TABLE
CHARACTERISTICS EQUATION
D Flip-Flop
SYMBOL CHARACTERISTICS TABLE
EXCITATION TABLE
CHARACTERISTICS EQUATION
T Flip-Flop
SYMBOL CHARACTERISTICS TABLE
EXCITATION TABLE
CHARACTERISTICS EQUATION
Registers and Counters
Register - a group of binary storage cells (flip-flops) suitable
for holding binary information.
An n-bit register is a group of n flip-flops.
000
001 111
No input.
010 110 Present state is
output.
011 101
100
Present State Next State Flip - Flop Inputs
ABC ABC TA TB TC
000 001 0 0 1
001 010 0 1 1
010 011 0 0 1
011 100 1 1 1
100 101 0 0 1
101 110 0 1 1
110 111 0 0 1
111 000 1 1 1
B B
0 0 1 0 0 1 1 0
A 0 0 1 0 A 0 1 1 0
TA= BC C C TB = C
B
1 1 1 1
TC = 1
A 1 1 1 1
C
A B C
T Q T Q 1 T Q
A B C
CP CP CP
Q Q Q
Input
Registers
Latch
A4 A3 A2 A1
Q Q Q Q
D D D D
CP
Gate I2 I1
Input I4 I3
4-bit register
CP