Chapter 1
Chapter 1
t t
Analog signal Digital signal
Binary Digital Signal
• An information variable represented by physical quantity.
• For digital systems, the variable takes on discrete values.
• Two level, or binary values are the most prevalent values.
• Binary values are represented abstractly by: V(t)
• Digits 0 and 1
• Words (symbols) False (F) and True (T) Logic 1
• Words (symbols) Low (L) and High (H)
• And words On and Off undefine
2 1 0 -1 -2
• Digit Position
• Integer & fraction 5 1 2 7 4
(512.74)8
• Formal Octal Notation
Binary Number System
• Base = 2
• 2 digits { 0, 1 }, called binary digits or “bits”
4 2 1 1/2 1/4
• Weights
• Weight = (Base) Position 1 0 1 0 1
2 1 0 -1 -2
• Magnitude 2 1 0
1 *2 +0 *2 +1 *2 +0 *2 +1 *2
-1 -2
(1E5.7A)16
• Formal Notation:
Powers 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
1 1 Carry
5 5
+ 5 5
1 1 0
= Ten ≥ Base
Subtract a Base
Binary Addition
• Column Addition
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 Subtraction
• Borrow a “Base” when needed
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 Multiplication
• Bit by bit
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
Number Base Conversions
Evaluate
Magnitude
Octal
(Base 8)
Evaluate
Magnitude
Decimal Binary
(Base 10) (Base 2)
Hexadecimal
(Base 16)
Evaluate
Magnitude
Decimal Integer to Binary
Conversion
• Divide the number by the ‘Base’ (=2)
• Take the remainder (either 0 or 1) as a binary digit
• Take the quotient and repeat the division
• Each time, the new remainder gives a more significant binary
digit
Example: (13)10
Quotient Remainder Coefficient
13/ 2 = 6 1 d0 = 1
6 /2= 3 0 d1 = 0
3 /2= 1 1 d2 = 1
1 /2= 0 1 d3 = 1
Answer: (13)10 = (d3 d2 d1 d0)2 = (1101)2
MSB LSB
Decimal Fraction to Binary
Conversion
• Multiply the fractional number by the ‘Base’ (=2)
• Take the integer part (either 0 or 1) as a binary digit
• Take the fractional part of the result and repeat the multiplication
• Each time, the new integer part gives a less significant binary digit
Example: (0.625)10
Integer Fraction Coefficient
0.625 * 2 = 1 . 25 a-1 = 1
0.25 * 2 = 0 . 5 a-2 = 0
0.5 *2= 1 . 0 a-3 = 1
Answer: (0.625)10 = (0.d-1 d-2 d-3)2 = (0.101)2
MSB LSB
Decimal to Octal Conversion
Example: (175)10
Quotient Remainder Coefficient
175 / 8 = 21 7 d0 = 7
21 / 8 = 2 5 d1 = 5
2 /8= 0 2 d2 = 2
Answer: (175)10 = (d2 d1 d0)8 = (257)8
Example: (0.3125)10
Integer Fraction Coefficient
0.3125 * 8 = 2 . 5 d-1 = 2
0.5 *8= 4 . 0 d-2 = 4
Answer: (0.3125)10 = (0.d-1 d-2 d-3)8 = (0.24)8
Binary − Octal Conversion
• 8 = 23 Octal Binary
• Each group of 3 bits (starting from 0 000
the fractional point) represents an
1 001
octal digit should assume
zeros in the empty 2 010
digit positions!
Example: 3 011
( _ 1 0 1 1 0 . 0 1 _ )2 4 100
5 101
6 110
( 2 6 . 2 )8 7 111
( 1 6 . 4 )16
z C
Figure 4.8 - Implementation of full adder with two half adders and an
OR gate
Decoders
Binary Decoder
Only one
● Example: 2-bit Binary Number lamp will
turn on
0 1
x1 0
Binary
0 Decoder 0
x0 0
27 / 65
Decoders
•
28 / 65
Decoders
2-to-4 Line Decoder
YD33
D0 Y22
D
D1
Decoder
A
Binary
D2 Y11
D
B D3
Y00
D
A B D0 D1 D2 D3
A
I1
0 0 1 0 0 0 B
I0
0 1 0 1 0 0
D3 AB D2 AB'
1 0 0 0 1 0
1 1 0 0 0 1 D1 A' B D0 A' B '
29 / 65
Decoders
3-to-8 Line Decoder
The output whose value is equal to 1 represents the minterm equivalent of the
binary number currently available in the input lines.
D0
D1
D2
Decoder
Binary
z D3
y D4
x D5
D6
D7
31 / 65
Decoders
“Enable” Control
YD33
D0
D1 Y
Decoder
I1 D2
Binary
2
I0 D2
Y
D11
E D3
Y
D00
E I1 I 0 D0 D1 D2 D3
0 x x 0 0 0 0
I1
1 0 0 1 0 0 0 I0
1 0 1 0 1 0 0 E
1 1 0 0 0 1 0
1 1 1 0 0 0 1
32 / 65
Encoders
Put “Information” into code
Only one
Binary Encoder switch
● Example: 4-to-2 Binary Encoder should be
activated
at a time
x1
x3 x2 x1 y1 y0
y1 0 0 0 0 0
x2 Binary
0 0 1 0 1
Encoder
y0 0 1 0 1 0
x3 1 0 0 1 1
33 / 65
Encoders
Octal-to-Binary Encoder (8-to-3)
I7
I7 I6 I5 I4 I3 I2 I1 I0 Y2 Y1 Y0 I6
0 0 0 0 0 0 0 1 0 0 0
Encoder
I5 Y2
Binary
0 0 0 0 0 0 1 0 0 0 1 I4 Y1
0 0 0 0 0 1 0 0 0 1 0
I3 Y0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0 I2
0 0 1 0 0 0 0 0 1 0 1 I1
0 1 0 0 0 0 0 0 1 1 0 I7
I0
1 0 0 0 0 0 0 0 1 1 1 I6 Y2
I5
Y2 I 7 I 6 I 5 I 4 I4
I3 Y1
Y1 I 7 I 6 I 3 I 2 I2
I1
Y0 I 7 I 5 I 3 I1 I0 Y0
34 / 65
Encoder / Decoder Pairs
Binary Binary
Encoder Decoder
I7 Y7
I6 Y6
I5 Y5
Y2 I2
I4 Y4
Y1 I1
I3 Y3
Y0 I0
I2 Y2
I1 Y1
I0 Y0
Multiplexers - Select binary information from one of many input
lines and direct it to a single output line.
S1 S0 Y
I0
0 0 I0 I1 MUX
I1 Y
0 1 I2
1 0 I2 I3 S1 S0
1 1 I3
36 / 65
Multiplexers
• 2-to-1 MUX
I0
I0 Y
MUX Y
I1 I1
S
S
• 4-to-1 MUX
I0
I1
Y
I0 I2
I1 MUX I3
Y
I2
I3 S1 S0
S1 S0 37 / 65
DeMultiplexers
Y3
DeMUX Y2
I
Y1
S1 S0 Y0
Y3
Y2 S1 S0 Y3 Y2 Y1 Y0
I
Y1 0 0 0 0 0 I
Y0
0 1 0 0 I 0
1 0 0 I 0 0
S1 1 1 I 0 0 0
S0
38 / 65
DeMultiplexers/Decoders
A decoder with enable input can function as a 1-to-4 demux when E is
taken as a data input line and I1 and I0 are taken as selection inputs.
Y3 Y3
Decoder
I1
Binary
Y Y2
I DeMUX 2 I0
Y1 Y1
S1 S0 Y0 E
Y0
E I1 I 0 Y3 Y2 Y1 Y0
S1 S0 Y3 Y2 Y1 Y0 0 x x 0 0 0 0
0 0 0 0 0 I 1 0 0 0 0 0 1
0 1 0 0 I 0 1 0 1 0 0 1 0
1 0 0 I 0 0 1 1 0 0 1 0 0
1 1 I 0 0 0 1 1 1 1 0 0 0
39 / 65
Sequential Circuits
• Asynchronous
Inputs Outputs
Combinational
Circuit
Memory
Elements
• Synchronous
Inputs Outputs
Combinational
Circuit
Flip-flops
Clock
40
Flip-Flops
• Edge-Triggered D Flip-Flop
D Q
Q Positive
Edge
CLK
D
Flip-Flop Characteristic Tables
D Q D Q(t+1)
0 0 Reset
Q 1 1 Set
J K Q(t+1)
J Q 0 0 Q(t) No change
0 1 0 Reset
K Q 1 0 1 Set
1 1 Q’(t) Toggle
T Q T Q(t+1)
0 Q(t) No change
Q 1 Q’(t) Toggle
Registers
Group of D Flip-Flops I0 D Q A0
Synchronized (Single Clock) R
Store Data
I1 D Q A1
I2 D Q A2
I3 D Q A3
CLK
R
Clear_b
Binary Storage and Registers
• Registers
• A binary cell is a device that possesses two stable states and is capable of storing one of the two states.
• A register is a group of binary cells. A register with n cells can store any discrete quantity of information that contains n bits.
• A register that goes through a prescribed sequence of states upon the application of input
pulses is called a counter.
A Digital Computer Example
Memory
Control
CPU unit Datapath
Synchronous or
Asynchronous?
Transfer of information